For some reason wallet.(timestamp).bak file which was created after user messed with wallet.dat file name WHILE Bitcoin Core was running is missing, any traces of file are gone. It is actualy more complicated so please check the thread at https://bitcointalk.org/index.php?topic=1389123.0 and follow procedure at https://bitcointalk.org/index.php?topic=1389123.msg14114474#msg14114474 to replicate the issue.
Unexpected handling of wallet.(timestamp).bak file #7647
issue subSTRATA opened this issue on March 6, 2016-
subSTRATA commented at 2:02 PM on March 6, 2016: none
- jonasschnelli added the label Wallet on Mar 6, 2016
-
MarcoFalke commented at 3:23 PM on March 6, 2016: member
I can't reproduce...
Indeed, moving the wallet file to another destination while Bitcoin Core is running will cause
2016-03-06 15:07:22 Shutdown: In progress... 2016-03-06 15:07:22 StopNode() 2016-03-06 15:07:22 *** System error while flushing: CDB: Error 2, can't open database 2016-03-06 15:07:27 CDBEnv::EnvShutdown: Error 2 shutting down database environment: No such file or directory 2016-03-06 15:07:27 Shutdown: donein the debug log on shutdown. Though, I fail to see how someone could lose the wallet file by this: The wallet file should still be at the location you moved it to. (Even though it might be slightly corrupt)
-
MarcoFalke commented at 3:24 PM on March 6, 2016: member
@subSTRATA Please provide exact steps to reproduce, preferably from the command line. Something like
>bitcoin-qt.exe -regtest -datadir=New_folder >move "New_folder\regtest\wallet.dat" New_folder\regtest\wallet.dat_bak 1 file(s) moved. -
subSTRATA commented at 3:28 PM on March 6, 2016: none
Read https://bitcointalk.org/index.php?topic=1389123.msg14114474#msg14114474 very carefuly, it is not about moving wallet.dat file while Bitcoin Core is running.
-
subSTRATA commented at 3:55 PM on March 6, 2016: none
Issue occurs ONLY if wallet.dat file was created and renamed within the same session. If Bitcoin Core was restarted between creation of a new wallet.dat file and renaming of it then no problems occur, see step 2b. and consequently different outcome at step 5.
1. Shutdown Bitcoin Core then move existing wallet.dat to some other directory. 2. Start Bitcoin Core, it will create a new wallet.dat file. 2b. Restart Bitcoin Core. 3. While Bitcoin Core is running, rename newly created wallet.dat to whatever else. 4. Shutdown Bitcoin Core, it will throw an error and exit. 5. Rename file back to wallet.dat and start Bitcoin Core again, no problems whatsoever. -
MarcoFalke commented at 4:45 PM on March 6, 2016: member
I see; This is not reproducible always. Pretty much you rename a corrupt
wallet.(timestamp).bakfile towallet.datuntil you get a__db*file, which will be deleted on the next start. I could reproduce once but I forgot to save thewallet.(ts).bakfile. Would you mind uploading one? (Make sure it is for testnet/regnet or does not contain any relevant keys) -
subSTRATA commented at 4:58 PM on March 6, 2016: none
I can reproduce it always, just follow procedure exactly. Just in case it realy does not work for you every time, here is .bak file which Bitcoin Core just created, mainnet private keys but no worries, wallet was created just for this test.
https://mega.nz/#!yAZzSQbZ!mZK0q43dm1BIXvIQAx2ZiuCXZRk3_o9shiv2pTcTmrk
-
meshcollider commented at 6:43 PM on March 6, 2018: contributor
I've tried to reproduce this following the steps from the bitcointalk thread on 0.16 and using the downloadable wallet above, and cannot reproduce, so this can be closed
- fanquake closed this on Mar 6, 2018
- DrahtBot locked this on Sep 8, 2021