saml2aws icon indicating copy to clipboard operation
saml2aws copied to clipboard

Panic Using Ubuntu 20.04 LTS via Windows Subsystem for Linux (WSL2)

Open aj-stein-nist opened this issue 3 years ago • 4 comments

Let me know how I can debug further, thanks!

$ uname -a
Linux PG904375 5.10.16.3-microsoft-standard-WSL2 #1 SMP Fri Apr 2 22:23:49 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
$ file /usr/local/bin/saml2aws
/usr/local/bin/saml2aws: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=9oYIh29OgCQ5NI8AILel/jOxz9O7hMMyAAa5atfRk/AISgV1EyOFxiRP-KMmN5/ZCw0faEkhXST_OpKfJeI, stripped
$ saml2aws --version
panic: runtime error: slice bounds out of range [308:282]

goroutine 1 [running]:
github.com/godbus/dbus.getSessionBusPlatformAddress(0xc1887d, 0x18, 0x0, 0x0)
        github.com/godbus/[email protected]+incompatible/conn_other.go:30 +0x2a5
github.com/godbus/dbus.getSessionBusAddress(0x0, 0x0, 0x0, 0x0)
        github.com/godbus/[email protected]+incompatible/conn.go:96 +0xf8
github.com/godbus/dbus.SessionBusPrivate(0x0, 0xba2060, 0x115af50)
        github.com/godbus/[email protected]+incompatible/conn.go:101 +0x25
github.com/godbus/dbus.SessionBus(0x0, 0x0, 0x0)
        github.com/godbus/[email protected]+incompatible/conn.go:73 +0xb5
github.com/99designs/keyring.init.1()
        github.com/99designs/[email protected]/kwallet.go:24 +0x51

aj-stein-nist avatar Dec 14 '21 16:12 aj-stein-nist

I have seen the exact same issue while debugging this setup for a colleague running WSL -- any pointers appreciated!

JimNero009 avatar Dec 15 '21 08:12 JimNero009

Seems to be perennial issues with DBUS and how it behaves with systemd and a variety of other stuff in WSL-deployed Linux for a variety of reasons.

I will have to look into debugging this further, but I encountered other issues I will need to debug first with my ADFS and SAML configuration. Running it in Docker with WSL integration gets around this issues for now, but does not get around whatever I need to pass to get an actual SAML assertion using other AWS Python scripts, so I have to figure that out first after reporting another issue here.

aj-stein-nist avatar Dec 15 '21 15:12 aj-stein-nist

I experienced this exact issue. Thanks to advice from a colleague, the cause seemed to be that my /etc/machine-id was empty. Fix was to run sudo systemd-machine-id-setup.

But ISTM to that saml2aws should check if /etc/machine-id is empty and suggest above fix if it is empty instead of panicking. See https://www.freedesktop.org/software/systemd/man/machine-id.html for details on /etc/machine-id.

jbarham avatar Feb 01 '22 06:02 jbarham

I experienced this exact issue. Thanks to advice from a colleague, the cause seemed to be that my /etc/machine-id was empty. Fix was to run sudo systemd-machine-id-setup.

But ISTM to that saml2aws should check if /etc/machine-id is empty and suggest above fix if it is empty instead of panicking. See https://www.freedesktop.org/software/systemd/man/machine-id.html for details on /etc/machine-id.

Interesting recommendation, but with WSL it appears my machine has had one for a long time. That said, it does look like it potentially edited the machine-id in January, after I reported this bug. I will try again and report back to see if this workaround applies to my situation!

aj-stein-nist avatar Feb 01 '22 14:02 aj-stein-nist