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

wallet.dat got corrupted #1694

Open
feeleep75 opened this issue Oct 28, 2016 · 6 comments
Open

wallet.dat got corrupted #1694

feeleep75 opened this issue Oct 28, 2016 · 6 comments
Labels
A-wallet Area: Wallet A-wallet-database Area: Wallet database and serialization database corruption I-error-handling Problems and improvements related to error handling M-potential-loss-of-funds This issue risks a potential loss of funds for a user. M-user-support User support issue

Comments

@feeleep75
Copy link

Hi,

I send ZEC from T to Z address and once received by Z address, daemon started to crashing and it was restarted by monitoring scripts. I took a backup then of wallet.dat but now I cannot recover in in any way. I tried -reindex and -salvagewallet but it does not help - I have only logs like this:

2016-10-28 20:44:42 CDBEnv::Salvage: Database salvage found errors, all data may not be recoverable. 2016-10-28 20:44:42 Salvage(aggressive) found no records in wallet.1477687482.bak. 2016-10-28 20:44:42 Shutdown: In progress...

I did an investigation with daira and we found following:

db.log:

BDB2506 file unknown has LSN 1/189046, past end of log at 1/1076
BDB2507 Commonly caused by moving a database from one database environment
BDB2508 to another without clearing the database LSNs, or by removing all of
BDB2509 the log files from a database environment
wallet.1477681161.bak: BDB0090 DB_VERIFY_BAD: Database verification failed
BDB1538 Program version 6.2 doesn't match environment version 5.3
BDB2506 file unknown has LSN 1/189046, past end of log at 1/1168
BDB2507 Commonly caused by moving a database from one database environment
BDB2508 to another without clearing the database LSNs, or by removing all of
BDB2509 the log files from a database environment
BDB0522 Page 0: metadata page corrupted
BDB0523 Page 0: could not check metadata page
wallet.dat: BDB0090 DB_VERIFY_BAD: Database verification failed
BDB2506 file unknown has LSN 1/189046, past end of log at 1/2216
BDB2507 Commonly caused by moving a database from one database environment
BDB2508 to another without clearing the database LSNs, or by removing all of
BDB2509 the log files from a database environment
wallet.1477687482.bak: BDB0090 DB_VERIFY_BAD: Database verification failed
BDB2506 file unknown has LSN 1/189046, past end of log at 1/2216
BDB2507 Commonly caused by moving a database from one database environment
BDB2508 to another without clearing the database LSNs, or by removing all of
BDB2509 the log files from a database environment
BDB2506 file unknown has LSN 1/189046, past end of log at 1/2216
BDB2507 Commonly caused by moving a database from one database environment
BDB2508 to another without clearing the database LSNs, or by removing all of
BDB2509 the log files from a database environment
BDB2506 file unknown has LSN 1/189046, past end of log at 1/2216
BDB2507 Commonly caused by moving a database from one database environment
BDB2508 to another without clearing the database LSNs, or by removing all of
BDB2509 the log files from a database environment
BDB2506 file unknown has LSN 1/189046, past end of log at 1/2308
BDB2507 Commonly caused by moving a database from one database environment
BDB2508 to another without clearing the database LSNs, or by removing all of
BDB2509 the log files from a database environment
BDB0522 Page 0: metadata page corrupted
BDB0523 Page 0: could not check metadata page
wallet.dat: BDB0090 DB_VERIFY_BAD: Database verification failed
BDB2506 file unknown has LSN 1/189046, past end of log at 1/3356
BDB2507 Commonly caused by moving a database from one database environment
BDB2508 to another without clearing the database LSNs, or by removing all of
BDB2509 the log files from a database environment
wallet.1477688722.bak: BDB0090 DB_VERIFY_BAD: Database verification failed

dpkg -l 'libdb*':

