Built-in trezorctl on Tails OS won't update firmware

Greetings

I have just received brand new trezor devices and wanted to create and play around with multisig setups with different hardware wallets.

I am running latest tails version. The problem is that when I run trezorctl firmware-update I get connectivity errors.

The command line recognizes the new device when I run trezorctl list I get webusb:003:2:4 - Trezor 1 bootloader

So the device is in bootloader mode already.

The internet is 100% enabled, since I’m able to open tor browser.

I also tried different usb ports on my computer, the error persists.

When I run trezorctl firmware-update I get the following lines of code:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 159, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw)
  File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 80, in create_connection
    raise err
  File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 70, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 343, in _make_request
    self._validate_conn(conn)
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 841, in _validate_conn
    conn.connect()
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 301, in connect
    conn = self._new_conn()
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 168, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x78834568cfd0>: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 638, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 398, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='wallet.trezor.io', port=443): Max retries exceeded with url: /data/firmware/1/releases.json (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x78834568cfd0>: Failed to establish a new connection: [Errno 111] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/trezorctl", line 11, in <module>
    load_entry_point('trezor==0.12.2', 'console_scripts', 'trezorctl')()
  File "/usr/lib/python3/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/decorators.py", line 27, in new_func
    return f(get_current_context().obj, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/trezorlib/cli/__init__.py", line 78, in trezorctl_command_with_client
    return func(client, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/trezorlib/cli/firmware.py", line 236, in firmware_update
    list(bootloader_version), version_list, beta, bitcoin_only
  File "/usr/lib/python3/dist-packages/trezorlib/cli/firmware.py", line 91, in find_best_firmware_version
    releases = requests.get(url.format(bootloader_version[0])).json()
  File "/usr/lib/python3/dist-packages/requests/api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='wallet.trezor.io', port=443): Max retries exceeded with url: /data/firmware/1/releases.json (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x78834568cfd0>: Failed to establish a new connection: [Errno 111] Connection refused'))

I have also tried to run a root command line but also errors, however with root the error is different:

Failed to establish a new connection: [Errno -3] Temporary failure in name resolution

The easiest way is to find a Windows computer and upgrade it before using it.

The error says that trezorctl is unable to reach this address: https://wallet.trezor.io/data/firmware/1/releases.json

That is probably something to do with Tor being the only way to connect out, and not being available in command line.

You can use your web browser to download the latest firmware from webwallet-data/firmware/1 at master · trezor/webwallet-data · GitHub, and then use trezorctl firmware-update -f /path/to/downloaded-firmware.bin

1 Like

hi, i’m trying to set up trezor one on tails with rezorctl

the device is wiped and has no firmware on it or any data, I try to update the firmware with

torsocks trezorctl firmware-update

it doesn’t work i get the next message:

1684697810 WARNING torsocks[28387]: [syscall] Unsupported syscall number 39. Denying the call (in tsocks_syscall() at syscall.c:604)
Best available version: 1.12.1 
Downloading from https://wallet.trezor.io/data/firmware/1/trezor-1.12.1.bin
Trezor One v2 firmware (1.8.0 or later)  
Firmware version 1.12.1 build 0
Not enough distinct signatures (found 2, need 3)
Firmware validation failed, aborting.

I have also downloaded bin file and tried to install directly with

trezorctl firmware-update -f trezor-1.12.1.bin

but get the same error about not enough distinct signatures

Your trezorctl is too old. The new firmware 1.12.1 switched to a 2 out of 3 signature (it was 3 out of 5 previously).

You can either update trezorlib (e.g., pip3 install --upgrade trezor, if that’s how you installed trezorlib previously), or you can pass -s flag to skip the check and feed the firmware to Trezor directly.

You will first need to check the bootloader version on your Trezor. use trezorctl get-features to see the version. If it is lower than 1.12.1, you will first need to install the intermediate firmware: https://data.trezor.io/firmware/1/trezor-inter-v2.bin

Hi,

Trezorctl is pre-installed on TailsOS

I thought trezor knows about it, and I thought tailsOS would update it.

Thank you for answer, will try updating it later.

Hello again

So apparently the trezorctl installed is not outdated, it is a 0.12.2-2 version

so what could be the issue? why am i getting error when trying to update firmware?

thank you

the current trezorctl version is 0.13.6 from April 2023: trezor · PyPI

unfortunately the package in Debian / Tails is out of date, and there is very little we can do about it :frowning:

You will need to install a newer version via pip. Probably the easiest way is to make sure you have python3-pip installed, then uninstall trezor and python3-trezor, and run pip install --user trezor

1 Like

thanks a lot! maybe i’ll try doing that on tails if possible, if not i’ll wait for the debian/tails update

thank you

Hello agian

I have managed to update trezorctl to 0.13.16 with:

sudo apt update
sudo apt install python3-pip
sudo apt purge trezor python3-trezor
pip install --user trezor

Since I’m using tails it have been installed in the /home/amnesia/.local/bin so to use it I first do cd /home/amnesia/.local/bin

I can check version of trezorctl by running python3 trezorctl --version it returns trezorctl, version 0.13.6

Everything works, but now on this updated version when I connect trezor one and try to run python3 trezorctl list I get the next error:

Failed to enumerate WebUsbTransport. USBErrorAccess: LIBUSB_ERROR_ACCESS [-3]

This error is not present in the previous trezorctl version when i run it on tails (which is 0.12.2-2)

I have tried two different trezor devices, and different USB ports on my laptop, nothing helps.

What could be the problem?

ohh right, the problem is likely the removal of the distribution trezor package :frowning:

For Trezor to work for regular users in Linux, you need to install udev rules. Debian people chose to package the udev rules together with trezorctl in the trezor package. This is unfortunate for you, because if you reinstall it, you’ll have two copies of trezorctl: the system-wide one and the one you installed in ~/.local/bin.

If you don’t mind having two versions at the same time, you can fix the problem by reinstalling trezor from the package manager.

Otherwise you can install the udev rules manually, or as part of the trezor-bridge package that you can download here: Trezor Suite

1 Like

everything seems to be working now!

hopefuly debian/tails will be updated soon

thank you