Post
Topic
Board Bitcoin Technical Support
Re: Bitcoin Core 0.21 - error opening block database
by
Raini1110
on 28/11/2021, 16:39:28 UTC
If the error persist after reaching the height where you've encountered the error, your blockchain may have been corrupted by the sudden shutdown.
If so, you can open your "debug.log" file from bitcoin data directory (default location) to check for errors related to the corrupted block or for possible other issues.
Thank you. I see errors in the debug.

May I show this last section here? I do not know what to do.
The error may be logged before you opened bitcoind with reindex, have you experienced the same error after -reindex?
Yes you can, there's nothing in the debug log that can compromise your private keys, only some privacy-related info.

Quote from: Raini1110
Can I delete files until the last sync?
Can I save the blockchain and restart it in case of a PC crash?
  • (CMIIAW) I think you can delete the last block file and Bitcoin Core will detect it and issue -reindex then it will sync starting from the last valid block.
    However, if your blockchain is pruned, it will sync from start if you do that.
  • Yes, but not just the blockchain, if you're going to back it up, you may as well backup the whole data directory.

Ok I will try.

Here is the last section of Debug.


2021-11-27T22:36:46Z Bitcoin Core version v22.0.0 (release build)
2021-11-27T22:36:46Z Qt 5.12.11 (static), plugin=windows (static)
2021-11-27T22:36:46Z Static plugins:
2021-11-27T22:36:46Z  QWindowsIntegrationPlugin, version 330752
2021-11-27T22:36:46Z  QWindowsVistaStylePlugin, version 330752
2021-11-27T22:36:46Z Style: windowsvista / QWindowsVistaStyle
2021-11-27T22:36:46Z System: Windows 7 SP 1 (6.1), x86_64-little_endian-llp64
2021-11-27T22:36:46Z Screen: \\.\DISPLAY1 1280x800, pixel ratio=1.0
2021-11-27T22:36:52Z Assuming ancestors of block 00000000000000000008a89e854d57e5667df88f1cdef6fde2fbca1de5b639ad have valid signatures.
2021-11-27T22:36:52Z Setting nMinimumChainWork=00000000000000000000000000000000000000001fa4663bbbe19f82de910280
2021-11-27T22:36:52Z Using the 'sse4(1way),sse41(4way)' SHA256 implementation
2021-11-27T22:36:52Z GUI: "registerShutdownBlockReason: Successfully registered: Bitcoin Core noch nicht sicher beendet…"
2021-11-27T22:36:52Z Default data directory C:\Users\Raini\AppData\Roaming\Bitcoin
2021-11-27T22:36:52Z Using data directory E:\Bitcoin
2021-11-27T22:36:52Z Config file: E:\Bitcoin\bitcoin.conf
2021-11-27T22:36:52Z Using at most 125 automatic connections (2048 file descriptors available)
2021-11-27T22:36:52Z Using 16 MiB out of 32/2 requested for signature cache, able to store 524288 elements
2021-11-27T22:36:52Z Using 16 MiB out of 32/2 requested for script execution cache, able to store 524288 elements
2021-11-27T22:36:52Z Script verification uses 1 additional threads
2021-11-27T22:36:52Z scheduler thread start
2021-11-27T22:36:52Z Using wallet directory E:\Bitcoin
2021-11-27T22:36:52Z init message: Überprüfe Wallet(s)...
2021-11-27T22:36:52Z Using BerkeleyDB version Berkeley DB 4.8.30: (April  9, 2010)
2021-11-27T22:36:52Z Using wallet E:\Bitcoin\wallet.dat
2021-11-27T22:36:52Z BerkeleyEnvironment::Open: LogDir=E:\Bitcoin\database ErrorFile=E:\Bitcoin\db.log
2021-11-27T22:36:53Z init message: Lade Bannliste…
2021-11-27T22:36:53Z SetNetworkActive: true
2021-11-27T22:36:53Z Using /16 prefix for IP bucketing
2021-11-27T22:36:53Z Cache configuration:
2021-11-27T22:36:53Z * Using 2.0 MiB for block index database
2021-11-27T22:36:53Z * Using 8.0 MiB for chain state database
2021-11-27T22:36:53Z * Using 440.0 MiB for in-memory UTXO set (plus up to 286.1 MiB of unused mempool space)
2021-11-27T22:36:53Z init message: Lade Block-Index...
2021-11-27T22:36:53Z Switching active chainstate to Chainstate [ibd] @ height -1 (null)
2021-11-27T22:36:53Z Opening LevelDB in E:\Bitcoin\blocks\index
2021-11-27T22:36:53Z Fatal LevelDB error: Corruption: 41 missing files; e.g.: E:\Bitcoin\blocks\index/000313.ldb
2021-11-27T22:36:53Z You can use -debug=leveldb to get more complete diagnostic messages
2021-11-27T22:36:53Z Fatal LevelDB error: Corruption: 41 missing files; e.g.: E:\Bitcoin\blocks\index/000313.ldb
2021-11-27T22:36:53Z : Error opening block database.
Please restart with -reindex or -reindex-chainstate to recover.
2021-11-27T22:36:55Z init message: Lade Block-Index...
2021-11-27T22:36:55Z should not be overwriting a chainstate
2021-11-27T22:36:55Z Error: Error opening block database
2021-11-27T22:36:56Z Shutdown: In progress...
2021-11-27T22:36:56Z scheduler thread exit
2021-11-27T22:36:56Z Shutdown: done