Issue with Bitcoin Core v27.0: Database Read Error

12 replies 333 views
colddiamondHero Member
Posts: 623 · Reputation: 2467
#1Dec 17, 2024, 05:58 AM
Hey everyone, I’m having trouble launching my Bitcoin Core wallet on Windows. It keeps throwing up an error that says: Error reading from database. I’ve tried uninstalling and reinstalling various versions of BC, but I’m still stuck with the same issue and the wallet refuses to open. It was fully synced before all this happened. In the debug log, there's a message about LevelDB error: Corruption block checksum mismatch: F:\Bitcoin\chainstate/3348075.ldb. I’ve come across a few other threads with similar issues, and it seems like the general advice is to back up wallet.dat, then delete everything and start fresh. So I’m wondering, can I just delete the 3348075.ldb file from the chainstate folder and then restart? Would that save me from having to completely resync the whole blockchain again? Thanks!
6 Reply Quote Share
ryan_nodeSenior Member
Posts: 204 · Reputation: 859
#2Dec 17, 2024, 11:21 AM
Starting with -reindex-chainstate should be good enough, you won't need to resync all of the blocks as the corruption is in the chainstate database and not the blockchain. No. LevelDB lays out its database in a particular way and deleting any of its files is a surefire way to have even more corruption. The data there is not necessarily stored sequentially.
6 Reply Quote Share
colddiamondHero Member
Posts: 623 · Reputation: 2467
#3Dec 18, 2024, 10:34 PM
How do I do the reindex-chainstate files?
2 Reply Quote Share
bull_2019Senior Member
Posts: 296 · Reputation: 1992
#4Dec 19, 2024, 04:41 AM
Inorder to perform reindex Navigate to your bitcoin.conf file , by default  located in  C:\Users\<you>\AppData\Local\Bitcoin Else, check the part selected while installing ,if you don't have it create one. Insert
3 Reply Quote Share
gr3g.0rbitHero Member
Posts: 1025 · Reputation: 2646
#5Dec 20, 2024, 01:56 PM
First, close Bitcoin Core. Find Bitcoin Core's installation folder, look for "Bitcoin-qt" if you're using the GUI, else in daemon folder. (if you've used the installer, it defaults to "C:\Program Files\Bitcoin") While inside that folder, click Windows Explorer's "File" menu and select "Open Windows PowerShell" that will select the current folder as your working directory. The working directory should be displayed in PowerShell, e.g.: PS C:\Program Files\Bitcoin> In PowerShell, enter this to start Bitcoin-qt with the mentioned command line arg: That'll start Bitcoin Core and tell it to rebuild the chainstate. Take note that it will take quite some time but it will not re-download blocks that you already have, unless your blockchain is "pruned". If you decided to follow the instructions above, you MUST remove that entry in your bitcoin.conf after your node is done with it. Or else, it will reindex-chainstate every time you restart the client. Also, the default data directory is in the "Roaming" appdata directory instead of "local". So it should be in: C:\Users\<YOUR_USERNAME>\AppData\Roaming\Bitcoin ; Shortcut: %appdata%/bitcoin But if you've set the datadir in F:/ with the GUI's "Welcome Screen", you should use/create the bitcoin.conf file there.
0 Reply Quote Share
silentchainHero Member
Posts: 473 · Reputation: 2317
#6Dec 20, 2024, 03:51 PM
Probably to start from the  scratch is the best advice you have found so far as reindex-chainstate takes the painful time and doesn't guarantee that it will cope with the problem. A few months ago I found myself in the similar situation and reindex-chainste didn't help thus I wasted the time trying to use it to avoid IBD. When starting from scratch don't forget to put down into bitcoin.conf the following entries: dbcache=1/4 RAM  (for 8 GB  dbcache=2048, while for 16 GB dbcache=4096) and blocksonly=1 to sync a bit faster. BTW, v. 27.0 completes its  halt operations much faster then my previous 26.0
2 Reply Quote Share
gr3g.0rbitHero Member
Posts: 1025 · Reputation: 2646
#7Dec 20, 2024, 04:46 PM
But the debug.log entry shows otherwise. It specifically written that a file in his chainstate folder is corrupted that should be fixed by rebuilding the chainstate as mentioned by achow101. Your previous case may not be related to chainstate corruption that's why the command didn't worked. And the time it takes to --reindex-chainstate may not be fast but not as slow as --reindex or IBD.
1 Reply Quote Share
silentchainHero Member
Posts: 473 · Reputation: 2317
#8Dec 20, 2024, 11:17 PM
Agreed, but IBD secures full guarantee of pure untouched  copy of blockchain at your possession. After my case I'm sold on the keeping of backup copy of the blockchain. I have acquired  2TB SSD and attach it to my node from time to time to keep this backup active.
0 Reply Quote Share
cobra_2015Full Member
Posts: 259 · Reputation: 728
#9Dec 21, 2024, 05:17 AM
I set a folder backup to run once a day. Restoring will leave only one day to sync.
2 Reply Quote Share
colddiamondHero Member
Posts: 623 · Reputation: 2467
#10Dec 21, 2024, 04:45 PM
I see. Let me try this one. Thanks.
3 Reply Quote Share
colddiamondHero Member
Posts: 623 · Reputation: 2467
#11Dec 21, 2024, 06:17 PM
So I did the reindex-chainstate=1 and removed the pound sign. Now Bitcoin Core wallet is running again, but now it's starting back from 2009, which was the reason I was afraid I'd have to do.
2 Reply Quote Share
gr3g.0rbitHero Member
Posts: 1025 · Reputation: 2646
#12Dec 21, 2024, 08:09 PM
I made a note about reindex-chainstate in my reply just below his. To rephrase that, if your blockchain is pruned, it'll have to redownload the blockchain to rebuild the chainstate. If it is pruned, I'm afraid that you don't have any choice but to restart IBD due to having a corrupted chainstate and pruned blockchain. Also, read the other important notes since you've used the config file method. Or is your blockchain not pruned? Because it will seemingly do IBD but it's just processing the existing blocks on your disk. Are you using Bitcoin-qt (with GUI)? Does it show "Processing Blocks on disk", if so, that's just "reindexing"... not downloading.
5 Reply Quote Share
bull_2019Senior Member
Posts: 296 · Reputation: 1992
#13Dec 21, 2024, 09:24 PM
Are you using a prune mode ?? Or you don't  know how to check ?? If yes (you don't know if it's  pruned ) For bitcoin-qtwith GUI go to your settings>options You should see your prune settings like this if it's checked ✔️  then you  are pruned and running  re-index will probably  start the whole sync process  from the beginning  just as @nc50lc posted in his comment If not then  read this again
2 Reply Quote Share

Related topics