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

Unexpected magic characters #3131

Closed
874gt837g4 opened this issue Oct 26, 2017 · 9 comments
Closed

Unexpected magic characters #3131

874gt837g4 opened this issue Oct 26, 2017 · 9 comments

Comments

@874gt837g4
Copy link

trying to use my trezor with electrum...weird...i can change name by clicking on trezor in bottom right, and name change goes to trezor

but plugged in...i try to sign txs,,,,it says "Unexpected magic characters" and i cannot spend my coins...

any help please?

@874gt837g4
Copy link
Author

i tried already using diff usb cables, trying restart computer, try usb port different, not working

@SomberNight
Copy link
Member

SomberNight commented Oct 26, 2017

What are the versions of

  • Electrum
  • python-trezor
  • Trezor firmware

@davidkaufman
Copy link

davidkaufman commented Oct 26, 2017

This happened to me a couple weeks ago too after I updated my Trezor's firmware to access my bitcoin cash wallet, transfer it to real bitcoin, and then transfer everything to a new segwit address wallet. At that point Electrum stopped being able to open the trezor wallet. You have to connect to your Trezor using https://wallet.trezor.io/ now until Electrum gets segwit capability, I think?

@rroopreddy
Copy link

rroopreddy commented Nov 24, 2017

I get the same issue, discussed at : https://bitcointalk.org/index.php?topic=2102136.0;all

Electrum 3.0.2
Trezor 1.6 (tried with 1.5.2 with same problem)
trezor-0.7.16 (pip3 install trezor on mac)

@SomberNight
Copy link
Member

Another report of this on IRC. Seems to be MacOS related. Has anyone experienced it on another OS?

<kyuupichan> jddebug: have you tried changing the USB port and closing all electrum windows?
<jddebug> I have. I think it may be the way electrum communicates to the trezor on mac
<kyuupichan> I've used on on my mac without issue
<jddebug> What OS version? I'm using a MacPro.
<ghost43> are you using the official 3.0.2 binary jddebug?
<ghost43> or source
<jddebug> I am using the exicutable.
<jddebug> executable
<kyuupichan> I'm running from source on latest MacOSX update.  trezor 0.7.16 hidapi 0.7.99.post21
<ghost43> jddebug: any chance you can try running from source
<kyuupichan> I did see the magic error once, not sure if for trezor or keepkey, but it went away
<ghost43> kyuupichan: or that you try running the binary? :D
...
<kyuupichan> "Unexpected magic characters" when running the binary
<ghost43> kyuupichan: thanks. my working theory is that the trezorlib included in the binary might be an older version
<jddebug> yes
<ghost43> because the version is not fixed im the repository for Mac
<ghost43> only for Windows
<kyuupichan> Also when running from source :(  No clue.
<kyuupichan> However it does seem to function normally
<kyuupichan> It's the init_device call on line 458 of client.py that is causing the error
<jddebug> Does yours show a green or red dot on the trezor icon?
<kyuupichan> It does after I do more stuff (I right clicked an address and asked to show on trezor; that worked).
<kyuupichan> So something is failing in the initial pairing attempt.  I'm not going to debug it as I use keepkey daily; it doesn't have the magic character issue.
<ghost43> kyuupichan: which client.py?
<ghost43> kyuupichan: oh the one in python-trezor
<kyuupichan> ghost43: sorry that's in trezorlib.  The electrum code is trezor/plugin.py line 110 in create_client where it calls self.client_class(); it's the PrtocolMixin init function.

The lines @kyuupichan mentioned:
https://github.com/trezor/python-trezor/blob/62541cc55fd447b2687ce3fddc51db6843f3c9f5/trezorlib/client.py#L450-L461

client = self.client_class(transport, handler, self)

I'll also reference this trezor/python-trezor#76

@prusnak
Copy link
Contributor

prusnak commented Dec 27, 2017

Fix the issue similarly to how it was fixed here: romanz/trezor-agent#50

Or even better, don't try to enumerate devices by yourself, but use the enumeration methods provided by python-trezor.

@mcmire
Copy link

mcmire commented Jan 17, 2018

This is a problem for me as well. Strangely, when I initially set up my Trezor, I don't get this error (although I can't see my balance). However, when I reconnect my Trezor then I get this error. I've read through the replies above but I'm not sure if I understand -- is this a bug in Electrum or something downstream?

@SomberNight
Copy link
Member

Is this problem still present on current master?
We now use enumeration methods from python-trezor I believe.

@SomberNight
Copy link
Member

closing due to #4875

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

7 participants