iscsiadm: Could not login session (err 4)

227 views
Skip to first unread message

bike...@hotmail.com

unread,
May 7, 2007, 6:00:37 AM5/7/07
to open-iscsi
Hi,

I am using RHEL5.0(2.6.18-8.el5) and iscsi-initiator-
utils-6.2.0.742-0.5.el5 with EMC CX3-20c.

The host cannot see LUNs when the system startup with the following
error.
---------------
"Setting up iSCSI targets: Login session [192.168.0.10:3260 iqn.
1992-04.com.emc.cx.apm00000000000.a0]
iscsiadm: Could not login session (err 4).
iscsiadm: initiator reported error (4 - encountered connection
failure)"
---------------

After the system bootup, when I login the session to targets
manually(# iscsiadm -m node -p 192.168.0.10 -T XXXXXX -l), the host
can see LUNs normally.

Does anyone have same experience such as above situation?
I want to see LUNs automatically when the host bootup.

Thanks in advance,
Fumi

Mike Christie

unread,
May 8, 2007, 4:12:41 PM5/8/07
to open-...@googlegroups.com
bike...@hotmail.com wrote:
> Hi,
>
> I am using RHEL5.0(2.6.18-8.el5) and iscsi-initiator-
> utils-6.2.0.742-0.5.el5 with EMC CX3-20c.
>
> The host cannot see LUNs when the system startup with the following
> error.
> ---------------
> "Setting up iSCSI targets: Login session [192.168.0.10:3260 iqn.
> 1992-04.com.emc.cx.apm00000000000.a0]
> iscsiadm: Could not login session (err 4).
> iscsiadm: initiator reported error (4 - encountered connection
> failure)"
> ---------------
>
> After the system bootup, when I login the session to targets
> manually(# iscsiadm -m node -p 192.168.0.10 -T XXXXXX -l), the host
> can see LUNs normally.
>

If you run "/etc/init.d/iscsi start" after the system has booted and
settled a bit does it then work?

Fumi

unread,
May 9, 2007, 5:55:29 AM5/9/07
to open-iscsi
The iscsi process is comingup normally, but there is no session.
[root@DELL134 ~]# iscsiadm -m session
iscsiadm: no active sessions

So, everytime the host has booted, I have to run "iscsiadm -m node -p
XX.XX.XX.XX -T XXXX -l" or "iscsiadm -m node --loginall=automatic".

Mike Christie

unread,
May 9, 2007, 11:43:28 AM5/9/07
to open-...@googlegroups.com

Oh this sounds like that problem where the network is not ready yet or
is settling or something. If Hannes or the EMC guys do not chime in we
can ping them to find out exactly.

stijn

unread,
May 11, 2007, 6:18:42 AM5/11/07
to open-iscsi

We got simular behaviour with RHEL5 (actually CentOS 5) and our
AX150i: upon reboot the first portal failed te connect. When we added
a small delay of 4 seconds in /etc/init.d/iscsi, the problem
disappeared:

echo -n $"Setting up iSCSI targets: "
sleep 4
iscsiadm -m node --loginall=automatic

Mark

Fumi

unread,
May 14, 2007, 4:16:05 AM5/14/07
to open-iscsi
That's a good workaround, I'll try it.

Thank you for your help,
Fumito

> > can ping them to find out exactly.- Hide quoted text -
>
> - Show quoted text -

Boaz Harrosh

unread,
May 14, 2007, 4:46:55 AM5/14/07
to open-...@googlegroups.com
I encountered this too. I think it is something to do with modprobe iscsi_tcp
not been initialized/done yet. I have a sleep too, but I recall seeing
on the list
someone who did a if[ -e xxxx] where xxxx is some device name or a /proc node
that when it is up means iscsi_tcp is ready.

Mike can you think of something we can test to make sure in scripts that
iscsi_tcp/iscsid are ready?

Boaz

Mike Christie

unread,
May 14, 2007, 11:57:51 AM5/14/07
to open-...@googlegroups.com

If you are getting


iscsiadm: initiator reported error (4 - encountered connection
failure

then it does not have much to do with iscsi_tcp or iscsi. We are still
trying to complete the connect() call. When the iscsi_tcp module_init
completes and modprobe/insmod returns it is ready to go.

Back in the iscsi_sfnet/linux-iscsi days, when we had a ioctl and a char
device for the ioctl, we had a

while (/dev/iscsi_sfnet_char_device not repsent)
sleep 1

in the start up script, because udev took a while to make the char
device's /dev node, but we do not need that in open-iscsi since we use
netlink.

What NICs are people using and having troubles? Hannes reported that
with tg3 there was a problem where it was taking a long time to get ready.

I think in some distros the network will initially start up and wait for
things like dhcp to acquire a address, but if it takes too long then it
will be done in the background and the rest of the start up will
continue. So when iscsi starts if the network is not ready, we still try
to connect and login for node.conn[0].timeo.login_timeout seconds, and
if not successful give up and return the error that was reported.

So we can do some simple things to work around the problem, like
increase the login timeout, but we also probably need to implement
reopen_max for normal session mode so we do not give up on the first
try. I will send a patch for this later.

Or maybe iscsi should be started off some network hotplug event that
would signal that the network is ready to go, but I am not sure about that.

mark...@gmail.com

unread,
May 11, 2007, 6:09:52 AM5/11/07
to open-iscsi
On RHEL5 (actually CentOS 5), and an AX150i, I missed the first portal
when rebooting the system. Adding a small delay in /etc/init.d/iscsi
solved the problem:

echo -n $"Setting up iSCSI targets: "
sleep 4
iscsiadm -m node --loginall=automatic

Mark

Reply all
Reply to author
Forward
0 new messages