Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recover / restore database after lost power? #89

Closed
eblackstone opened this issue Nov 27, 2018 · 3 comments
Closed

Recover / restore database after lost power? #89

eblackstone opened this issue Nov 27, 2018 · 3 comments

Comments

@eblackstone
Copy link

The computer syncing blockbook to the bitcoin blockchain briefly lost power. I now get the following error message when starting blockbook:

I1127 07:33:36.032267    1075 rocksdb.go:88] rocksdb: opening /opt/coins/data/bitcoin/blockbook/db, required data version 3, cache size 1073741824, max open files 16384
E1127 07:33:36.235710    1075 blockbook.go:184] internalState: database is in inconsistent state and cannot be used
I1127 07:33:36.235752    1075 rocksdb.go:118] rocksdb: close

Is there any way to recover or restore the database? What is the best way to move forward? Thanks!

@martinboehm
Copy link
Contributor

This is by design, you will have to delete the database folder and start again.

By default, Blockbook performs the initial import in bulk import mode, which for performance reasons does not store all the data immediately to the database. The database is therefore in an inconsistent state and does not survive hard reset of the server.

If you are in an environment, where power outages may be frequent, you can run Blockbook with parameter -workers=1, which disables the bulk import mode. As a consequence, the initial import is about twice as slow but the DB should be consistent even in the case of hard reset and also the memory requirements are a lot lower.

@eblackstone
Copy link
Author

Understood, thanks for your quick response

@ParampreetKaurAnand
Copy link

This is by design, you will have to delete the database folder and start again.

By default, Blockbook performs the initial import in bulk import mode, which for performance reasons does not store all the data immediately to the database. The database is therefore in an inconsistent state and does not survive hard reset of the server.

If you are in an environment, where power outages may be frequent, you can run Blockbook with parameter -workers=1, which disables the bulk import mode. As a consequence, the initial import is about twice as slow but the DB should be consistent even in the case of hard reset and also the memory requirements are a lot lower.

How much time does btc blockbook take to sync?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@martinboehm @eblackstone @ParampreetKaurAnand and others