spesmilo / spesmilo/electrum

USBErrorNoDevice: LIBUSB_ERROR_NO_DEVICE [-4]

Open
#7,293 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
8.6k
Forks
3.5k
Avg merge
2d 8h
Merged PRs (30d)
61

Description

Crash Report

This crash report was reported through the automatic crash reporting system 🤖

Traceback

  File "/tmp/.mount_electrlKpMwZ/usr/lib/python3.7/site-packages/electrum/plugin.py", line 362, in wrapper
    return run_in_hwd_thread(partial(func, *args, **kwargs))
  File "/tmp/.mount_electrlKpMwZ/usr/lib/python3.7/site-packages/electrum/plugin.py", line 355, in run_in_hwd_thread
    return fut.result()
  File "/tmp/.mount_electrlKpMwZ/usr/lib/python3.7/concurrent/futures/_base.py", line 435, in result
    return self.__get_result()
  File "/tmp/.mount_electrlKpMwZ/usr/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
  File "/tmp/.mount_electrlKpMwZ/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/tmp/.mount_electrlKpMwZ/usr/lib/python3.7/site-packages/electrum/plugins/keepkey/clientbase.py", line 162, in cancel
    self.transport.write(self.proto.Cancel())
  File "/tmp/.mount_electrlKpMwZ/usr/lib/python3.7/site-packages/keepkeylib/transport.py", line 69, in write
    self._write(b"##" + header + ser, msg)
  File "/tmp/.mount_electrlKpMwZ/usr/lib/python3.7/site-packages/keepkeylib/transport_webusb.py", line 115, in _write
    self.handle.interruptWrite(self.endpoint, [63, ] + list(msg[:63]) + [0] * (63 - len(msg[:63])))
  File "/tmp/.mount_electrlKpMwZ/usr/lib/python3.7/site-packages/usb1/__init__.py", line 1472, in interruptWrite
    return self._interruptTransfer(endpoint, data, sizeof(data), timeout)
  File "/tmp/.mount_electrlKpMwZ/usr/lib/python3.7/site-packages/usb1/__init__.py", line 1444, in _interruptTransfer
    timeout,
  File "/tmp/.mount_electrlKpMwZ/usr/lib/python3.7/site-packages/usb1/__init__.py", line 127, in mayRaiseUSBError
    __raiseUSBError(value)
  File "/tmp/.mount_electrlKpMwZ/usr/lib/python3.7/site-packages/usb1/__init__.py", line 119, in raiseUSBError
    raise __STATUS_TO_EXCEPTION_DICT.get(value, __USBError)(value)

USBErrorNoDevice: LIBUSB_ERROR_NO_DEVICE [-4]

Reporter

This issue was reported by 2 user(s):

Electrum Version Python Version Operating System Wallet Type Locale Stack
4.1.2 3.7.10 (default, Jun 28 2018, 19:01:02) [GCC 5.4.0 20160609] Linux-5.8.0-43-generic-x86_64-with-debian-bullseye-sid standard en_US
4.6.2 3.12.11 (main, Jun 28 2018, 19:01:02) [GCC 10.2.1 20210110] Linux-6.17.2-arch1-1-x86_64-with-glibc2.42 en_US

Additional Information

I was just setting up a Trezor device. It's running the latest firmware and I installed it from scratch. It is not using the "Bitcoin only" firmware so not sure if that has something to do with it. I will try putting that firmware on next and see if it makes a difference.


Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with electrum/plugins/keepkey/clientbase.py at cancel and follow the write path into keepkeylib/transport_webusb.py, then compare the two reported environments and reproduce the Trezor setup if possible. Done means the device-disconnection path has defined behavior without this unhandled USBErrorNoDevice crash, with regression coverage if the project has a suitable existing test entry point.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.