Skip to content
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

Closed
Mno-hime opened this issue Mar 13, 2024 · 15 comments
Closed

gpg: selecting card failed: No such device with libusb 1.0.27 #1471

Mno-hime opened this issue Mar 13, 2024 · 15 comments

Comments

@Mno-hime
Copy link

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:

$ gpg2 --card-status
gpg: selecting card failed: No such device
gpg: OpenPGP card not available: No such device

The kernel can see the key fine:

bře 13 11:58:07 thinkpad kernel: usb 1-2: new full-speed USB device number 28 using xhci_hcd
bře 13 11:58:07 thinkpad kernel: usb 1-2: New USB device found, idVendor=1050, idProduct=0404, bcdDevice= 5.43
bře 13 11:58:07 thinkpad kernel: usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
bře 13 11:58:07 thinkpad kernel: usb 1-2: Product: YubiKey CCID
bře 13 11:58:07 thinkpad kernel: usb 1-2: Manufacturer: Yubico

Downgrading to libusb 1.0.26-3 makes GPG to detect the key again.

@tormodvolden
Copy link
Contributor

Can you please run with env LIBUSB_DEBUG=3 ?

@Mno-hime
Copy link
Author

It seems the variable did not propagate.

With libusb 1.0.27:

 export LIBUSB_DEBUG=3 
 gpg2 --card-status
gpg: selecting card failed: No such device
gpg: OpenPGP card not available: No such device

@tormodvolden
Copy link
Contributor

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).

@tormodvolden
Copy link
Contributor

Or is it using scdaemon? Then sdcdaemon must be started with LIBUSB_DEBUG=3.

@tormodvolden
Copy link
Contributor

scdaemon has also --verbose and --debug-level options. But I guess the libusb debug output is needed as well.

@Mno-hime
Copy link
Author

$ LIBUSB_DEBUG=3 /usr/libexec/scdaemon --multi-server --debug-level guru -vvvvv
scdaemon[207119]: enabled debug flags: mpi crypto memory cache memstat hashing ipc card cardio reader app
scdaemon[207119]: listening on socket '/run/user/1000/gnupg/S.scdaemon'
scdaemon[207119]: handler for fd -1 started
scdaemon[207119]: DBG: chan_6 -> OK GNU Privacy Guard's Smartcard server ready
OK GNU Privacy Guard's Smartcard server ready
$ LIBUSB_DEBUG=3 gpg2 --card-status
gpg: selecting card failed: No such device
gpg: OpenPGP card not available: No such device

The problem is that gpg2 --card-status keeps starting its own scdaemon process:

207119 /usr/libexec/scdaemon --multi-server --debug-level guru -vvvvv
207137 scdaemon --multi-server

@tormodvolden
Copy link
Contributor

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?

@mcuee mcuee added the linux label Mar 13, 2024
@mcuee
Copy link
Member

mcuee commented Mar 13, 2024

@Mno-hime

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.

xusb -d 1050:0404

You can download the release tarball here and build libusb using the following command.

./configure --enable-tests-build --enable-examples-build

libusb source code release tarball download:
https://github.com/libusb/libusb/releases/tag/v1.0.27
https://github.com/libusb/libusb/releases/tag/v1.0.26

Reference: libusb Wiki troubleshooting guide.
https://github.com/libusb/libusb/wiki/Troubleshooting

@jussih
Copy link

jussih commented May 9, 2024

