Author

Topic: can't open database wallet.dat (Read 2566 times)

hero member
Activity: 672
Merit: 504
a.k.a. gurnec on GitHub
August 05, 2014, 01:58:21 PM
#6
that's very helpful, thank you!
I installed Berkeley DB tools but when execute db_recover -c wallet.dat in the .bitcoin dir i get just
".bitcoin$ db_recover -c wallet.dat
usage: db_recover [-cefVv] [-h home] [-P password] [-t [[CC]YY]MMDDhhmm[.SS]]"


also when i run bitcoind, it finds the corrupt wallet and attemps salvagint automatically. It actually reports it salvaged the data (and just copied a back-up of the original file before the salvaging as .bak file)
but then when i start it again with the supposedly salvaged wallet it says "Wallet corrupted"

so, the bitcoin salvaging doesn't seem to work for me, hopefully the db tool will do the trick as soon as i can get it to work Smiley

My mistake, do not include the wallet file name, I should have said run "db_recover -cv" from inside the .bitcoin directory and it will attempt to do a recovery of all wallets in the directory. On second thought though, I don't think this will help. I think it only helps if there are BerkeleyDB .log files still present, and Bitcoin removes all BerkeleyDB logs before exiting, so this command probably won't do anything (but it doesn't hurt).

I'd try the db_dump/db_load process instead, starting with the original wallet file (not the one which Bitcoin created in its attempt to do a salvage). If that still doesn't work, then it's on to pywallet...
sr. member
Activity: 896
Merit: 302
August 05, 2014, 01:35:26 PM
#5
error: {"code":-1,"message":"CDB : Error -30974, can't open database wallet.dat"}

This error is DB_RUNRECOVERY.

Assuming a simple restart doesn't fix it, there are two things I'd try.

If you're on Linux, you probably have easy access to the Berkeley DB tools. On Debian/Ubuntu, they can be installed with "sudo apt-get install db-util". After closing bitcoind and making a backup of the wallet.dat file, try running "db_recover -c wallet.dat" from inside the .bitcoin directory. If that succeeds, you're probably all set.

If you're not on Linux, or if the above doesn't succeed, try running "bitcoind -salvagewallet" (Bitcoin will make a backup on its own before trying to run the salvage routine).

If this also doesn't work and you're on Linux, look over here for another option.

If you're still having problems, pywallet is probably your next option, however it's got its own problems (that I mention in the post above).

Good luck!

that's very helpful, thank you!
I installed Berkeley DB tools but when execute db_recover -c wallet.dat in the .bitcoin dir i get just
".bitcoin$ db_recover -c wallet.dat
usage: db_recover [-cefVv] [-h home] [-P password] [-t [[CC]YY]MMDDhhmm[.SS]]"



also when i run bitcoind, it finds the corrupt wallet and attemps salvagint automatically. It actually reports it salvaged the data (and just copied a back-up of the original file before the salvaging as .bak file)
but then when i start it again with the supposedly salvaged wallet it says "Wallet corrupted"

so, the bitcoin salvaging doesn't seem to work for me, hopefully the db tool will do the trick as soon as i can get it to work Smiley
sr. member
Activity: 896
Merit: 302
July 22, 2014, 07:54:19 AM
#4
Try calling `bitcoind walletpassphrase ` (from the wiki) before API calls that involve the wallet.

yes that's necessary when you want to spend or create new address, but for just starting, getinfo and getbalance, should not be needed, right?
hero member
Activity: 672
Merit: 504
a.k.a. gurnec on GitHub
July 21, 2014, 02:15:38 PM
#3
error: {"code":-1,"message":"CDB : Error -30974, can't open database wallet.dat"}

This error is DB_RUNRECOVERY.

Assuming a simple restart doesn't fix it, there are two things I'd try.

If you're on Linux, you probably have easy access to the Berkeley DB tools. On Debian/Ubuntu, they can be installed with "sudo apt-get install db-util". After closing bitcoind and making a backup of the wallet.dat file, try running "db_recover -c wallet.dat" from inside the .bitcoin directory. If that succeeds, you're probably all set.

If you're not on Linux, or if the above doesn't succeed, try running "bitcoind -salvagewallet" (Bitcoin will make a backup on its own before trying to run the salvage routine).

If this also doesn't work and you're on Linux, look over here for another option.

If you're still having problems, pywallet is probably your next option, however it's got its own problems (that I mention in the post above).

Good luck!
hero member
Activity: 508
Merit: 500
Techwolf on #bitcoin and Reddit
July 21, 2014, 01:47:54 PM
#2
Try calling `bitcoind walletpassphrase ` (from the wiki) before API calls that involve the wallet.
sr. member
Activity: 896
Merit: 302
July 21, 2014, 10:18:13 AM
#1
ok i get this now when trying to run bitcoind getinfo for example
error: {"code":-1,"message":"CDB : Error -30974, can't open database wallet.dat"}

the wallet was encrypted, i have the pass, there is some small amount in there, how would one approach it from here?


Jump to: