Opened 12 years ago

Closed 10 years ago

#32662 closed defect (wontfix)

netbsd-iscsi-initiator

Reported by: mrchulho@… Owned by: pixilla (Bradley Giesbrecht)
Priority: Normal Milestone:
Component: ports Version: 2.0.3
Keywords: lion clang Cc: lhunath@…, ericmoret, occidens@…
Port: netbsd-iscsi-initiator

Description (last modified by mf2k (Frank Schima))

  1. port netbsd-iscsi-initiator won't compile with clang in Xcode 4.2. As instructed in the Problem Hotlist, I am filing a ticket after verifying successful compiling by gcc.
  1. iscsi-initiator is trying to connect localhost even though option -h host_ip is specified.

Logs read:

iscsi-initiator -4Dv -a chap -h 192.168.1.11 -u <username>
pid 83147:util.c:878: ***ERROR*** connect() to localhost:3260 failed (errno 61)
pid 83147:initiator.c:1376: ***ERROR*** iscsi_sock_connect() failed
pid 83147:initiator.c:1587: ***ERROR*** tx_worker[0]: session exited prematurely (state 0x4)
pid 83147:initiator.c:319: ***ERROR*** Tx worker 0 started with an error
pid 83147:initiator.c:1262: ***ERROR*** session_init_i() failed (ignoring command)
^C
  1. Newer version netbsd-iscsi-20111006.tar.gz is up at ftp.netbsd.org.

Thank you.

Change History (17)

comment:1 Changed 12 years ago by pixilla (Bradley Giesbrecht)

Keywords: lion clang added; iscsi removed
Owner: changed from macports-tickets@… to pixilla@…

comment:2 Changed 12 years ago by mf2k (Frank Schima)

Description: modified (diff)
Type: requestdefect

comment:3 Changed 12 years ago by pixilla (Bradley Giesbrecht)

I installed Openfiler, Windows XP and NetBSD in vm's.

With an Openfiler iscsi target Windows was able to initiate a connection to the Openfiler target.

On NetBSD iscsi-target does not appear to honor the -h flag. I have found so little documentation on netbsd iscsi-initiator.

I am looking for a known good netbsd iscsi-initiator connection configuration. Help!

comment:4 in reply to:  description ; Changed 12 years ago by a639989@…

Happened also with Snow Leo:

iscsi-initiator -Dv -u myuser -h 192.168.1.10 /tmp/aa/

pid 87152:util.c:878: *ERROR* connect() to localhost:3260 failed (errno 61) pid 87152:initiator.c:1376: *ERROR* iscsi_sock_connect() failed pid 87152:initiator.c:1587: *ERROR* tx_worker[0]: session exited prematurely (state 0x4) pid 87152:initiator.c:319: *ERROR* Tx worker 0 started with an error pid 87152:initiator.c:1262: *ERROR* session_init_i() failed (ignoring command)

comment:5 in reply to:  4 ; Changed 12 years ago by always.sed@…

I'm curious if somebody managed to make netbsd initiator to work under OS X

I gave it a try on my side and I found couple issues:

The -v needs a parameter based on