After upgrading from Ubuntu 22.04 to 24.04, I started to encounter the same problem. GPG no longer can recognize the yubikey.

  • In Ubuntu 22.04 there is libusb 1.0.25-1ubuntu1
  • In Ubuntu 24.04 there is libusb 1.0.27-1

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
[timestamp] [threadID] facility level [function call] <message>
--------------------------------------------------------------------------------
[ 0.000104] [00009c84] libusb: debug [libusb_init_context] created default context
[ 0.000129] [00009c84] libusb: debug [libusb_init_context] libusb v1.0.27.11882
[ 0.000168] [00009c84] libusb: debug [usbi_add_event_source] add fd 3 events 1
[ 0.000191] [00009c84] libusb: debug [usbi_io_init] using timer for timeouts
[ 0.000198] [00009c84] libusb: debug [usbi_add_event_source] add fd 4 events 1
[ 0.000218] [00009c84] libusb: debug [get_kernel_version] reported kernel version is 6.8.0-31-generic
[ 0.000288] [00009c84] libusb: debug [op_init] found usbfs at /dev/bus/usb
[ 0.000296] [00009c84] libusb: debug [op_init] max iso packet length is (likely) 98304 bytes
[ 0.000315] [00009c84] libusb: debug [op_init] sysfs is available
[ 0.001049] [00009c92] libusb: debug [linux_udev_event_thread_main] udev event thread entering
[ 0.019554] [00009c84] libusb: debug [linux_get_device_address] getting address for device: usb1 detached: 0
[ 0.019585] [00009c84] libusb: debug [linux_get_device_address] scan usb1
[ 0.019690] [00009c84] libusb: debug [linux_get_device_address] bus=1 dev=1
[ 0.019698] [00009c84] libusb: debug [linux_enumerate_device] busnum 1 devaddr 1 session_id 257
[ 0.019706] [00009c84] libusb: debug [linux_enumerate_device] allocating new device for 1/1 (session 257)
[ 0.020121] [00009c84] libusb: debug [linux_get_device_address] getting address for device: 1-5 detached: 0
[ 0.020143] [00009c84] libusb: debug [linux_get_device_address] scan 1-5
[ 0.020229] [00009c84] libusb: debug [linux_get_device_address] bus=1 dev=2
[ 0.020251] [00009c84] libusb: debug [linux_enumerate_device] busnum 1 devaddr 2 session_id 258
[ 0.020258] [00009c84] libusb: debug [linux_enumerate_device] allocating new device for 1/2 (session 258)
[ 0.020373] [00009c84] libusb: debug [linux_get_parent_info] dev 0x5e9d26866e40 (1-5) has parent 0x5e9d268963b0 (usb1) port 5
[ 0.020676] [00009c84] libusb: debug [linux_get_device_address] getting address for device: 1-7 detached: 0
[ 0.020687] [00009c84] libusb: debug [linux_get_device_address] scan 1-7
[ 0.020799] [00009c84] libusb: debug [linux_get_device_address] bus=1 dev=3
[ 0.020816] [00009c84] libusb: debug [linux_enumerate_device] busnum 1 devaddr 3 session_id 259
[ 0.020823] [00009c84] libusb: debug [linux_enumerate_device] allocating new device for 1/3 (session 259)
[ 0.020909] [00009c84] libusb: debug [linux_get_parent_info] dev 0x5e9d26896580 (1-7) has parent 0x5e9d268963b0 (usb1) port 7
[ 0.021175] [00009c84] libusb: debug [linux_get_device_address] getting address for device: usb2 detached: 0
[ 0.021186] [00009c84] libusb: debug [linux_get_device_address] scan usb2
[ 0.021267] [00009c84] libusb: debug [linux_get_device_address] bus=2 dev=1
[ 0.021274] [00009c84] libusb: debug [linux_enumerate_device] busnum 2 devaddr 1 session_id 513
[ 0.021281] [00009c84] libusb: debug [linux_enumerate_device] allocating new device for 2/1 (session 513)
[ 0.021651] [00009c84] libusb: debug [linux_get_device_address] getting address for device: usb3 detached: 0
[ 0.021661] [00009c84] libusb: debug [linux_get_device_address] scan usb3
[ 0.021769] [00009c84] libusb: debug [linux_get_device_address] bus=3 dev=1
[ 0.021785] [00009c84] libusb: debug [linux_enumerate_device] busnum 3 devaddr 1 session_id 769
[ 0.021792] [00009c84] libusb: debug [linux_enumerate_device] allocating new device for 3/1 (session 769)
[ 0.022188] [00009c84] libusb: debug [linux_get_device_address] getting address for device: 3-2 detached: 0
[ 0.022199] [00009c84] libusb: debug [linux_get_device_address] scan 3-2
[ 0.022288] [00009c84] libusb: debug [linux_get_device_address] bus=3 dev=3
[ 0.022295] [00009c84] libusb: debug [linux_enumerate_device] busnum 3 devaddr 3 session_id 771
[ 0.022303] [00009c84] libusb: debug [linux_enumerate_device] allocating new device for 3/3 (session 771)
[ 0.022390] [00009c84] libusb: debug [linux_get_parent_info] dev 0x5e9d26867f00 (3-2) has parent 0x5e9d26867da0 (usb3) port 2
[ 0.022773] [00009c84] libusb: debug [linux_get_device_address] getting address for device: usb4 detached: 0
[ 0.022795] [00009c84] libusb: debug [linux_get_device_address] scan usb4
[ 0.022888] [00009c84] libusb: debug [linux_get_device_address] bus=4 dev=1
[ 0.022896] [00009c84] libusb: debug [linux_enumerate_device] busnum 4 devaddr 1 session_id 1025
[ 0.022903] [00009c84] libusb: debug [linux_enumerate_device] allocating new device for 4/1 (session 1025)
[ 0.023249] [00009c84] libusb: debug [libusb_get_device_list]  
[ 0.023273] [00009c84] libusb: debug [libusb_get_device_descriptor]  
[ 0.023280] [00009c84] libusb: debug [libusb_get_device_descriptor]  
[ 0.023288] [00009c84] libusb: debug [libusb_open] open 3.3
[ 0.023347] [00009c84] libusb: debug [usbi_add_event_source] add fd 7 events 4
[ 0.023360] [00009c84] libusb: debug [libusb_get_device_descriptor]  
[ 0.023380] [00009c84] libusb: debug [libusb_submit_transfer] transfer 0x5e9d2687ba10
[ 0.023388] [00009c84] libusb: debug [add_to_flying_list] arm timer for timeout in 1000ms (first in line)
[ 0.023452] [00009c84] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[ 0.023461] [00009c84] libusb: debug [handle_events] event sources modified, reallocating event data
[ 0.023476] [00009c84] libusb: debug [usbi_wait_for_events] poll() 3 fds with timeout in 60000ms
[ 0.023770] [00009c84] libusb: debug [usbi_wait_for_events] poll() returned 1
[ 0.023815] [00009c84] libusb: debug [reap_for_handle] urb type=2 status=-32 transferred=0
[ 0.023826] [00009c84] libusb: debug [handle_control_completion] handling completion status -32
[ 0.023833] [00009c84] libusb: debug [handle_control_completion] unsupported control request
[ 0.023842] [00009c84] libusb: debug [arm_timer_for_next_timeout] no timeouts, disarming timer
[ 0.023854] [00009c84] libusb: debug [usbi_handle_transfer_completion] transfer 0x5e9d2687ba10 has callback 0x723cec14bad0
[ 0.023865] [00009c84] libusb: debug [sync_transfer_cb] actual_length=0
[ 0.023887] [00009c84] libusb: debug [libusb_free_transfer] transfer 0x5e9d2687ba10
[ 0.023899] [00009c84] libusb: debug [libusb_get_config_descriptor] index 0
[ 0.023937] [00009c84] libusb: debug [libusb_kernel_driver_active] interface 0
[ 0.023952] [00009c84] libusb: debug [libusb_claim_interface] interface 0
[ 0.119506] [00009c84] libusb: debug [libusb_kernel_driver_active] interface 1
[ 0.119572] [00009c84] libusb: debug [libusb_claim_interface] interface 1
[ 0.133686] [00009c84] libusb: debug [libusb_kernel_driver_active] interface 2
[ 0.133782] [00009c84] libusb: debug [libusb_claim_interface] interface 2
   Failed (error 0) Success
