Bitcoin Forum
November 06, 2024, 12:51:22 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 »  All
  Print  
Author Topic: Bitcoin Core 0.21 - error opening block database  (Read 289 times)
Raini1110 (OP)
Newbie
*
Offline Offline

Activity: 24
Merit: 5


View Profile
November 27, 2021, 11:27:30 AM
Merited by LoyceV (4), ABCbits (1)
 #1

Hello.

I had a power outage while I was syncing my Bitcoin Coren Wallet.
Now I get the error " error opening block database".
How can I fix this error?

I have all the data and wallet backup at hand.

Maybe someone can help me in German language?

Thanks.
o_solo_miner
Legendary
*
Offline Offline

Activity: 2486
Merit: 1484


-> morgen, ist heute, schon gestern <-


View Profile
November 27, 2021, 11:41:15 AM
 #2

Well, it would be best to go to the german section then:
https://bitcointalk.org/index.php?board=16.0

Dort kannst du auch in Deutsch schreiben.

from the creator of CGMiner http://solo.ckpool.org for Solominers
paused: passthrough for solo.ckpool.org => stratum+tcp://rfpool.org:3334
Raini1110 (OP)
Newbie
*
Offline Offline

Activity: 24
Merit: 5


View Profile
November 27, 2021, 04:19:19 PM
 #3

Well, it would be best to go to the german section then:
https://bitcointalk.org/index.php?board=16.0

Dort kannst du auch in Deutsch schreiben.

Thank you very much. Can you maybe answer my question too?
o_solo_miner
Legendary
*
Offline Offline

Activity: 2486
Merit: 1484


-> morgen, ist heute, schon gestern <-


View Profile
November 27, 2021, 05:08:48 PM
Last edit: November 27, 2021, 06:16:40 PM by o_solo_miner
Merited by ABCbits (1), nc50lc (1)
 #4

I try, even you missed to tell us the OS you are using (Windows/Linux/Apple).
If you start bitcoind with the option --reindex, it will reload the relevant parts missing.

*Edit: corrected the switch name

from the creator of CGMiner http://solo.ckpool.org for Solominers
paused: passthrough for solo.ckpool.org => stratum+tcp://rfpool.org:3334
Raini1110 (OP)
Newbie
*
Offline Offline

Activity: 24
Merit: 5


View Profile
November 27, 2021, 08:42:39 PM
 #5

I try, even you missed to tell us the OS you are using (Windows/Linux/Apple).
If you start bitcoind with the option --reindex, it will reload the relevant parts missing.

*Edit: corrected the switch name

I use Windows 7.
Ok, Bitcoind I ran and download everything. Can I run Bitcoin Core normally again or is there anything else I need to be aware of?
Thanks
nc50lc
Legendary
*
Offline Offline

Activity: 2590
Merit: 6332


Self-proclaimed Genius


View Profile
November 28, 2021, 06:43:32 AM
Merited by ABCbits (1)
 #6

Ok, Bitcoind I ran and download everything. Can I run Bitcoin Core normally again or is there anything else I need to be aware of?
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.

If there's no error and you've reached the tip of the blockchain, then it's good.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Raini1110 (OP)
Newbie
*
Offline Offline

Activity: 24
Merit: 5


View Profile
November 28, 2021, 01:49:07 PM
 #7

Ok, Bitcoind I ran and download everything. Can I run Bitcoin Core normally again or is there anything else I need to be aware of?
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.

If there's no error and you've reached the tip of the blockchain, then it's good.

Thank you. I see errors in the debug.

May I show this last section here? I do not know what to do.

Can I delete files until the last sync?
Can I save the blockchain and restart it in case of a PC crash?

MFG
Raimund
nc50lc
Legendary
*
Offline Offline

Activity: 2590
Merit: 6332


Self-proclaimed Genius


View Profile
November 28, 2021, 02:26:26 PM
 #8

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.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Raini1110 (OP)
Newbie
*
Offline Offline

Activity: 24
Merit: 5


View Profile
November 28, 2021, 04:39:28 PM
 #9

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
o_solo_miner
Legendary
*
Offline Offline

