trezor-suite
trezor-suite copied to clipboard
Label files moved from Dropbox to Local file system become incompatible
Describe the bug
When copying label files (*.mtdt
) from the Dropbox Apps/TREZOR folder to the local folder (Linux for example: /home/$USER/.config/@trezor/suite-desktop/metadata
) for storing labels and running Suite, a lot of errors of about this content are obtained (they quickly pop up and disappear from view):
"Failed to load labeling data: Unsupported state or unable to authenticate data"
Info:
- Remembered Wallet: no
- Suite Version: app
- Browser: name, version
- OS: Ubuntu 20.04
- Firmware Version: actual firmware
How to reproduce
- Download files through web interface of the Dropbox site as ZIP archive
- Unpack a
*.mtdt
files to/home/$USER/.config/@trezor/suite-desktop/metadata
- Run Trezor Suite
- Select Options -> Application -> Labels On -> Connect -> To select type as "Local file system"
Expected behavior
The label files that are stored in Dropbox, in my opinion, should be compatible with the label files that are stored on the local storage
I can confirm that I was able to reproduce it.
.mtdt files are incompatible when transferred both ways.
I switched them both ways Dropbox <> Local storage and Trezor Suite reported
Failed to load labeling data: Unsupported state or unable to authenticate data
both times.
I'm not sure if this expected or not. We have to ask developers of labeling.
Hello, there is a mismatch in how files are saved. What you download from dropbox is in binary format. What suite saves and reads from local filesystem is expected to be in utf-8 format.
Thanks for reporting, we should do:
- [ ] add some format checks and show an error that makes sense
- [ ] unify it somehow.
What suite saves and reads from local filesystem is expected to be in utf-8 format.
This sounds strange, because if you save utf-8 and read utf-8, it's the same as working with a binary format.
Thanks for reporting, we should do:
In general, it is considered good form to work with binary files as with binary ones. I believe that crypted label files are in any binary format, and they need to be opened in binary mode. If you open binary files as utf-8 encoding, then it's generally strange that you have it all working somewhere.
any update on this?
I found workaround and converted all files!
- Get all files from DropBox through web! Go to Apps/TREZOR folder and download ZIP archive
- Unpack files from archive and to move to
~/.config/@trezor/suite-desktop/metadata
folder (Linux). If there are other mdtd files please delete their before! - Write in this folder a perl script below too (
convert.pl
file) and set permissions as 755 (chmod 755 convert.pl
):
#!/usr/bin/perl
open(my $fh, '<:raw', $ARGV[0]) or die;
open(my $fhOut, '>:utf8', $ARGV[0] . '.converted') or die;
local $/ = undef;
print $fhOut unpack('H*', <$fh>);
close $fh || die;
close $fhOut || die;
rename($ARGV[0] . '.converted', $ARGV[0]);
- To do this in shell:
ls -1 *.mtdt|awk '{print "./convert.pl "$1}'|sh
- Go to Suite and unconnect a Dropbox method and do there a Local method. You will see your labels again!
- Delete
convert.pl
file orchmod 644 convert.pl
(to protect against accidental conversion twice)
Bonus: I recommend to see the Syncthing as solution for sync the folder of ~/.config/@trezor/suite-desktop/metadata
between your own machines! (no cloud there just your devices as your own cloud!)