[ 0.133829] [00009c84] libusb: debug [libusb_submit_transfer] transfer 0x5e9d268894b0
[ 0.133841] [00009c84] libusb: debug [add_to_flying_list] arm timer for timeout in 1000ms (first in line)
[ 0.133915] [00009c84] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[ 0.133931] [00009c84] libusb: debug [usbi_wait_for_events] poll() 3 fds with timeout in 60000ms
[ 0.134086] [00009c84] libusb: debug [usbi_wait_for_events] poll() returned 1
[ 0.134120] [00009c84] libusb: debug [reap_for_handle] urb type=2 status=0 transferred=4
[ 0.134137] [00009c84] libusb: debug [handle_control_completion] handling completion status 0
[ 0.134150] [00009c84] libusb: debug [arm_timer_for_next_timeout] no timeouts, disarming timer
[ 0.134171] [00009c84] libusb: debug [usbi_handle_transfer_completion] transfer 0x5e9d268894b0 has callback 0x723cec14bad0
[ 0.134183] [00009c84] libusb: debug [sync_transfer_cb] actual_length=4
[ 0.134202] [00009c84] libusb: debug [libusb_free_transfer] transfer 0x5e9d268894b0
[ 0.134219] [00009c84] libusb: debug [libusb_submit_transfer] transfer 0x5e9d26890340
[ 0.134232] [00009c84] libusb: debug [add_to_flying_list] arm timer for timeout in 1000ms (first in line)
[ 0.134281] [00009c84] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[ 0.134294] [00009c84] libusb: debug [usbi_wait_for_events] poll() 3 fds with timeout in 60000ms
[ 0.134447] [00009c84] libusb: debug [usbi_wait_for_events] poll() returned 1
[ 0.134479] [00009c84] libusb: debug [reap_for_handle] urb type=2 status=0 transferred=14
[ 0.134491] [00009c84] libusb: debug [handle_control_completion] handling completion status 0
[ 0.134503] [00009c84] libusb: debug [arm_timer_for_next_timeout] no timeouts, disarming timer
[ 0.134520] [00009c84] libusb: debug [usbi_handle_transfer_completion] transfer 0x5e9d26890340 has callback 0x723cec14bad0
[ 0.134530] [00009c84] libusb: debug [sync_transfer_cb] actual_length=14
[ 0.134546] [00009c84] libusb: debug [libusb_free_transfer] transfer 0x5e9d26890340
[ 0.134565] [00009c84] libusb: debug [libusb_submit_transfer] transfer 0x5e9d26895750
[ 0.134576] [00009c84] libusb: debug [add_to_flying_list] arm timer for timeout in 1000ms (first in line)
[ 0.134623] [00009c84] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[ 0.134637] [00009c84] libusb: debug [usbi_wait_for_events] poll() 3 fds with timeout in 60000ms
[ 0.134813] [00009c84] libusb: debug [usbi_wait_for_events] poll() returned 1
[ 0.134852] [00009c84] libusb: debug [reap_for_handle] urb type=2 status=0 transferred=4
[ 0.134868] [00009c84] libusb: debug [handle_control_completion] handling completion status 0
[ 0.134880] [00009c84] libusb: debug [arm_timer_for_next_timeout] no timeouts, disarming timer
[ 0.134897] [00009c84] libusb: debug [usbi_handle_transfer_completion] transfer 0x5e9d26895750 has callback 0x723cec14bad0
[ 0.134908] [00009c84] libusb: debug [sync_transfer_cb] actual_length=4
[ 0.134926] [00009c84] libusb: debug [libusb_free_transfer] transfer 0x5e9d26895750
[ 0.134940] [00009c84] libusb: debug [libusb_submit_transfer] transfer 0x5e9d26895400
[ 0.134950] [00009c84] libusb: debug [add_to_flying_list] arm timer for timeout in 1000ms (first in line)
[ 0.134997] [00009c84] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[ 0.135008] [00009c84] libusb: debug [usbi_wait_for_events] poll() 3 fds with timeout in 60000ms
[ 0.135158] [00009c84] libusb: debug [usbi_wait_for_events] poll() returned 1
[ 0.135184] [00009c84] libusb: debug [reap_for_handle] urb type=2 status=0 transferred=44
[ 0.135195] [00009c84] libusb: debug [handle_control_completion] handling completion status 0
[ 0.135208] [00009c84] libusb: debug [arm_timer_for_next_timeout] no timeouts, disarming timer
[ 0.135227] [00009c84] libusb: debug [usbi_handle_transfer_completion] transfer 0x5e9d26895400 has callback 0x723cec14bad0
[ 0.135238] [00009c84] libusb: debug [sync_transfer_cb] actual_length=44
[ 0.135257] [00009c84] libusb: debug [libusb_free_transfer] transfer 0x5e9d26895400
[ 0.135278] [00009c84] libusb: debug [libusb_submit_transfer] transfer 0x5e9d26892960
[ 0.135291] [00009c84] libusb: debug [add_to_flying_list] arm timer for timeout in 1000ms (first in line)
[ 0.135343] [00009c84] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[ 0.135357] [00009c84] libusb: debug [usbi_wait_for_events] poll() 3 fds with timeout in 60000ms
[ 0.135533] [00009c84] libusb: debug [usbi_wait_for_events] poll() returned 1
[ 0.135562] [00009c84] libusb: debug [reap_for_handle] urb type=2 status=0 transferred=18
[ 0.135576] [00009c84] libusb: debug [handle_control_completion] handling completion status 0
[ 0.135589] [00009c84] libusb: debug [arm_timer_for_next_timeout] no timeouts, disarming timer
[ 0.135607] [00009c84] libusb: debug [usbi_handle_transfer_completion] transfer 0x5e9d26892960 has callback 0x723cec14bad0
[ 0.135621] [00009c84] libusb: debug [sync_transfer_cb] actual_length=18
[ 0.135639] [00009c84] libusb: debug [libusb_free_transfer] transfer 0x5e9d26892960
[ 0.135661] [00009c84] libusb: debug [libusb_submit_transfer] transfer 0x5e9d2687b000
[ 0.135674] [00009c84] libusb: debug [add_to_flying_list] arm timer for timeout in 1000ms (first in line)
[ 0.135722] [00009c84] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[ 0.135756] [00009c84] libusb: debug [usbi_wait_for_events] poll() 3 fds with timeout in 60000ms
[ 0.135845] [00009c84] libusb: debug [usbi_wait_for_events] poll() returned 1
[ 0.135871] [00009c84] libusb: debug [reap_for_handle] urb type=2 status=0 transferred=16
[ 0.135880] [00009c84] libusb: debug [handle_control_completion] handling completion status 0
[ 0.135887] [00009c84] libusb: debug [arm_timer_for_next_timeout] no timeouts, disarming timer
[ 0.135897] [00009c84] libusb: debug [usbi_handle_transfer_completion] transfer 0x5e9d2687b000 has callback 0x723cec14bad0
[ 0.135905] [00009c84] libusb: debug [sync_transfer_cb] actual_length=16
[ 0.135916] [00009c84] libusb: debug [libusb_free_transfer] transfer 0x5e9d2687b000
[ 0.135926] [00009c84] libusb: debug [libusb_submit_transfer] transfer 0x5e9d2687a7e0
[ 0.135933] [00009c84] libusb: debug [add_to_flying_list] arm timer for timeout in 1000ms (first in line)
[ 0.135967] [00009c84] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[ 0.135974] [00009c84] libusb: debug [usbi_wait_for_events] poll() 3 fds with timeout in 60000ms
[ 0.136231] [00009c84] libusb: debug [usbi_wait_for_events] poll() returned 1
[ 0.136246] [00009c84] libusb: debug [reap_for_handle] urb type=2 status=0 transferred=80
[ 0.136253] [00009c84] libusb: debug [handle_control_completion] handling completion status 0
[ 0.136260] [00009c84] libusb: debug [arm_timer_for_next_timeout] no timeouts, disarming timer
[ 0.136271] [00009c84] libusb: debug [usbi_handle_transfer_completion] transfer 0x5e9d2687a7e0 has callback 0x723cec14bad0
[ 0.136278] [00009c84] libusb: debug [sync_transfer_cb] actual_length=80
[ 0.136288] [00009c84] libusb: debug [libusb_free_transfer] transfer 0x5e9d2687a7e0
[ 0.136338] [00009c84] libusb: debug [libusb_submit_transfer] transfer 0x5e9d2687a2c0
[ 0.136345] [00009c84] libusb: debug [add_to_flying_list] arm timer for timeout in 1000ms (first in line)
[ 0.136375] [00009c84] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[ 0.136382] [00009c84] libusb: debug [usbi_wait_for_events] poll() 3 fds with timeout in 60000ms
[ 0.136511] [00009c84] libusb: debug [usbi_wait_for_events] poll() returned 1
[ 0.136524] [00009c84] libusb: debug [reap_for_handle] urb type=2 status=0 transferred=10
[ 0.136531] [00009c84] libusb: debug [handle_control_completion] handling completion status 0
[ 0.136538] [00009c84] libusb: debug [arm_timer_for_next_timeout] no timeouts, disarming timer
[ 0.136548] [00009c84] libusb: debug [usbi_handle_transfer_completion] transfer 0x5e9d2687a2c0 has callback 0x723cec14bad0
[ 0.136555] [00009c84] libusb: debug [sync_transfer_cb] actual_length=10
[ 0.136565] [00009c84] libusb: debug [libusb_free_transfer] transfer 0x5e9d2687a2c0
[ 0.136574] [00009c84] libusb: debug [libusb_submit_transfer] transfer 0x5e9d26885740
[ 0.136580] [00009c84] libusb: debug [add_to_flying_list] arm timer for timeout in 1000ms (first in line)
[ 0.136609] [00009c84] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[ 0.136616] [00009c84] libusb: debug [usbi_wait_for_events] poll() 3 fds with timeout in 60000ms
[ 0.136936] [00009c84] libusb: debug [usbi_wait_for_events] poll() returned 1
[ 0.137003] [00009c84] libusb: debug [reap_for_handle] urb type=2 status=0 transferred=82
[ 0.137015] [00009c84] libusb: debug [handle_control_completion] handling completion status 0
[ 0.137024] [00009c84] libusb: debug [arm_timer_for_next_timeout] no timeouts, disarming timer
[ 0.137037] [00009c84] libusb: debug [usbi_handle_transfer_completion] transfer 0x5e9d26885740 has callback 0x723cec14bad0
[ 0.137045] [00009c84] libusb: debug [sync_transfer_cb] actual_length=82
[ 0.137059] [00009c84] libusb: debug [libusb_free_transfer] transfer 0x5e9d26885740
[ 0.137113] [00009c84] libusb: debug [libusb_get_interface_association_descriptors] IADs for config index 0
[ 0.137126] [00009c84] libusb: debug [libusb_release_interface] interface 0
[ 0.192917] [00009c84] libusb: debug [libusb_release_interface] interface 1
[ 0.194672] [00009c84] libusb: debug [libusb_release_interface] interface 2
[ 0.194782] [00009c84] libusb: debug [libusb_close]  
[ 0.194822] [00009c84] libusb: debug [usbi_remove_event_source] remove fd 7
[ 0.194858] [00009c84] libusb: debug [libusb_exit] destroying default context
[ 0.194873] [00009c84] libusb: debug [libusb_unref_device] destroy device 4.1
[ 0.194887] [00009c84] libusb: debug [libusb_unref_device] destroy device 3.3
[ 0.194896] [00009c84] libusb: debug [libusb_unref_device] destroy device 3.1
[ 0.194902] [00009c84] libusb: debug [libusb_unref_device] destroy device 2.1
[ 0.194910] [00009c84] libusb: debug [libusb_unref_device] destroy device 1.3
[ 0.194917] [00009c84] libusb: debug [libusb_unref_device] destroy device 1.2
[ 0.194924] [00009c84] libusb: debug [libusb_unref_device] destroy device 1.1
[ 0.194990] [00009c92] libusb: debug [linux_udev_event_thread_main] udev event thread exiting
[ 0.195227] [00009c84] libusb: debug [usbi_remove_event_source] remove fd 4
[ 0.195272] [00009c84] libusb: debug [usbi_remove_event_source] remove fd 3
Using libusb v1.0.27.11882

