blkindex.dat Fails to Load...Bitcoin 0.6.3 Program Aborts #1759

issue bondbeau opened this issue on August 30, 2012
  1. bondbeau commented at 8:18 PM on August 30, 2012: none

    Running Windows 7 64-Bit Ultimate.

    1. Installation went fine.
    2. Block chain was close to completing initial download.
    3. Forced to restart machine due to another program.
    4. Subsequent attempts to run Bitcoin result in it failing at loading the blkindex.dat file.
    5. Uninstalling/Reinstalling with either Windows or Bitcoin's uninstaller does not fix the issue.

    First time user...not exactly made confident by this initial exposure/failure.

    Not sure this is technically a bug, but it surely cannot be a feature.

    Please assist...and thank you,

    BB

  2. Diapolo commented at 9:37 PM on August 30, 2012: none

    @bondbeau 0.6.3 doesn't like it, when the process just get's killed, 0.7 should be more sane as we did some shutdown-code-tweaking there. Could be, that your database was damaged and if you never used the client and have no funds in your wallet it would be easiest to just empty your whole Bitcoin data directory.

    ONLY delete it, if there are NO coins or needed addresses in your wallet!

  3. bondbeau commented at 11:36 PM on August 30, 2012: none

    @Diapolo Thanks for your reply, but I have to say I'm quite shocked that Bitcoin is being proffered as a refined money replacement for world-wide use if something as simple as an unplanned shutdown brings it to its knees.

    Since I really don't want to be a tester and therefore only want to run 'released' versions...please explain step-by-step exactly how one can repair this situation. I do actually have a tiny amount of coin in the wallet which I would be just as happy to keep as to lose (as I suspect would be the case for most users regardless of circumstance), so exactly which files in which directories need to be deleted or fixed or whatever...it that is the correct solution? For example, I don't see a "data" directory for Bitcoin. I see "daemon" and "src"...

    Please understand that I am simply an end-user...just like most any other person in-the-wild who might like to see what this is about...and thanks for your help.

  4. luke-jr commented at 11:40 PM on August 30, 2012: member

    If you want, you could try 0.6.4rc1, which only has bugfixes. I don't know if that will help with this particular issue, however.

    Most unplanned shutdowns don't cause problems for me...

  5. sipa commented at 11:47 PM on August 30, 2012: member

    @luke-jr I doubt that'd make any difference @bondbeau I assume the shutdown caused Bitcoin to be terminated prematurely, and the database got corrupted. Little we can do about that while using BDB (the database engine) I'm afraid, but it is embarrassing to be frank. BDB should deal with such events, but since it didn't, I fear there's little you can do but delete blkindex.dat, blk0001.dat, and if it exists blk0002.dat. They can be found in the data directory (see https://en.bitcoin.it/wiki/Data_directory). After that, start Bitcoin again, and it should redownload the blockchain.

  6. bondbeau commented at 12:07 AM on August 31, 2012: none

    @luke-jr Thanks, but the the file for the .exe didn't want to download after I reloaded the page...(I hesitated and cancelled it the first time because Avast said something like "hey...do you really want to download this file that almost nobody around the world has ever downloaded"). Hope you understand... @sipa Bitcoin is running again and downloading the block chain according to your suggestion...so thank you very kindly. I'll play around with it a bit, but given this first-time experience I can't imagine trying to rely on Bitcoin as a way to actually live and make routine transactions. It's desperately...D-E-S-P-E-R-A-T-E-L-Y...needed...but it simply can't fly like this in my opinion...it just can't gain widespread use.

    Really...thinking about it just now, wouldn't it have to be essentially foolproof for children as young as four or five...or whatever age it is that kids commonly start to handle small amounts of paper and coin money?

    Much appreciation for the concept though...cheers and well wishes!

  7. luke-jr commented at 12:18 AM on August 31, 2012: member

    @bondbeau np, like @sipa said, it probably isn't fixed anyway. On a side note, you might consider another antivirus suite: Avast seems fairly hostile to Bitcoin so far.

    Keep in mind that neither this client, nor any other today, is considered production-ready. For better or worse, the market is ahead of the software in this area.

  8. Diapolo commented at 5:29 AM on August 31, 2012: none

    @bondbeau These problems are why we still call our Bitcoin client experimental software. The people who are participating here do this mostyl in their freetime and they do a pretty good job. A switch to a "better" or more stable database system is in the works and every day brings fixes to the client. We simply need users, like you, who will report problems here, so thanks for that :).

  9. gavinandresen commented at 11:31 PM on September 18, 2012: contributor

    We need to do a much better job of recovering from bdb errors.

    I created a little tool that randomly changes bytes in files, and am working on auto-recovery (as much as possible) for corrupt wallet.dats. When I'm happy with that, I plan on moving on to peers.dat and maybe blkindex.dat (although we're likely to switch to LevelDB before I get there).

  10. gmaxwell commented at 3:32 AM on September 19, 2012: contributor

    @gavinandresen that just means you get to do it to leveldb too. :P

  11. laanwj commented at 7:04 AM on September 19, 2012: member

    To be fair, if we set up good exception handling for broken databases that will come in just as handy with leveldb.

    At least in bitcoin-qt there should really be a pop-up "The block chain database is corrupted. Exit, or try to recover/redownload?". Instead of some vague "runaway exception" error and having the user come here or even mail us with "what to do now?"...

    Wallets are a completely different issue of course, as the data is usually not so readily available, and trying to recover automatically can be disastrous.

  12. bondbeau commented at 1:23 PM on September 19, 2012: none

    The next chapter in this story after @sipa's suggestion helped me get Bitcoin running again:

    1. After running it for a number of days (with only ordinary laptop sleep along the way) and letting it finish downloading the blockchain, I did a PLANNED shutdown. As in, I selected File > Exit and quit the program before restarting my machine.
    2. Bitcoin not having been high priority, I didn't try to start it again until yesterday...but guess what..it doesn't. In fact, the only option given in the Bitcoin directory of the start menu is to "Uninstall Bitcoin".
  13. bondbeau closed this on Sep 19, 2012

  14. bondbeau reopened this on Sep 19, 2012

  15. gavinandresen closed this on Jan 23, 2013

  16. owlhooter referenced this in commit 9e7cc56cb6 on Oct 10, 2018
  17. MarcoFalke 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: 2026-05-03 15:16 UTC

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