un  libdb4.6++-dev              <none>             <none>             (no description available)
un  libdb4.6-dev                <none>             <none>             (no description available)
un  libdb4.7++-dev              <none>             <none>             (no description available)
un  libdb4.7-dev                <none>             <none>             (no description available)
un  libdb4.8++-dev              <none>             <none>             (no description available)
un  libdb4.8-dev                <none>             <none>             (no description available)
ii  libdb5.1:amd64              5.1.29-7ubuntu1    amd64              Berkeley v5.1 Database Libraries [runtime]
ii  libdb5.1++:amd64            5.1.29-7ubuntu1    amd64              Berkeley v5.1 Database Libraries for C++ [runtime]
ii  libdb5.1++-dev              5.1.29-7ubuntu1    amd64              Berkeley v5.1 Database Libraries for C++ [development]
ii  libdb5.1-dev                5.1.29-7ubuntu1    amd64              Berkeley v5.1 Database Libraries [development]
ii  libdb5.3:amd64              5.3.28-3ubuntu3    amd64              Berkeley v5.3 Database Libraries [runtime]
ii  libdbus-1-3:amd64           1.6.18-0ubuntu4.3  amd64              simple interprocess messaging system (library)
ii  libdbus-glib-1-2:amd64      0.100.2-1          amd64              simple interprocess messaging system (GLib-based shared lib
@feeleep75
Copy link
Author

this may be a serious bug but I finally made recovery:

  1. compiled BDB version 6.2 and did a dump of wallet.dat
  2. on separate machine i installed db-util ver 5.3 and loaded the dump
  3. started daemon with -salvagewallet

@ebfull
Copy link
Contributor

ebfull commented Nov 19, 2016

If people are encountering these issues with t-addrs, it is probably a BDB bug?

@nathan-at-least nathan-at-least added the M-potential-loss-of-funds This issue risks a potential loss of funds for a user. label May 25, 2017
@nathan-at-least nathan-at-least removed this from the 1.0.[Soon] stabilization milestone May 25, 2017
@daira daira added this to Collect Information in User Support Jun 12, 2017
@daira daira moved this from Collect Information to Blocked in User Support Jun 20, 2017
@nathan-at-least nathan-at-least added this to Work Queue in Database Improvement Aug 14, 2017
@daira daira moved this from Work Queue to Blocked in Database Improvement Aug 14, 2017
@braddmiller braddmiller added the M-user-support User support issue label Apr 16, 2018
@blbradley
Copy link

I can confirm that this is still an issue (from using ZenCash). Except my log did not have this line:

BDB1538 Program version 6.2 doesn't match environment version 5.3

My wallet will not verify with 5.3 but will with 6.2.

$ db_verify wallet.dat
db_verify: BDB1009 wallet.dat: unsupported btree version: 10
db_verify: BDB0526 Page 0: unsupported DB version 10; extraneous errors may result
db_verify: BDB0547 Page 0: unsupported database version 10; extraneous errors may result
db_verify: BDB0547 Page 2: unsupported database version 10; extraneous errors may result
db_verify: wallet.dat: BDB0090 DB_VERIFY_BAD: Database verification failed
BDB5105 Verification of wallet.dat failed.
$ ~/lib/db-6.2.32/build_unix/db_verify wallet.dat
BDB5105 Verification of wallet.dat succeeded.

@rofllolomg
Copy link

This might seem silly, but would there be anywhere anyone could teach me how to do this to fix this problem? Have the same issue after trying to clear out the DB due to checksum mismatch, have this issue but afraid I'm terribly uninformed when it comes to this (i use Windows 10 and just made Debian VM)

@mms710 mms710 added this to Needs Prioritization in Arborist Team Jan 3, 2019
@mms710 mms710 added A-wallet-database Area: Wallet database and serialization and removed A-wallet-database Area: Wallet database and serialization labels Jan 17, 2019
@mms710 mms710 moved this from Needs Prioritization to Bugs/Security Issues/TechDebt Backlog in Arborist Team May 8, 2019
@zzzman20
Copy link

Hello, I am having this same issue too. How can I fix the corrupted wallet or extract the private keys from it? Unfortunately I'm not very familiar with linux. I did not have my private keys backed up.

@nuttycom
Copy link
Contributor

nuttycom commented Feb 3, 2023

We need to add documentation for how to perform recovery on corrupted wallets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-wallet Area: Wallet A-wallet-database Area: Wallet database and serialization database corruption I-error-handling Problems and improvements related to error handling M-potential-loss-of-funds This issue risks a potential loss of funds for a user. M-user-support User support issue
Projects
Arborist Team
  
Bugs/TechDebt Backlog
User Support
  
Blocked
Development

No branches or pull requests