Opening device 1050:0407...

Reading device descriptor:
            length: 18
      device class: 0
               S/N: 0
           VID:PID: 1050:0407
         bcdDevice: 0512
   iMan:iProd:iSer: 1:2:0
          nb confs: 1

Reading BOS descriptor: no descriptor

Reading first configuration descriptor:
              total length: 150
         descriptor length: 9
             nb interfaces: 3
              interface[0]: id = 0
interface[0].altsetting[0]: num endpoints = 1
   Class.SubClass.Protocol: 03.01.01
       endpoint[0].address: 81
           max packet size: 0008
          polling interval: 0A
              interface[1]: id = 1
interface[1].altsetting[0]: num endpoints = 2
   Class.SubClass.Protocol: 03.00.00
       endpoint[0].address: 04
           max packet size: 0040
          polling interval: 02
       endpoint[1].address: 84
           max packet size: 0040
          polling interval: 02
              interface[2]: id = 2
interface[2].altsetting[0]: num endpoints = 3
   Class.SubClass.Protocol: 0B.00.00
       endpoint[0].address: 02
           max packet size: 0040
          polling interval: 00
       endpoint[1].address: 82
           max packet size: 0040
          polling interval: 00
       endpoint[2].address: 83
           max packet size: 0008
          polling interval: 20

