• Bug#1067167: open-iscsi: iscsiadm --target iqn.foo --login doesn't

    From Jakob Bohm@21:1/5 to All on Tue Mar 19 17:30:01 2024
    Package: open-iscsi
    Version: 2.1.8-1
    Severity: normal


    When trying to connect to an additional iSCSI target/server with the widely reported command
    iscsiadm -m node --target iqn.foo --login
    iscsiadm on at least some networks will fail with incorrect error messages:
    Logging in to [iface: ifBar_0, target: iqn.foo, portal: 10.x.x.x,3260]
    iscsiadm: Could not login to [iface: ifBar_0, target: iqn.foo,
    portal: 10.x.x.x,3260].
    iscsiadm: initiator reported error (19 - encountered non-retryable
    iSCSI login failure)
    iscsiadm: Could not log into all portals

    However running a simultaneous tcpdump and analyzing it with WireShark
    reveals
    that iscsiadm does a succesful login, then generates a TCP RST ending the attempt for no apparent reason.

    Because whatever failed was something local on the client, the error message must say so and be much more actionable instead of sending the sysadmin on
    a wild goose chase through the authentication settings and target configuration.

    P.S.
    This was run against another bookworm machine running targetcli-fb, no
    exotic
    hardware needed. All firewalls that I could find on the path are off.

    P.P.S.
    As stated in the first line of the report, this happens for an additional
    iSCSI connection while the client already has iSCSI connections to other
    disc boxes (in this case on other network interfaces).





    -- System Information:
    Debian Release: 12.5
    APT prefers stable
    APT policy: (990, 'stable'), (500, 'stable-updates'), (500, 'stable-security'), (100, 'bookworm-fasttrack')
    Architecture: amd64 (x86_64)

    Kernel: Linux 6.5.0-0.deb12.4-amd64 (SMP w/4 CPU threads; PREEMPT)
    Locale: LANG=en_DK.UTF-8, LC_CTYPE=en_DK.UTF-8 (charmap=UTF-8), LANGUAGE
    not set
    Shell: /bin/sh linked to /usr/bin/dash
    Init: sysvinit (via /sbin/init)

    Versions of packages open-iscsi depends on:
    ii debconf [debconf-2.0] 1.5.82
    ii init-system-helpers 1.65.2
    ii libc6 2.36-9+deb12u4
    ii libisns0 0.101-0.2+b1
    ii libkmod2 30+20221128-1
    ii libmount1 2.38.1-5+b1
    ii libopeniscsiusr 2.1.8-1
    ii libssl3 3.0.11-1~deb12u2
    ii libsystemd0 252.22-1~deb12u1
    ii udev 254.5-1~bpo12+3

    Versions of packages open-iscsi recommends:
    ii busybox-static [busybox] 1:1.35.0-4+b3
    pn finalrd <none>

    open-iscsi suggests no packages.

    -- Configuration Files:
    /etc/default/open-iscsi changed:
    LVMGROUPS=""
    HANDLE_NETDEV=1

    /etc/init.d/open-iscsi changed:
    PATH=/sbin:/bin
    DAEMON=/sbin/iscsid
    ADM=/sbin/iscsiadm
    PIDFILE=/run/iscsid.pid
    NAMEFILE=/etc/iscsi/initiatorname.iscsi
    CONFIGFILE=/etc/iscsi/iscsid.conf
    OMITDIR=/run/sendsigs.omit.d
    [ -x "$DAEMON" ] || exit 0
    . /lib/lsb/init-functions
    if [ -f /etc/default/open-iscsi ]; then
    . /etc/default/open-iscsi
    fi
    pause() {
    # echo
    # echo "$0 $*: Press enter to continue"
    # read dummy
    # unset dummy
    echo
    echo -n "$0 $*: Sleeping 5 seconds..."
    sleep 5
    echo "Slept"
    }
    pause "$@"
    if [ ! -d /sys/class/ ]; then
    log_failure_msg "iSCSI requires a mounted sysfs, not started."
    pause nosysfs
    exit 0
    fi
    RETVAL=0
    start() {
    if ! [ -s $PIDFILE ] || ! kill -0 `sed -n 1p $PIDFILE` >/dev/null ; then
    log_failure_msg "iSCSI initiator daemon not started: not logging in to
    default targets"
    exit 1
    fi
    starttargets
    # activate LVM, mount filesystems, etc.
    /lib/open-iscsi/activate-storage.sh
    }
    starttargets() {
    pause starttargets
    log_daemon_msg "Setting up iSCSI targets"
    echo
    $ADM -m node --loginall=automatic
    pause startcomplete
    log_end_msg 0
    }
    stoptargets() {
    log_daemon_msg "Disconnecting iSCSI targets"
    sync
    # only logout if daemon is running, iscsiadm hangs otherwise
    if [ -s $PIDFILE ] && kill -0 `sed -n 1p $PIDFILE` >/dev/null ;
    then
    /lib/open-iscsi/logout-all.sh
    fi
    log_end_msg 0
    }
    stop() {
    # Call umountiscsi.sh to unmount iSCSI devices first (always do
    # that, regardless of whether root is on iSCSI, umountiscsi.sh
    # will exclude it - and even if that shouldn't work, the mount
    # point will be busy)
    log_daemon_msg "Umounting iSCSI filesystems"
    /lib/open-iscsi/umountiscsi.sh
    umount_exit_status=$?
    log_end_msg $umount_exit_status
    if [ $umount_exit_status -ne 0 ]; then
    log_failure_msg "Couldn't unmount all iSCSI devices. not logging out
    from any target."
    exit 1
    fi
    stoptargets
    }
    restart() {
    stop
    start
    }
    restarttargets() {
    stoptargets
    starttargets
    }
    status() {
    echo Current active iSCSI sessions:
    $ADM -m session
    }
    case "$1" in
    start|starttargets|stop|stoptargets|restart|restarttargets|status)
    $1
    ;;
    force-reload)
    restart
    ;;
    *)
    echo "Usage: $0 {start|stop|restart|force-reload|status}"
    exit 1
    ;;
    esac
    exit $RETVAL

    /etc/iscsi/iscsid.conf [Errno 13] Permission denied:
    '/etc/iscsi/iscsid.conf'

    -- debconf information excluded

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)