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.

[BUG] Key-Error - Chia wallet not loading (latest checkout)

See original GitHub issue

After checking out the newest commit, I’m unable to start the wallet:

`stderr: Traceback (most recent call last):
  File "/chia/chia-blockchain/venv/bin/chia_wallet", line 33, in <module>
stderr:     sys.exit(load_entry_point('chia-blockchain', 'console_scripts', 'chia_wallet')())
  File "/chia/chia-blockchain/chia/server/start_wallet.py", line 92, in main
    return run_service(**kwargs)
  File "/chia/chia-blockchain/chia/server/start_service.py", line 218, in run_service
    return asyncio.run(async_run_service(*args, **kwargs))
  File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
stderr:     return future.result()
  File "/chia/chia-blockchain/chia/server/start_service.py", line 212, in async_run_service
stderr:     return await service.run()
  File "/chia/chia-blockchain/chia/server/start_service.py", line 156, in run
    await self.start()
  File "/chia/chia-blockchain/chia/server/start_service.py", line 127, in start
    await self._node._start(**kwargs)
stderr:   File "/chia/chia-blockchain/chia/wallet/wallet_node.py", line 151, in _start
    self.wallet_state_manager = await WalletStateManager.create(
  File "/chia/chia-blockchain/chia/wallet/wallet_state_manager.py", line 138, in create
    self.blockchain = await WalletBlockchain.create(
  File "/chia/chia-blockchain/chia/wallet/wallet_blockchain.py", line 106, in create
stderr:     await self._load_chain_from_store()
  File "/chia/chia-blockchain/chia/wallet/wallet_blockchain.py", line 117, in _load_chain_from_store
    height_to_hash, sub_epoch_summaries = await self.block_store.get_peak_heights_dicts()
  File "/chia/chia-blockchain/chia/wallet/wallet_block_store.py", line 283, in get_peak_heights_dicts
stderr:     curr_height = hash_to_height[curr_header_hash]
KeyError: b'6\xe0p\xf2\xbd\xd9!a\xdf\xfe\xcc\xa1\x03\.................... (removed the last few chars)`

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
krowllcommented, May 9, 2021

Just a quick follow-up:

I have now deleted

(location: ~/.chia/mainnet/wallet/db/)

  • blockchain_wallet_v1_mainnet_“somenumber”.sqlite and (location: ~/.chia/mainnet/db/)
  • blockchain_v1_mainnet.sqlite

I have then closed and restarted chia. Unfortunately, with the deletion of the blockchain-db, you’ll have to resync.

3reactions
mkovagscommented, Jun 11, 2021

I ran out of space yesterday and wallet keeps throwing the same error ever since.

Would it be possible to delete only the db of the wallet so I wouldn’t have to re-sync for another 3 days? Or the db and wallet db are bound together?

Yes, you can!

Here’s what I did it in Linux:

  • cd ~/.chia/
  • cp -r mainnet mainnet.old
  • rm -r mainnet/wallet
  • Run the Chia GUI
  • Insert the seed to my private key

The whole blockchain will be there and you’ll be farming straight away

In case you have any height farmed, you’ll have to manually edit the sqlite file to insert the data that was previously there since the Chia GUI won’t re-scan the blockchain to figure out if you ever won anything in your wallet.

It shouldn’t be hard to use some program like sqlitebrowser and manually restore the data related to the coins that you earned but it’s just cosmetic.

Edit: After a few hours the chia client realized that I had a balance and updated to the right values without me having to do anything.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Endless "Connecting to wallet" : r/chia - Reddit
Shutdown the Chia GUI. Start chia from the command line ('chia start farmer') and then open the GUI. On Linux, this fixes the...
Read more >
Unable to load the list of the keys - Support - Chia Forum
I have 6 wallets and lately when trying to open the chia 1.3.4 software on ... I get a message telling me “Unable...
Read more >
[Support] Machinaris - Chia cryptocurrency farming + Plotman ...
An error in the WebUI as you report does not mean that the underlying Chia farm is not functioning, just that there is...
Read more >
Download - Chia Network
This page is the only official source for Chia client installer downloads. Do not trust downloads from other sources. The Chia client can...
Read more >
Untitled
Chiavette vodafone internet offerte, Qatar lifestyle, Bohrsches postulat ... Recursive c++ fibonacci, Civ 5 mods not loading, Szczepanowska jolanta opinie, ...
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