question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: 'NoneType' object is not subscriptable

See original GitHub issue

Crash Report

This crash report was reported through the automatic crash reporting system 🤖

Traceback

  File "electroncash/util.py", line 830, in run_with_except_hook
  File "electroncash/network.py", line 1503, in run
  File "electroncash/network.py", line 1476, in wait_on_sockets
  File "electroncash/network.py", line 892, in process_responses
  File "electroncash/network.py", line 793, in process_response
  File "electroncash/network.py", line 1545, in on_notify_header
  File "electroncash/network.py", line 1610, in request_initial_proof_and_headers
  File "electroncash/network.py", line 1564, in _process_latest_tip
  File "electroncash/blockchain.py", line 143, in can_connect
  File "electroncash/blockchain.py", line 586, in can_connect
  File "electroncash/blockchain.py", line 485, in get_bits
  File "electroncash/blockchain.py", line 447, in get_asert_anchor
  File "electroncash/blockchain.py", line 405, in get_median_time_past
  File "electroncash/blockchain.py", line 405, in <listcomp>

TypeError: 'NoneType' object is not subscriptable

Reporter

This issue was reported by 77 user(s):

Electron Cash Version Python Version Operating System Wallet Type Locale Stack
4.2.0 3.6.9 (default, Oct 21 2020, 19:43:27) [GCC Clang 10.0.1 ] Darwin-19.6.0-x86_64-i386-64bit standard
3.6.5 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.18362-SP0 standard en_NL
3.6.5 3.6.9 (default, Jun 28 2018, 19:01:02) [GCC 5.4.0 20160609] Linux-4.19.0-12-amd64-x86_64-with-debian-10.7 slp_standard en_US
3.6.5 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.18362-SP0 standard en_US
3.6.5 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.18362-SP0 standard en_US
3.6.5 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.19041-SP0 slp_standard en_US
4.2.0 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.19041-SP0 standard en_US
3.6.5 3.6.9 (default, Jun 28 2018, 19:01:02) [GCC 5.4.0 20160609] Linux-4.15.0-128-generic-x86_64-with-debian-buster-sid slp_standard en_ZA
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.18362-SP0 slp_standard da_DK
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.18362-SP0 slp_standard da_DK
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.19041-SP0 standard nl_NL
3.6.6 3.6.9 (default, Jan 1 2021, 13:37:04) [GCC 4.2.1 Compatible Apple LLVM 11.0.3 (clang-1103.0.32.62)] Darwin-18.6.0-x86_64-i386-64bit slp_standard
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-7-6.1.7601-SP1 slp_standard zh_CN
3.6.6 3.6.9 (default, Jan 1 2021, 13:37:04) [GCC 4.2.1 Compatible Apple LLVM 11.0.3 (clang-1103.0.32.62)] Darwin-20.3.0-x86_64-i386-64bit slp_standard
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.19041-SP0 slp_standard nl_BE
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-7-6.1.7601-SP1 slp_standard zh_CN
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.19041-SP0 slp_imported_privkey en_US
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.19041-SP0 slp_standard en_US
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.18362-SP0 slp_imported_privkey da_DK
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.18362-SP0 standard zh_CN
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.18362-SP0 standard zh_CN
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.18362-SP0 standard zh_CN
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.14393-SP0 slp_standard ar_SA
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.14393-SP0 slp_standard ar_SA
3.6.6 3.6.9 (default, Jun 28 2018, 19:01:02) [GCC 5.4.0 20160609] Linux-5.4.0-66-generic-x86_64-with-debian-bullseye-sid slp_standard en_US
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.19041-SP0 slp_standard nl_BE
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-7-6.1.7601-SP1 slp_standard en_PH
4.2.0 3.6.9 (default, Jun 28 2018, 19:01:02) [GCC 5.4.0 20160609] Linux-5.8.0-44-generic-x86_64-with-debian-bullseye-sid standard zh_CN
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-7-6.1.7601-SP1 slp_standard en_PH
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.19041-SP0 slp_standard en_US
3.6.6 3.6.9 (default, Jan 1 2021, 13:37:04) [GCC 4.2.1 Compatible Apple LLVM 11.0.3 (clang-1103.0.32.62)] Darwin-18.7.0-x86_64-i386-64bit slp_standard
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-7-6.1.7601-SP1 slp_standard en_PH
3.6.6 3.6.9 (default, Jun 28 2018, 19:01:02) [GCC 5.4.0 20160609] Linux-5.4.0-67-generic-x86_64-with-debian-bullseye-sid standard en_ZA
3.6.6 3.6.9 (default, Jun 28 2018, 19:01:02) [GCC 5.4.0 20160609] Linux-5.4.0-67-generic-x86_64-with-debian-bullseye-sid slp_standard en_ZA
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.19041-SP0 slp_standard tr_TR
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.19041-SP0 slp_imported_addr en_NZ
3.6.6 3.6.9 (default, Jun 28 2018, 19:01:02) [GCC 5.4.0 20160609] Linux-4.15.0-136-generic-x86_64-with-debian-buster-sid slp_imported_privkey es_AR
3.6.6 3.6.9 (default, Jun 28 2018, 19:01:02) [GCC 5.4.0 20160609] Linux-5.8.0-48-generic-x86_64-with-debian-bullseye-sid imported_privkey,slp_standard en_US
3.6.6 3.6.9 (default, Jun 28 2018, 19:01:02) [GCC 5.4.0 20160609] Linux-5.8.0-48-generic-x86_64-with-debian-bullseye-sid slp_standard en_US
3.6.6 3.6.9 (default, Jun 28 2018, 19:01:02) [GCC 5.4.0 20160609] Linux-5.8.0-48-generic-x86_64-with-debian-bullseye-sid slp_standard en_US
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.19041-SP0 slp_standard ja_JP
3.6.6 3.6.9 (default, Jun 28 2018, 19:01:02) [GCC 5.4.0 20160609] Linux-4.15.0-136-generic-x86_64-with-debian-buster-sid slp_imported_privkey es_AR
3.6.6 3.6.9 (default, Jun 28 2018, 19:01:02) [GCC 5.4.0 20160609] Linux-5.10.23-1-MANJARO-x86_64-with-arch-Manjaro-Linux standard pl_PL
3.6.6 3.6.9 (default, Jun 28 2018, 19:01:02) [GCC 5.4.0 20160609] Linux-5.11.2-gnu-1-x86_64-with-arch slp_standard
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.19041-SP0 standard fr_BE
4.2.0 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.18362-SP0 standard en_US
3.6.6 3.6.9 (default, Jan 1 2021, 13:37:04) [GCC 4.2.1 Compatible Apple LLVM 11.0.3 (clang-1103.0.32.62)] Darwin-20.3.0-x86_64-i386-64bit standard
3.6.6 3.6.9 (default, Jan 1 2021, 13:37:04) [GCC 4.2.1 Compatible Apple LLVM 11.0.3 (clang-1103.0.32.62)] Darwin-20.2.0-x86_64-i386-64bit slp_standard
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.19041-SP0 slp_standard en_US
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.19041-SP0 slp_standard en_US
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.19041-SP0 slp_standard en_US
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.19041-SP0 slp_standard en_US
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.19041-SP0 slp_standard en_US
3.6.6 3.6.9 (default, Jan 1 2021, 13:37:04) [GCC 4.2.1 Compatible Apple LLVM 11.0.3 (clang-1103.0.32.62)] Darwin-20.4.0-x86_64-i386-64bit standard
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.19041-SP0 slp_standard en_GB
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.19041-SP0 slp_standard en_GB
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.19041-SP0 slp_standard en_GB
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.19041-SP0 slp_standard en_US
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.19041-SP0 slp_standard en_US
3.6.6 3.6.9 (default, Jun 28 2018, 19:01:02) [GCC 5.4.0 20160609] Linux-4.15.0-142-generic-x86_64-with-debian-buster-sid slp_standard en_US
3.6.6 3.6.9 (default, Jun 28 2018, 19:01:02) [GCC 5.4.0 20160609] Linux-4.15.0-142-generic-x86_64-with-debian-buster-sid slp_standard en_US
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.21382-SP0 imported_privkey en_US
3.6.6 3.6.9 (default, Jun 28 2018, 19:01:02) [GCC 5.4.0 20160609] Linux-5.10.0-6-amd64-x86_64-with-debian-11.0 slp_standard en_US
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.19041-SP0 slp_standard en_GB
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.21382-SP0 imported_privkey en_US
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.19041-SP0 slp_standard zh_TW
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.19041-SP0 slp_standard de_DE
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.19041-SP0 slp_standard de_DE
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.19041-SP0 slp_standard de_DE
3.6.6 3.6.9 (default, Jan 1 2021, 13:37:04) [GCC 4.2.1 Compatible Apple LLVM 11.0.3 (clang-1103.0.32.62)] Darwin-20.6.0-x86_64-i386-64bit standard
3.6.6 3.6.9 (default, Jun 28 2018, 19:01:02) [GCC 5.4.0 20160609] Linux-5.4.0-90-generic-x86_64-with-debian-bullseye-sid slp_standard en_ZA
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.19041-SP0 standard zh_TW
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.19041-SP0 standard es_AR
3.6.6 3.6.9 (default, Jun 28 2018, 19:01:02) [GCC 5.4.0 20160609] Linux-5.4.0-96-generic-x86_64-with-debian-bullseye-sid slp_standard en_ZA
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.22000-SP0 slp_standard en_US
3.6.6 3.6.9 (default, Jan 1 2021, 13:37:04) [GCC 4.2.1 Compatible Apple LLVM 11.0.3 (clang-1103.0.32.62)] Darwin-20.6.0-x86_64-i386-64bit slp_standard
3.6.6 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] Windows-10-10.0.19041-SP0 slp_standard en_US

