New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gpg: selecting card failed: No such device with libusb 1.0.27 #1471
Comments
Can you please run with env LIBUSB_DEBUG=3 ? |
It seems the variable did not propagate. With libusb 1.0.27:
|
It is quite possible that gpg2 sanitizes the environment. Does it spawn another process for the USB operations? Or load libusb explicitly? I don't see libusb in the ldd output of gpg2 2.4.4 here (Arch). |
Or is it using scdaemon? Then sdcdaemon must be started with LIBUSB_DEBUG=3. |
scdaemon has also --verbose and --debug-level options. But I guess the libusb debug output is needed as well. |
The problem is that
|
Please see the scdaemon manual page. You can create a config file with options. Presumably the daemon is started by gpg-agent. Maybe gpg-agent will pass on LIBUSB_DEBUG. gpg-agent also has an option to specify the scdaemon, which you can make a wrapper setting LIBUSB_DEBUG. Maytbe @LudovicRousseau has an idea on debugging this? |
Please help to try libusb xusb example first to see if there are behaviors difference between 1.0.26 release and 1.0.27 release. Please post the output of the following command for both releases.
You can download the release tarball here and build libusb using the following command.
libusb source code release tarball download: Reference: libusb Wiki troubleshooting guide. |
After upgrading from Ubuntu 22.04 to 24.04, I started to encounter the same problem. GPG no longer can recognize the yubikey.
There doesn't seem to be an easy way to downgrade libusb in Ubuntu using the normal package manager for testing purposes. Update:
output inlined
|
Upgrading from Ubuntu 22.04 to 24.04 will not upgrade just libusb. I guess your problem is not with libusb itself. See https://blog.apdu.fr/posts/2024/04/gnupg-and-pcsc-conflicts-episode-2/ |
This should be fairly easy to narrow down by installing libusb 1.0.27 on Ubuntu 22.04 (which has gnupg 2.2.27). |
The gnupg upstream issue: https://dev.gnupg.org/T6871 |
My problem was indeed caused by the GPG update as suggested by @LudovicRousseau. I was mislead by arriving in this issue from google search and coincidentally having the same situation with libusb versions as the issue reporter. Gratitude for providing the leads to the root cause even though the issue had nothing to do with libusb. The next person arriving here from google will now also have the link to the solution. |
In this case, I will close this issue. |
In the original post it looked very much like upgrading to libusb 1.027 was the problem, since downgrading to 1.0.25 made it work again, but there could be external factors and coincidences at play. If we don't hear back from @Mno-hime there is not much we can do about it. |
I updated Fedora 39's libusb1 package to 1.0.27-1, and suddenly, my YubiKey (Yubico YubiKey CCID 01 00, version 3.4) can't be detected by GPG 2.4.4:
The kernel can see the key fine:
Downgrading to libusb 1.0.26-3 makes GPG to detect the key again.
The text was updated successfully, but these errors were encountered: