cannot logout

2,419 views
Skip to first unread message

p...@fhri.org

unread,
Nov 10, 2010, 6:02:02 PM11/10/10
to open-...@googlegroups.com
I had a session logged in while structural changes were made to the SAN.  The session is no longer valid as target names and LUNs have changed.  However, I cannot log the session out or even stop the iscsi service on the server.  I can't bounce the server for several more days.  I can stop the iscsid service which stops the barage of login errors I get from the SAN, but I cannot end the session or remove the node.
 
[db1: ~]# iscsiadm -m node -p 172.16.10.11 -o delete
iscsiadm: This command will remove the record [iface: default, target: target0, portal: 172.16.10.11,3260], but a session is using it. Logout session then rerun command to remove record.
iscsiadm: Could not execute operation on all records. Err 22.
[db1: ~]# iscsiadm -m node --logoutall=all
Logging out of session [sid: 1, target: target0, portal: 172.16.10.11,3260]
iscsiadm: Could not logout of [sid: 1, target: target0, portal: 172.16.10.11,3260]:
iscsiadm: initiator reported error (9 - internal error)
[db1: ~]# service iscsi stop
Logging out of session [sid: 1, target: target0, portal: 172.16.10.11,3260]
iscsiadm: Could not logout of [sid: 1, target: target0, portal: 172.16.10.11,3260]:
iscsiadm: initiator reported error (9 - internal error)
Stopping iSCSI daemon:                              [  OK  ]
[db1: ~]# iscsiadm -m session
tcp: [1] 172.16.10.11:3260,4 target0
CentOS 5.4  (2.6.18-164.11.1.el5)
iscsi-initiator-utils.x86_64    6.2.0.871-0.16.el5
 
Thanks for your help,
Paul
-- ea926h

Mike Christie

unread,
Nov 13, 2010, 5:30:02 PM11/13/10
to open-...@googlegroups.com, p...@fhri.org
On 11/10/2010 05:02 PM, p...@fhri.org wrote:
> I had a session logged in while structural changes were made to the SAN.
> The session is no longer valid as target names and LUNs have changed.
> However, I cannot log the session out or even stop the iscsi service on
> the server. I can't bounce the server for several more days. I can
> stop the iscsid service which stops the barage of login errors I get
> from the SAN, but I cannot end the session or remove the node.
>
> [db1: ~]# iscsiadm -m node -p 172.16.10.11 -o delete
> iscsiadm: This command will remove the record [iface: default, target:
> target0, portal: 172.16.10.11,3260], but a session is using it. Logout
> session then rerun command to remove record.
> iscsiadm: Could not execute operation on all records. Err 22.

Yeah, that should fail. It only deletes the record for the target
portal. It would not log it out.

>
> [db1: ~]# iscsiadm -m node --logoutall=all
> Logging out of session [sid: 1, target: target0, portal:
> 172.16.10.11,3260]
> iscsiadm: Could not logout of [sid: 1, target: target0, portal:
> 172.16.10.11,3260]:
> iscsiadm: initiator reported error (9 - internal error)
>

This should work. Can you run

iscsiadm -m session -P 3

and send the output.

internal error normally means the session is just getting started and so
we cannot log it out yet.


> [db1: ~]# service iscsi stop
> Logging out of session [sid: 1, target: target0, portal:
> 172.16.10.11,3260]
> iscsiadm: Could not logout of [sid: 1, target: target0, portal:
> 172.16.10.11,3260]:
> iscsiadm: initiator reported error (9 - internal error)
> Stopping iSCSI daemon: [ OK ]

This runs the logout all command above so it fails for the same reason.


> [db1: ~]# iscsiadm -m session
> tcp: [1] 172.16.10.11:3260,4 target0
>
> CentOS 5.4 (2.6.18-164.11.1.el5)
> iscsi-initiator-utils.x86_64 6.2.0.871-0.16.el5
>
> Thanks for your help,
> Paul
>
>
> --

> ea926p
>

p...@fhri.org