while ((i = getopt(argc, argv, "46a:bcd:Dfh:p:t:u:v:V")) != -1) {

The next issue seems to be the SendTarget command (src/lib/initiator.c). The netbsd version sends "=all" while linux target implementation expects "=All" (and it's case sensitive) Once both issues are fixed I can get discovery running and was able to get the list of targets/luns available But the attempt to login (ISCSI_LOGIN_CMD) fails due to kernel crash on the target side :-) (NULL pointer deference kernel version 2.6.37.6 )

Call Trace:

[<ffffffffa0065de5>] iscsi_create_default_params+0x815/0x9c0 [iscsi_target_mod] [<ffffffffa006e515>] iscsi_target_login_thread+0x1485/0x1c80 [iscsi_target_mod] [<ffffffff88071c90>] ? call_rcu_sched+0x10/0x20 [<ffffffff88003014>] kernel_thread_helper+0x4/0x10 [<ffffffffa006d090>] ? iscsi_target_login_thread+0x0/0x1c80 [iscsi_target_mod] [<ffffffff88003010>] ? kernel_thread_helper+0x0/0x10

Tried with QNAP-459 PRO and ReadyNAS ultra4 Didn't have time to play more with it.

Replying to a639989@…:

Happened also with Snow Leo:

iscsi-initiator -Dv -u myuser -h 192.168.1.10 /tmp/aa/

pid 87152:util.c:878: *ERROR* connect() to localhost:3260 failed (errno 61) pid 87152:initiator.c:1376: *ERROR* iscsi_sock_connect() failed pid 87152:initiator.c:1587: *ERROR* tx_worker[0]: session exited prematurely (state 0x4) pid 87152:initiator.c:319: *ERROR* Tx worker 0 started with an error pid 87152:initiator.c:1262: *ERROR* session_init_i() failed (ignoring command)

comment:6 in reply to:  5 Changed 12 years ago by pixilla (Bradley Giesbrecht)

Replying to always.sed@…:

I'm curious if somebody managed to make netbsd initiator to work under OS X

Not that I am aware of. If you have any patches that improve what we have now please attach them to this ticket and I will include them in the port. There has been steady interest in getting this port to work.

comment:7 Changed 12 years ago by jmroot (Joshua Root)

Why does this port even exist in the main tree if nobody has ever managed to make it work on OS X?

comment:8 in reply to:  7 Changed 12 years ago by louwrentius@…

Same story here. I don't have enough knowledge how to alter the source and recompile, but I do get the software to connect to my ISCSI target. Verified that with tcpdump. No chap. Configured it just to work. Tested with open-iscsi initiator on linux.

Louwrentius:bin nan03$ ./iscsi-initiator -h 10.0.1.4 pid 39209:initiator.c:2222: *ERROR* Bad Status-Class: got 2, expected 0 pid 39209:initiator.c:2018: *ERROR* initiator_cmd_t failed pid 39209:initiator.c:716: *ERROR* login_phase_i() failed pid 39209:initiator.c:1301: *ERROR* enqueue_worker: discovery_phase() failed (ignoring command)

comment:9 Changed 12 years ago by lhunath@…

Cc: lhunath@… added

Cc Me!

comment:10 Changed 11 years ago by warlock@…

I finally got the netbsd initiator work with OS X - at least under well defined test environment :-)! After some Code Cleanup I will make a diff file and attach it to the ticket here (maybe next week). The netbsd initiator currently only works with the netbsd target (should be no problem with a netbsd or a linux server (which uses the netbsd target too)).

comment:11 in reply to:  10 Changed 11 years ago by brendonwalsh@…

Replying to warlock@…:

After some Code Cleanup I will make a diff file and attach it to the ticket here (maybe next week).

Did you run into more issues? I'd love to see this working code. I've just recently started looking into this issue myself.

comment:12 Changed 11 years ago by brendonwalsh@…

As was previously stated, the initiator does work without error when used with a netbsd-iscsi-target.

No patch was required to get it to connect to an iSCSI target running on localhost. The issue that I have run into is trying to mount the virtual regular "storage" file within the target directory that the initiator mounts.

hdiutil is of no help and causes the mount to lose it's directory contents and must be remounted again. I was able to mount the target using VirtualBox and write to the volume so I know that the target is not at fault. My guess at the moment is some fuse component that isn't mounting the "storage" file as it should.

Hopefully someone else attempts this and can debug a little further than me.

comment:13 Changed 11 years ago by ericmoret

Cc: eric.moret@… added

Cc Me!

comment:14 Changed 11 years ago by occidens@…

Cc: occidens@… added

Cc Me!

comment:15 Changed 11 years ago by e369484@…

Any chance this piece of SW will work with Linux target then? Esp. tgtd. Trying without chap. 'iscsi-test' points to server on same LAN. From another Linux box it works like a charm (for some time).

iscsi-initiator -h iscsi-test ./mydisk/
pid 51437:initiator.c:2222: ***ERROR*** Bad Status-Class: got 2, expected 0
pid 51437:initiator.c:2018: ***ERROR*** initiator_cmd_t failed
pid 51437:initiator.c:716: ***ERROR*** login_phase_i() failed
pid 51437:initiator.c:1301: ***ERROR*** enqueue_worker: discovery_phase() failed (ignoring command)

Thx.

comment:16 in reply to:  15 Changed 11 years ago by pixilla (Bradley Giesbrecht)

Replying to e369484@…:

Any chance this piece of SW will work with Linux target then? Esp. tgtd. Trying without chap. 'iscsi-test' points to server on same LAN. From another Linux box it works like a charm (for some time).

The support of this port is beyond my skills; and the knowledgable interested parties have apparently moved on. I doubt this port will ever work without the attention of someone with serious skills.

comment:17 Changed 10 years ago by pixilla (Bradley Giesbrecht)

Resolution: wontfix
Status: newclosed

Port removed in r110837

Note: See TracTickets for help on using tickets.