Inconsistent arg count for snap-device-helper on Ubuntu 23.10

Also reported this as a bug in Bug #2063144 “inconsistent handling of snap-device-helper argume...” : Bugs : snapd , but posting here in case someone has an idea of how to recover my system.

I have a somewhat complicated issue and I’m not sure where the blame really lies, so I’ll give as much information as I can. I have an Ubuntu 23.10 system with Firefox installed via snap (currently at latest/stable version 125.0.2-1). I am no longer able to use a hardware FIDO2 key with Firefox - for example if I go to webauthn.io and click the register button, I get a Firefox pop-up for “Touch your security key to continue” but touching the key is not recognized. This continues to work fine on Google Chrome on the same system with the same hardware key.

I debugged this to Firefox’s apparently not getting access to /dev/hidraw1, which in turn seems to be due to /etc/udev/rules.d/70-snap.firefox.rules matching the USB device and invoking the rule

    TAG=="snap_firefox_firefox", SUBSYSTEM!="module", SUBSYSTEM!="subsystem", RUN+="/usr/lib/snapd/snap-device-helper snap_firefox_firefox"

However, that fails with:

    $ /usr/lib/snapd/snap-device-helper snap_firefox_firefox
    incorrect number of arguments

(strace shows udevd is getting the same error).

I tracked that down to cmd/snap-device-helper: do not read sysfs directly · snapcore/snapd@904b283 · GitHub , which changed the number of command line parameters that snap-device-helper expects. Notably, that commit is in snapd release 2.62 but not 2.61.3 and my system has:

    $ dpkg -l snapd
    Desired=Unknown/Install/Remove/Purge/Hold
    | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
    |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
    ||/ Name Version Architecture Description
    +++-==============-============-============-============================================
    ii snapd 2.61.3+23.10 amd64 Daemon and tooling that enable snap packages
    $ snap list snapd
    Name Version Rev Tracking Publisher Notes
    snapd 2.62 21465 latest/stable canonical✓ snapd

So it seems somehow I’ve ended up with /usr/lib/snapd/snap-device-helper coming from the old code but the udev rules in 70-snap.firefox.rules being generated expecting the new invocation?

I’m not sure how to get out of this situataion.

1 Like