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

trezorctl: receiving error "Failed to enumerate WebUsbTransport" #1860

Closed
lihaibh opened this issue Oct 20, 2021 · 15 comments
Closed

trezorctl: receiving error "Failed to enumerate WebUsbTransport" #1860

lihaibh opened this issue Oct 20, 2021 · 15 comments
Labels
bug Something isn't working as expected

Comments

@lihaibh
Copy link

lihaibh commented Oct 20, 2021

When i try to run any command of trezorctl i receive the following error:

Failed to enumerate WebUsbTransport. USBErrorOther: LIBUSB_ERROR_OTHER [-99]

this is too generic error and i dont know how to fix that.
The trezorctl cli worked for me before nothing changed.
It shows this error whether or not i plug in a trezor device.

tried also this command: trezorctl usb-reset
and received this error:

Traceback (most recent call last):
  File "/root/crypto/bin/trezorctl", line 8, in <module>
    sys.exit(cli())
  File "/root/crypto/lib/python3.9/site-packages/click/core.py", line 1137, in __call__
    return self.main(*args, **kwargs)
  File "/root/crypto/lib/python3.9/site-packages/click/core.py", line 1062, in main
    rv = self.invoke(ctx)
  File "/root/crypto/lib/python3.9/site-packages/click/core.py", line 1668, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/root/crypto/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/root/crypto/lib/python3.9/site-packages/click/core.py", line 763, in invoke
    return __callback(*args, **kwargs)
  File "/root/crypto/lib/python3.9/site-packages/trezorlib/cli/trezorctl.py", line 291, in usb_reset
    WebUsbTransport.enumerate(usb_reset=True)
  File "/root/crypto/lib/python3.9/site-packages/trezorlib/transport/webusb.py", line 115, in enumerate
    cls.context.open()
  File "/root/crypto/lib/python3.9/site-packages/usb1/__init__.py", line 2139, in open
    mayRaiseUSBError(libusb1.libusb_init(byref(self.__context_p)))
  File "/root/crypto/lib/python3.9/site-packages/usb1/__init__.py", line 127, in mayRaiseUSBError
    __raiseUSBError(value)
  File "/root/crypto/lib/python3.9/site-packages/usb1/__init__.py", line 119, in raiseUSBError
    raise __STATUS_TO_EXCEPTION_DICT.get(value, __USBError)(value)
usb1.USBErrorOther: LIBUSB_ERROR_OTHER [-99]

trezorctl does works with trezor bridge though, it tries first to connect using the webusb that gives this error: Failed to enumerate WebUsbTransport. USBErrorOther: LIBUSB_ERROR_OTHER [-99] and than use the bridge that works.
Maybe i need to update drivers using zadig-2.6 but i dont know what i need to configure there.

Environment details:
OS: Windows 10 Pro
trezorctl version: 0.12.4
python version: 3.9.6
execution environment: ZSH through WSL terminal

@lihaibh lihaibh added the bug Something isn't working as expected label Oct 20, 2021
@prusnak
Copy link
Member

prusnak commented Oct 21, 2021

I guess this is expected? When the bridge is running, it communicates with the device and the device cannot be accessed directly, so trezorctl can communicate with it only via the bridge.

@matejcik
Copy link
Contributor

Could be a permissions problem too. Try running the console as admin and see if it helps.

If bridge works, you can instruct trezorctl to communicate through bridge, by running trezorctl -p bridge before the command you want

@lihaibh
Copy link
Author

lihaibh commented Oct 21, 2021

@matejcik yes i can configure trezor to work with the bridge but it has lags.
It takes around 10 seconds to receive any feedback from the bridge.

For some reason i see 3 drivers and 2 trezor usb interfaces for the same trezor device.
I updated usb driver using zadig-2.6 for both trezor interfaces but it still doesnt work.

@prusnak
Copy link
Member

prusnak commented Oct 21, 2021

@lihaibh you missed where matejcik asked you to run the command as admin

also make sure the bridge is not running if you want to communicate with the device directly

@matejcik
Copy link
Contributor

Also, do you experience the same lag when using Trezor Wallet or Suite?

Because if yes, that indicates that the bridge also has trouble communicating with the device, so either it's a bridge problem (if it disappears when bridge is shut down) or a symptom of a deeper problem on your system.

@lihaibh
Copy link
Author

lihaibh commented Oct 21, 2021

I will try to run as administrator, but it should not be the solution, it worked for me before without administration privileges.
Additionally, im using wsl terminal on windows when i run trezorctl should it be a problem?

Im pretty sure it something todo with the drivers. Maybe i will reinstall all the drivers and let windows download them again?
Is there a way to get more description on the error, log files something? because this error is too generic for me to understand the core issue.

@lihaibh
Copy link
Author

lihaibh commented Oct 21, 2021

how can i verify the authenticity of the bridge installation? i cant find the public key only the signature.
from here: https://wallet.trezor.io/#/bridge

@prusnak
Copy link
Member

prusnak commented Oct 21, 2021

i cant find the public key only the signature.

https://rusnak.io/public/pgp.txt

@alex-jerechinsky alex-jerechinsky added this to 📥 Inbox in Backlog 🗂 Oct 22, 2021
@alex-jerechinsky alex-jerechinsky removed this from 📥 Inbox in Firmware · Backlog 🗂 Oct 22, 2021
@lihaibh
Copy link
Author

lihaibh commented Oct 22, 2021

@matejcik @prusnak wsl is an isolated environment i can run ubuntu commands and it looks like im root in this isolated environment.
I didnt find a way i can run wsl as admin.
When i open trezor suite it feels also slow, maybe because it uses the bridge instead of the usb interface.
trezorctl -p bridge list still tries to communicate via the usb interface.

@prusnak
Copy link
Member

prusnak commented Oct 22, 2021

WSL does not support USB passthrough: microsoft/WSL#5158

@prusnak prusnak closed this as completed Oct 22, 2021
Backlog 🗂 automation moved this from 📥 Inbox to ❌ Closed Oct 22, 2021
@lihaibh
Copy link
Author

lihaibh commented Oct 22, 2021

since when? it worked for me before something changed recently

@lihaibh
Copy link
Author

lihaibh commented Oct 22, 2021

how can i run trezorctl then?
i try to run through git bash and i get segmentation fault..

@prusnak
Copy link
Member

prusnak commented Oct 22, 2021

Please create a new issue for segmentation fault you see

@matejcik
Copy link
Contributor

you should be able to run trezorctl via the normal Windows command prompt

@lihaibh
Copy link
Author

lihaibh commented Oct 22, 2021

This is not related to wsl.
I tried to run Trezor Suite without the trazor bridge (i just shut down the trezord process) and it doesnt work, it relies only on the bridge to work, the usb interface doesnt work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected
Projects
No open projects
Backlog 🗂
❌ Closed
Development

No branches or pull requests

3 participants