Activity: 2486
Merit: 1484


-> morgen, ist heute, schon gestern <-


View Profile
November 28, 2021, 05:09:36 PM
 #10

As I can see the fault now:

Code:
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.

the best way will be starting bitcoin-qt from the cmd with the suggested -reindex

So you need to press [Start] and in the [Eingabeaufforderung] you type cmd to get a console
there you cd into your folder where bitcoin-qt is located
now you type: bitcoin-qt.exe -reindex and press enter

from the creator of CGMiner http://solo.ckpool.org for Solominers
paused: passthrough for solo.ckpool.org => stratum+tcp://rfpool.org:3334
Raini1110 (OP)
Newbie
*
Offline Offline

Activity: 24
Merit: 5


View Profile
November 28, 2021, 08:16:57 PM
 #11

As I can see the fault now:

Code:
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.

the best way will be starting bitcoin-qt from the cmd with the suggested -reindex

So you need to press [Start] and in the [Eingabeaufforderung] you type cmd to get a console
there you cd into your folder where bitcoin-qt is located
now you type: bitcoin-qt.exe -reindex and press enter


I do not understand how to enter correctly.

CMD is ok.
See now
C:\Users\Raini\

My bitcoin-pt.exe
is located at
C:\Program Files\Bitcoin\bitcoin-pt.exe

How do I enter the data?

My data is stored externally on a memory E:\Bitcoin
vv181
Legendary
*
Offline Offline

Activity: 1932
Merit: 1273


View Profile
November 28, 2021, 08:36:54 PM
 #12

You can use datadir=<dir>

With that, the command should look like:
Code:
bitcoin-qt.exe -datadir=E:\Bitcoin -reindex
Raini1110 (OP)
Newbie
*
Offline Offline

Activity: 24
Merit: 5


View Profile
November 28, 2021, 10:29:41 PM
 #13

You can use datadir=<dir>

With that, the command should look like:
Code:
bitcoin-qt.exe -datadir=E:\Bitcoin -reindex

Thank you, does not work.
This command does not work for me.

C:\Users\Raini>bitcoin-qt.exe -dir=E:\Bitcoin -reindex
The command "bitcoin-qt.exe" is either misspelled or
could not be found.

C:\Users\Raini>bitcoin-qt.exe -datadir=E:\Bitcoin -reindex
The command "bitcoin-qt.exe" is either misspelled or
could not be found.
nc50lc
Legendary
*
Offline Offline

Activity: 2590
Merit: 6332


Self-proclaimed Genius


View Profile
November 29, 2021, 01:58:53 AM
 #14

-snip-
C:\Users\Raini>bitcoin-qt.exe -dir=E:\Bitcoin -reindex
You should start cmd in the directory where bitcoin-qt is located or change the working directory using "cd" command.
eg.:
Code:
cd C:\Program Files\Bitcoin
Then enter the command vv181 instructed you to use.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Raini1110 (OP)
Newbie
*
Offline Offline

Activity: 24
Merit: 5


View Profile
November 29, 2021, 02:26:14 PM
 #15

-snip-
C:\Users\Raini>bitcoin-qt.exe -dir=E:\Bitcoin -reindex
You should start cmd in the directory where bitcoin-qt is located or change the working directory using "cd" command.
eg.:
Code:
cd C:\Program Files\Bitcoin
Then enter the command vv181 instructed you to use.

Ok, Bitcoin Core is open and doing Reindex. nothing to see.
What is that? vv181
Does not work for me in cmd

Thanks a lot.
vv181
Legendary
*
Offline Offline

Activity: 1932
Merit: 1273


View Profile
November 29, 2021, 03:18:31 PM
 #16

Ok, Bitcoin Core is open and doing Reindex. nothing to see.
What is that? vv181
Does not work for me in cmd

Thanks a lot.
Yeah, there is nothing to show in cmd. The command you entered on cmd is meant to open up Bitcoin Core (bitcoin-qt) with some additional configuration.

The -datadir=<dir> is a config to specify the data location of your Bitcoin Core, and what the -reindex did is to rebuild your block index and chain state(or to simplify it, it rebuild the blockchain).