unread,
Nov 15, 2010, 12:06:58 PM11/15/10
to Mike Christie, open-...@googlegroups.com

Thanks for your reply Mike.
Since submitting that question, I've been able to bounce the server,
which cleared up the troublesome session and all is well now.

--
Paul


--
ea926p

Maverick

unread,
Nov 29, 2010, 5:43:53 PM11/29/10
to open-iscsi
Hi Mike,

I am facing a similar issue.

[root@maverick iscsi]# service iscsid stop
Not stopping iscsid: iscsi sessions still active [WARNING]

Ok, so we have an active iscsi session.

[root@maverick iscsi]# iscsiadm -m session
tcp: [10] 10.63.8.193:3260,1027 iqn.
1992-08.com.netapp:sn.cdfd3c5ae76111df9fd8123478563412:vs.2
[root@maverick iscsi]# iscsiadm -m session --sid=10 --op=delete
iscsiadm: This command will remove the record [iface: default, target:
iqn.1992-08.com.netapp:sn.cdfd3c5ae76111df9fd8123478563412:vs.2,
portal: 10.63.8.193,3260], but a session is using it. Logout session
then rerun command to remove record.
iscsiadm: Could not execute operation on all records. Err 22.



[root@maverick iscsi]# iscsiadm -m node --logoutall=all
Logging out of session [sid: 10, target: iqn.
1992-08.com.netapp:sn.cdfd3c5ae76111df9fd8123478563412:vs.2, portal:
10.63.8.193,3260]
iscsiadm: Could not logout of [sid: 10, target: iqn.
1992-08.com.netapp:sn.cdfd3c5ae76111df9fd8123478563412:vs.2, portal:
10.63.8.193,3260]:
iscsiadm: initiator reported error (9 - internal error)


[root@maverick iscsi]#
[root@maverick iscsi]# iscsiadm -m session -P 3
iSCSI Transport Class version 2.0-870
iscsiadm version 2.0-870
Target: iqn.1992-08.com.netapp:sn.cdfd3c5ae76111df9fd8123478563412:vs.
2
Current Portal: 10.63.8.193:3260,1027
Persistent Portal: 10.63.8.193:3260,1027
**********
Interface:
**********
Iface Name: default
Iface Transport: tcp
Iface Initiatorname: iqn.1994-05.com.fedora:rhooda
Iface IPaddress: 10.62.8.175
Iface HWaddress: default
Iface Netdev: default
SID: 10
iSCSI Connection State: TRANSPORT WAIT
iSCSI Session State: FREE
Internal iscsid Session State: REPOEN
************************
Negotiated iSCSI params:
************************
HeaderDigest: None
DataDigest: None
MaxRecvDataSegmentLength: 131072
MaxXmitDataSegmentLength: 65536
FirstBurstLength: 65536
MaxBurstLength: 65536
ImmediateData: Yes
InitialR2T: No
MaxOutstandingR2T: 1
************************
Attached SCSI devices:
************************
Host Number: 13 State: running
scsi13 Channel 00 Id 0 Lun: 0
Attached scsi disk sdb State: running

But ...
[root@maverick iscsi]# mount | grep sdb
sdb is not mounted anywhere.

[root@maverick iscsi]# fdisk -l | grep sdb
fdisk can't see sdb.

[root@maverick iscsi]# cd /dev/sd
sda sda1 sda2 sda3 sdb

Interesting ... don't know what's going on.

Mike, can you help out here.

Thanks,
Rohit

Mike Christie

unread,
Nov 30, 2010, 7:12:44 PM11/30/10
to open-...@googlegroups.com, Maverick

It seems we might have a partially torn down session.

Does this always occur or does it only occur if you run the exact
commands you listed above?

Does the session ever get logged into properly (does the session state
very show logged in)?

Does this just happen with one session?

If you can replicate it easily can you dun iscsid by hand with debugging on:

iscsid -d 8 -f &

iscsiadm -m node -L automatic

iscsiadm -m node -U all


Send all the outpout from iscsid for both the login and logout command.

Reply all
Reply to author
Forward
0 new messages