Additional Information

i do not see my token tab on my wallet


SLP version 3.6.5 with flipstarter plugin just sitting open for a few minutes. 3rd time it’s crashed like this. wallet is empty and never had any funds in it. Windows 10 64 bit


BUG running 4.2 after 4.2.3. First I Setup a hardware wallet on 4.2.3. Sent some unsplit coins to a fresh address via fulcrum.fountainhead.cash. Then tried switching to electrum.bitcoinabc.org and it got added to the banlist automatically. Discovered I should be using 4.2. Downloaded the exe, checked the sha256. Closed 4.2.3. Opened 4.2.0, cleared the banlist, put electrum.bitcoinabc.org as the server, then switched tabs between addresses and send to see that i had to correct address. Crashed on the Send screen.


archie.bitcoin@gmail.com


Failed to mint token


Crashed while synchronizing


I was trying to send SLP tokens.


Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
cculianucommented, Dec 16, 2020

This looks like a completely different bug to me, although I still don’t know the codebase too well.

It’s the same bug.

Am I missing something?

That whole codepath that scans for MTP should not be executed for blocks before the checkpoint. Why? Because we don’t have headers for blocks before the checkpoint. We don’t need to verify all of them – so we never download all of them; thus, there may be swiss-cheese holes in them. The bug was triggered when we iterated backward and encountered headers that are missing.

With the new asert fixes in 3f633185eec10145eb52df20b2c1f4ae6bd9483d, we won’t end up iterating backward to ask about blocks that do not exist in our header store. The whole thing was being executed due to an error in reasoning on my part. It never should have gotten there.

After the fix, the “bug” can never trigger because we won’t be asking the wrong question of the wrong data anymore. Thus you can’t get None for non-existant headers anymore.

Stated simply: The reason for the bug is we were asking the wrong question of the wrong data. The fix is to not ask that question of the wrong data.

0reactions
gasullcommented, Dec 16, 2020

I don’t see how to reopen the bug, @cculianu.

This looks like a completely different bug to me, although I still don’t know the codebase too well.

The original crash report above shows that the error originates in the list comprehension that is assigned to times, and which calls read_header.

While your fix on 3f63318 is for get_asert_anchor.

Am I missing something?

(And yes, my code above is at most a starting point or a stub).

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: 'NoneType' object is not subscriptable
NoneType is the type of the None object which represents a lack of value, for example, a function that does not explicitly return...
Read more >
Python Math - TypeError: 'NoneType' object is not subscriptable
The reason that lista gets set to None is because the return value of list.sort() is None ... it does not return a...
Read more >
[Solved] TypeError: 'NoneType' Object is Not Subscriptable
The error, NoneType object is not subscriptable, means that you were trying to subscript a NoneType object. This resulted in a type error....
Read more >
Python TypeError: 'NoneType' object is not subscriptable
The “TypeError: 'NoneType' object is not subscriptable” error is common if you assign the result of a built-in list method like sort() ,...
Read more >
TypeError: 'NoneType' object is not subscriptable in Python
The Python "TypeError: 'NoneType' object is not subscriptable" occurs when we try to access a None value at a specific index. To solve...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found