As why the problem arises, it is likely caused by the power outage when you are still syncing. So the PC got unclean shutdown, and the data got corrupted because of it. You can see that in the debug.log you posted:
Code:
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 : Error opening block database.
Please restart with -reindex or -reindex-chainstate to recover.

So, if your Bitcoin Core is opening up and it reindexing, it should be good to go. It will rebuild the blockchain and will continue to sync it.

On a side note, how much RAM do you have available? If you have a pretty much available ram you might want to bump up the dbcache, it will speed up your syncing process.
Raini1110 (OP)
Newbie
*
Offline Offline

Activity: 24
Merit: 5


View Profile
November 29, 2021, 04:54:48 PM
 #17

Ok, Bitcoin Core is open and doing Reindex. nothing to see.
What is that? vv181
Does not work for me in cmd

Thanks a lot.
Yeah, there is nothing to show in cmd. The command you entered on cmd is meant to open up Bitcoin Core (bitcoin-qt) with some additional configuration.

The -datadir=<dir> is a config to specify the data location of your Bitcoin Core, and what the -reindex did is to rebuild your block index and chain state(or to simplify it, it rebuild the blockchain).

As why the problem arises, it is likely caused by the power outage when you are still syncing. So the PC got unclean shutdown, and the data got corrupted because of it. You can see that in the debug.log you posted:
Code:
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 : Error opening block database.
Please restart with -reindex or -reindex-chainstate to recover.

So, if your Bitcoin Core is opening up and it reindexing, it should be good to go. It will rebuild the blockchain and will continue to sync it.

On a side note, how much RAM do you have available? If you have a pretty much available ram you might want to bump up the dbcache, it will speed up your syncing process.

It works, thank you. Wink
Synchronization has now been recorded. Still 9 years behind. The synchronization will take 3 days. How do I increase the dbcach?
I have 8 GB of RAM.
nc50lc
Legendary
*
Offline Offline

Activity: 2590
Merit: 6332


Self-proclaimed Genius


View Profile
November 30, 2021, 03:28:47 AM
 #18

-snip- The synchronization will take 3 days. How do I increase the dbcach?
I have 8 GB of RAM.
You can set it in bitcoin-qt's setting or in the config file.
Since you're using QT: Open the menu "Settings->Options...", then put a reasonable value in "Size of database cache".
More or less half of your RAM, depending on the usage.

That requires you to restart Bitcoin core as the red message below the setting will say.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Raini1110 (OP)
Newbie
*
Offline Offline

Activity: 24
Merit: 5


View Profile
December 09, 2021, 10:09:21 AM
 #19

-snip- The synchronization will take 3 days. How do I increase the dbcach?
I have 8 GB of RAM.
You can set it in bitcoin-qt's setting or in the config file.
Since you're using QT: Open the menu "Settings->Options...", then put a reasonable value in "Size of database cache".
More or less half of your RAM, depending on the usage.

That requires you to restart Bitcoin core as the red message below the setting will say.

Hello,
it all worked well and arrived in 2021 with synchronization. Now I had a power failure again and wanted to synchronize with
C:\Users\Raini>bitcoin-qt.exe -dir=E:\Bitcoin -reindex
to start again.

Error: C:\Users\Raini>bitcoin-qt.exe is not a reliable application. 

I have reinstalled the BitcoinQT, the error remains the same.
What can I do?
nc50lc
Legendary
*
Offline Offline

Activity: 2590
Merit: 6332


Self-proclaimed Genius


View Profile
December 09, 2021, 10:55:59 AM
 #20

-snip-
Error: C:\Users\Raini>bitcoin-qt.exe is not a reliable application.  
I think you just forgot to point command prompt to the correct directory before executing the command.
cmd should be working in "C:\Program Files\Bitcoin" if you're using the default installation directory.

You should start cmd in the directory where bitcoin-qt is located or change the working directory using "cd" command.
eg.:
Code:
cd C:\Program Files\Bitcoin
Then enter the command vv181 instructed you to use.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Pages: [1] 2 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!