Kernel driver attached for interface 0: yes

Claiming interface 0...

Kernel driver attached for interface 1: yes

Claiming interface 1...

Kernel driver attached for interface 2: none

Claiming interface 2...

Reading string descriptors:
   String (0x01): "Yubico"
   String (0x02): "YubiKey OTP+FIDO+CCID"

Reading OS string descriptor:

Reading Extended Compat ID OS Feature Descriptor (wIndex = 0x0004):

  00000000  50 00 00 00 00 01 04 00 03 00 00 00 00 00 00 00  P...............
  00000010  00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  00000020  00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00  ................
  00000030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  00000040  02 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................

Reading Extended Properties OS Feature Descriptor (wIndex = 0x0005):

  00000000  52 00 00 00 00 01 05 00 01 00 48 00 00 00 04 00  R.........H.....
  00000010  00 00 36 00 44 00 65 00 76 00 69 00 63 00 65 00  ..6.D.e.v.i.c.e.
  00000020  49 00 64 00 6c 00 65 00 49 00 67 00 6e 00 6f 00  I.d.l.e.I.g.n.o.
  00000030  72 00 65 00 57 00 61 00 6b 00 65 00 45 00 6e 00  r.e.W.a.k.e.E.n.
  00000040  61 00 62 00 6c 00 65 00 00 00 04 00 00 00 01 00  a.b.l.e.........
  00000050  00 00                                            ..

Reading interface association descriptors (IADs) for first configuration:
    nb IADs: 0

Releasing interface 0...
Releasing interface 1...
Releasing interface 2...
Closing device...

@LudovicRousseau
Copy link
Member

Upgrading from Ubuntu 22.04 to 24.04 will not upgrade just libusb.
GnuPG also is upgraded from version 2.2.27 to 2.4.4.

I guess your problem is not with libusb itself.

See https://blog.apdu.fr/posts/2024/04/gnupg-and-pcsc-conflicts-episode-2/

@tormodvolden
Copy link
Contributor

This should be fairly easy to narrow down by installing libusb 1.0.27 on Ubuntu 22.04 (which has gnupg 2.2.27).

@tormodvolden
Copy link
Contributor

The gnupg upstream issue: https://dev.gnupg.org/T6871

@jussih
Copy link

jussih commented May 9, 2024

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.

@mcuee
Copy link
Member

mcuee commented May 9, 2024

In this case, I will close this issue.

@mcuee mcuee closed this as completed May 9, 2024
@mcuee mcuee added the invalid label May 9, 2024
@tormodvolden
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants