Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: ultrametalurge on August 24, 2019, 10:52:29 AM



Title: Error message "Error opening block database"
Post by: ultrametalurge on August 24, 2019, 10:52:29 AM
I had to reinstall BTC core after my old harddrive crashed.  I got a new hard drive.  When i download bitcoin core, after it synchs anywhere between 30-60% of the blocks, I keep getting the error message "error opening block database. Do you want to rebuild the block database now?".  I click  yes, but then it says "error opening block database" and it won't allow me to download more blocks.  How do i fix this?


Title: Re: Error message "Error opening block database"
Post by: AdolfinWolf on August 24, 2019, 12:05:02 PM
Might be useful to post the debug log here if you want people to look into it a bit further.

It sounds like your files are somehow corrupted though.


Title: Re: Error message "Error opening block database"
Post by: jackg on August 24, 2019, 03:54:37 PM
From what I remember, this problem normally gets fixed by renaming the last fine in your block data directory (the "blocks" folder in the data directory) and then restarting bitcoin core.

Like etf says if you provide us with more information we might be able to help more (posting the debug.log). It might also be helpful to know if you have any antivirus running as that can sometimes tamper with the storing of blocks (if you do, quarenteen the block database folder - don't completely deactivate the AV).


Title: Re: Error message "Error opening block database"
Post by: ultrametalurge on August 25, 2019, 01:19:12 PM
Here is the latest from the debug log.

2019-08-25T13:13:22Z Cache configuration:
2019-08-25T13:13:22Z * Using 2.0 MiB for block index database
2019-08-25T13:13:22Z * Using 8.0 MiB for chain state database
2019-08-25T13:13:22Z * Using 440.0 MiB for in-memory UTXO set (plus up to 286.1 MiB of unused mempool space)
2019-08-25T13:13:22Z init message: Loading block index...
2019-08-25T13:13:22Z Opening LevelDB in I:\blocks\index
2019-08-25T13:13:22Z Opened LevelDB successfully
2019-08-25T13:13:22Z Using obfuscation key for I:\blocks\index: 0000000000000000
2019-08-25T13:13:22Z LoadBlockIndexDB: last block file = 0
2019-08-25T13:13:22Z LoadBlockIndexDB: last block file info: CBlockFileInfo(blocks=0, size=0, heights=0...0, time=1970-01-01...1970-01-01)
2019-08-25T13:13:22Z Checking all blk files are present...
2019-08-25T13:13:22Z Initializing databases...
2019-08-25T13:13:22Z Opening LevelDB in I:\chainstate
2019-08-25T13:13:22Z Fatal LevelDB error: Corruption: 1616 missing files; e.g.: I:\chainstate/101567.ldb
2019-08-25T13:13:22Z You can use -debug=leveldb to get more complete diagnostic messages
2019-08-25T13:13:22Z Fatal LevelDB error: Corruption: 1616 missing files; e.g.: I:\chainstate/101567.ldb
2019-08-25T13:13:22Z : Error opening block database.
Please restart with -reindex or -reindex-chainstate to recover.
2019-08-25T13:13:28Z init message: Loading block index...
2019-08-25T13:13:28Z Wiping LevelDB in I:\blocks\index
2019-08-25T13:13:28Z Opening LevelDB in I:\blocks\index
2019-08-25T13:13:28Z Opened LevelDB successfully
2019-08-25T13:13:28Z Using obfuscation key for I:\blocks\index: 0000000000000000
2019-08-25T13:13:28Z Initializing databases...
2019-08-25T13:13:28Z Wiping LevelDB in I:\chainstate
2019-08-25T13:13:28Z Opening LevelDB in I:\chainstate
2019-08-25T13:13:28Z Fatal LevelDB error: Corruption: 1616 missing files; e.g.: I:\chainstate/101567.ldb
2019-08-25T13:13:28Z You can use -debug=leveldb to get more complete diagnostic messages
2019-08-25T13:13:28Z Fatal LevelDB error: Corruption: 1616 missing files; e.g.: I:\chainstate/101567.ldb
2019-08-25T13:13:28Z Error: Error opening block database
2019-08-25T13:13:29Z Shutdown: In progress...
2019-08-25T13:13:29Z scheduler thread interrupt
2019-08-25T13:13:29Z Shutdown: done


Title: Re: Error message "Error opening block database"
Post by: jackg on August 25, 2019, 01:22:43 PM
Yeah you still have to reindex but it means the error shouldn't show up again as you have to manually get rid of the problem and then reload the database...


Title: Re: Error message "Error opening block database"
Post by: Lauda on August 25, 2019, 02:52:54 PM
If it happens frequently, it is usually a hardware issue.


Title: Re: Error message "Error opening block database"
Post by: Abdussamad on August 30, 2019, 03:35:29 AM
Yeah it means your hard drive is dying.


Title: Re: Error message "Error opening block database"
Post by: Lauda on August 30, 2019, 06:01:53 PM
Yeah it means your hard drive is dying.
OP mention "I got a new hard drive", so i doubt this case unless OP still uses his old HDD or got defect product (which is very unlikely)
In this context that can mean a replacement drive, which could be second hand one. A defect product is also not "very unlikely". HDDs aren't as reliable as they should be. Additionally, this doesn't mention whether it is an internal or external drive. In the case of the later, the issue is likely the connector.