Author

Topic: Error: fromhex() argument must be str, not None (Read 117 times)

HCP
legendary
Activity: 2086
Merit: 4361
That looks pretty good. A solid description of the error... what you were doing when you found it and the steps required to reproduce it. I like that you also mentioned that file/usb work OK.

About the only other things I would add to the report would be:

- OS on online machine
- OS on offline machine
- Version of Electrum on online machine
- Version of Electrum on offline machine

and possibly the firmware on the Ledger device and the version of the Bitcoin "coin app" installed on your Nano S.
jr. member
Activity: 32
Merit: 37
It would appear that the QR Code encoder (or decoder) is not including something during (de)serialization that the Ledger plugin requires... Undecided It's quite possible the code that fixed the issue for the other issue was not included into the Ledger plugin, but should have been.

If you haven't already, I would suggest that you log an issue on Github: https://github.com/spesmilo/electrum/issues

Include the relevant log file date in your issue report and don't forget to mention that you're using a Ledger Nano S.

Ok, I've made an attempt: https://github.com/spesmilo/electrum/issues/7257

I haven't made a GitHub post before, so please let me know if I need to do anything differently.

Thanks for everyone's time.
HCP
legendary
Activity: 2086
Merit: 4361
It would appear that the QR Code encoder (or decoder) is not including something during (de)serialization that the Ledger plugin requires... Undecided It's quite possible the code that fixed the issue for the other issue was not included into the Ledger plugin, but should have been.

If you haven't already, I would suggest that you log an issue on Github: https://github.com/spesmilo/electrum/issues

Include the relevant log file date in your issue report and don't forget to mention that you're using a Ledger Nano S.
jr. member
Activity: 32
Merit: 37
Are you using Electrum's ZBar scanner (Tools->Load transaction->From QR code) or a third-party QR code scanner?
Because AFAIK, the latter will produce problems with the scanned transaction.

Yes, using the Electrum Scanner, but I even used non-Electrum QR Readers/Creators on both ends to construct the transaction to QR and deconstruct the transaction to text on the offline machine and then import as text. Both attempts had the same issue.
jr. member
Activity: 32
Merit: 37
I assume both of the Electrum clients are on the same version?

It's hard to tell which part of Electrum is throwing that error and what is causing it. Could you go to Tools>Preferences and check "Write Logs to File". Afterwards, restart it and do the same QR code signing again. When it throws an exception, go to your data directory (usually %appdata%/Electrum for Windows) and go into the Log folder. Open the log file with the latest edit and check the contents for the exception. There should be certain files and lines referenced. Omit all the sensitive information (shouldn't be too much) and share only the specific part.

I can't replicate your error no matter how many times I've tried.

Yes, both clients are 4.1.2. But I also tried both with an older version 4.x.x before updating in an attempt to fix this error.

Quote
20210429T072254.005389Z |     INFO | plugin.DeviceMgr | getting client for keystore
20210429T072254.005389Z |     INFO | plugin.DeviceMgr | scanning devices...
20210429T072254.061315Z |    DEBUG | util.profiler | DeviceMgr.scan_devices 0.0559
20210429T072254.061315Z |     INFO | plugin.DeviceMgr | end client for keystore
20210429T072254.092567Z |     INFO | plugin.DeviceMgr | getting client for keystore
20210429T072254.092567Z |     INFO | plugin.DeviceMgr | scanning devices...
20210429T072254.155052Z |    DEBUG | util.profiler | DeviceMgr.scan_devices 0.0625
20210429T072254.155052Z |     INFO | plugin.DeviceMgr | end client for keystore
20210429T072254.155052Z |     INFO | plugin.DeviceMgr | getting client for keystore
20210429T072254.155052Z |     INFO | plugin.DeviceMgr | scanning devices...
20210429T072254.204624Z |    DEBUG | util.profiler | DeviceMgr.scan_devices 0.0496
20210429T072254.204624Z |     INFO | plugin.DeviceMgr | end client for keystore
20210429T072254.204624Z |    ERROR | plugins.ledger.ledger.Ledger_KeyStore |
Traceback (most recent call last):
  File "C:\Program Files (x86)\Electrum\electrum\plugins\ledger\ledger.py", line 459, in sign_transaction
    txtmp = bitcoinTransaction(bfh(utxo[0]))
TypeError: fromhex() argument must be str, not None
20210429T072254.204624Z |     INFO | plugins.ledger.ledger | fromhex() argument must be str, not None


I probably should have added that I'm using a Nano S to sign the transaction, but I didn't think it relevant, because it works when the transaction is transferred via USB and signed with the Nano S on this offline device, but not via QR.


Google of that error message (txtmp = bitcoinTransaction(bfh(utxo[0]))) takes me here: ( https://github.com/spesmilo/electrum/issues/3302 ) which looks like it was fixed for segwit transactions (and hence it works for my situation when transferring via file and USB) but doesn't explain why it won't work when transferring via QR. Is less information transferred (even when using Export -> For hardware device, include Xpubs -> Show as QR) when using QR Code?

The transaction is a nested segwit transaction.
legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
Are you using Electrum's ZBar scanner (Tools->Load transaction->From QR code) or a third-party QR code scanner?
Because AFAIK, the latter will produce problems with the scanned transaction.
legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
I assume both of the Electrum clients are on the same version?

It's hard to tell which part of Electrum is throwing that error and what is causing it. Could you go to Tools>Preferences and check "Write Logs to File". Afterwards, restart it and do the same QR code signing again. When it throws an exception, go to your data directory (usually %appdata%/Electrum for Windows) and go into the Log folder. Open the log file with the latest edit and check the contents for the exception. There should be certain files and lines referenced. Omit all the sensitive information (shouldn't be too much) and share only the specific part.

I can't replicate your error no matter how many times I've tried.
jr. member
Activity: 32
Merit: 37
When attempting to use QR Codes to transfer unsigned bitcoin transactions, when using Electrum to build the transaction, after clicking 'sign' I get the following message: fromhex() argument must be str, not None

I am aware Electrum uses non standard QR Codes, but I don't believe my issue lies there, because I have used both Electrum to Electrum QR as well as non-Electrum to Electrum via QR. Both methods have been able to contruct the transaction for viewing (and it has the correct inputs/outputs etc) but get the same error when attempting to sign.

All else appears to work fine, and when the exact same work-flow is done via 'file' over USB rather than QR code, everything is able to be signed perfectly. I have attempted saving the file once imported via QR and then loading that file and trying to sign, but I get the same error message.

I have also used all variations of (export via QR, export for hardware wallet via QR, etc) without success.


Any idea what I could be doing wrong?

Latest Electrum Version running on an offline machine (and one on an Online machine).
Jump to: