Unclear error when starting Bitcoin Core (bug) #7249

issue GSPP openend this issue on December 23, 2015
  1. GSPP commented at 2:51 pm on December 23, 2015: none

    I just received this error message when starting Bitcoin Core:

    drhytrjsrtj

    I think the bad error is a bug already so I want to report it.

    How can I help diagnose this issue? Here’s the tail of the debug.log:

    2015-12-23 14:44:15 Bitcoin version v0.11.2 (2015-11-10 14:46:18 +0100) 2015-12-23 14:44:15 Using OpenSSL version OpenSSL 1.0.1k 8 Jan 2015 2015-12-23 14:44:15 Using BerkeleyDB version Berkeley DB 4.8.30: (April 9, 2010) 2015-12-23 14:44:15 Default data directory C:\Users\x\AppData\Roaming\Bitcoin 2015-12-23 14:44:15 Using data directory C:\Users\x\AppData\Roaming\Bitcoin 2015-12-23 14:44:15 Using config file C:\Users\x\AppData\Roaming\Bitcoin\bitcoin.conf 2015-12-23 14:44:15 Using at most 125 connections (2048 file descriptors available) 2015-12-23 14:44:15 Using 4 threads for script verification 2015-12-23 14:44:16 Using wallet wallet.dat 2015-12-23 14:44:16 scheduler thread start 2015-12-23 14:44:16 init message: Verifying wallet… 2015-12-23 14:44:16 CDBEnv::Open: LogDir=C:\Users\x\AppData\Roaming\Bitcoin\database ErrorFile=C:\Users\x\AppData\Roaming\Bitcoin\db.log 2015-12-23 14:44:16 Failed to rename wallet.dat to wallet.1450881856.bak

    A procmon.exe trace does not show any path with “bak” in it. It’s like Bitcoin Core did not even access the file system when this error occurred.

  2. GSPP commented at 2:56 pm on December 23, 2015: none
    This is Windows 10 x64. Running as Administrator does not help.
  3. jonasschnelli commented at 4:14 pm on December 23, 2015: contributor
    Can you retest with the current master (compile or use a nightly build:https://bitcoin.jonasschnelli.ch/nightlybuilds/)?
  4. MarcoFalke commented at 4:45 pm on December 23, 2015: member
    Are you trying to do a -salvagewallet? Otherwise, it appears your wallet.dat may be corrupted. Do you have backups?
  5. MarcoFalke commented at 4:45 pm on December 23, 2015: member
    In any case, the error message should not be empty.
  6. MarcoFalke commented at 5:58 pm on December 23, 2015: member
    Seems this is just a duplicate of #7247 but if this is happening in 0.11.2 it is a bug that should be fixed…
  7. GSPP commented at 6:17 pm on December 23, 2015: none

    I was not trying to salvage a wallet but it turns out the wallet file is all zeroes.

    Looks like the following issues are present:

    1. The message is not there
    2. Nothing useful happens in case of a corrupted wallet. Probably this should be reported and the user asked to create a new one
    3. The log has a misleading/false message (“Failed to rename wallet.dat to wallet.1450881856.bak”). Or, was this supposed to be done and failed? That also would be a bug.

    And maybe wallet salvage can detect an all-zeroes wallet and report that nothing can be done.

  8. tulip0 commented at 5:53 am on December 24, 2015: none

    morespecific

    Null wallet in master is fine, that should be fixed in 0.12 releases.

    How did you end up with a zeroed file? That seems pretty unusual.

  9. GSPP commented at 11:02 am on December 24, 2015: none
    Not sure. It was not important, though.
  10. ghost commented at 7:15 am on December 25, 2015: none

    Not sure. It was not important, though.

    It would be good if you could identify how it happened, maybe some prevention code could be added.

  11. MarcoFalke commented at 10:59 am on December 25, 2015: member

    It would be good if you could identify how it happened

    This happens every time you load a corrupt wallet with 0.11.2.

  12. ghost commented at 4:54 pm on December 25, 2015: none

    This happens every time you load a corrupt wallet with 0.11.2.

    That’s a good info too, but i mean how the wallet got corrupted?

  13. GSPP commented at 6:17 pm on December 25, 2015: none
    I have no theory how that happened at the moment but I’ll let you know.
  14. laanwj added the label Wallet on Jan 5, 2016
  15. GSPP commented at 6:24 pm on January 22, 2016: none

    A theory for how this could have happened: Maybe the wallet file was not flushed to disk and the VM that I ran this in was not cleanly shut down.

    How is the wallet file written? If it is overwritten no guarantees can be made in case of power loss. This might result in a Frankenstein wallet with mixed data from the old and the new version of the file. Also, with NTFS and without WRITE_THROUGH writing a zeroes file might easily result.

  16. laanwj commented at 11:58 am on February 16, 2016: member

    Null wallet in master is fine, that should be fixed in 0.12 releases.

    Great. Closing, then.

    How is the wallet file written? If it is overwritten no guarantees can be made in case of power loss.

    There is the ThreadFlushWalletDB which periodically pokes BerkeleyDB to compact its write log into wallet.dat. If this gets interrupted at the wrong time it may result in a broken intermediate state.

    Cannot say this enough: Always make backups of your wallet!

  17. laanwj closed this on Feb 16, 2016

  18. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-21 15:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me