Cannot create DB cursor -- inactive too long, too many blocks? #2395

issue ghost opened this issue on March 21, 2013
  1. ghost commented at 4:41 AM on March 21, 2013: none

    Hi all, I hadn't run my bitcoin client for ~2 years before I thought of doing it again. I downloaded the 0.8.0 client and ran it. It started wiuth >200k blocks remaining, then confirmed my coins with ~50k blocks remaining. Then somewhere around ~30k remaining it crashed with "cannot create FB cursor" error. I tried -rescan and -salvagewallet to no avail. I tried bringing it up, after crashing, then before it crashes again backing up the wallet and quitting, then restarting with the backup when it crashes. This got me to ~300 block remaining at one point, but never finished. Then the fork problem surfaced and I had to stop. After it was resolved I tried it again, but this time I never got beyond ~40k blocks remaining.

    I've searched around but haven't found anyone with the same problem -- db cursor problem happens but they don't seem to be the same cause.

    Your kind help would be very much appreciated!

  2. Diapolo commented at 7:20 AM on March 21, 2013: none

    Which version of the client are you using? You could try to delete everything but wallet.dat to force a FULL re-download of the block chain.

  3. ghost commented at 7:47 AM on March 21, 2013: none

    0.8.0. I tried deleting everything except wallet. No help.

  4. Diapolo commented at 8:23 AM on March 21, 2013: none

    1st thing you could try is an upgrade to 0.8.1, which was released a few days ago.

  5. ghost commented at 9:37 PM on March 21, 2013: none

    using 0.8.1 beta. Running. Let's see how far it goes...

  6. ghost commented at 1:32 AM on March 22, 2013: none

    Same error. Failed a little later, with ~40k blocks remaining. Help!

  7. gavinandresen commented at 1:52 AM on March 22, 2013: contributor

    Are you running out of memory or disk space? What operating system?

  8. ghost commented at 3:00 AM on March 22, 2013: none

    Vista home premium. There's plenty of ram and hd space. 2G ram, 22G hd. Same error at 40k blocks remaining

  9. Diapolo commented at 6:55 AM on March 22, 2013: none

    IMHO you should show us the debug.log that your client creates when this happens. It should reside in your datadir (open the debug Window and you can use the open button to see the debug.log).

  10. ghost commented at 8:57 AM on March 22, 2013: none

    debug log: After many entries similar to SetBestChain: new best=00000000000003ad796c280afd86b04d3663f9aeec8be538124a248f037968ad height=187089 work=373009993956651511368 tx=4621096 date=2012-07-01 21:32:04 ProcessBlock: ACCEPTED

    comes the following

    *** System error: CWalletDB::ListAccountCreditDebit() : cannot create DB cursor ERROR: AcceptBlock() : AddToBlockIndex failed ERROR: ProcessBlock() : AcceptBlock FAILED Loaded 1539 blocks from external file in 52114ms Flush(false) wallet.dat refcount=0 wallet.dat checkpoint wallet.dat detach wallet.dat closed DBFlush(false) ended 1ms StopNode() ThreadOpenConnections exited ThreadSocketHandler exited ThreadMessageHandler exited ipcThread exited UPNP_DeletePortMapping() returned : 714 ThreadMapPort exited Flushed 12801 addresses to peers.dat 150ms Committing 37957 changed transactions to coin database... Flush(true) DBFlush(true) ended 0ms EnvShutdown exception: DB_RUNRECOVERY: Fatal error, run database recovery (-30974) Bitcoin exited

    db.log may be more informative but I'm not sure what it means:

    file wallet.dat has LSN 516/7366925, past end of log at 1/2280115 Commonly caused by moving a database from one database environment to another without clearing the database LSNs, or by removing all of the log files from a database environment DB_ENV->log_flush: LSN of 516/7366925 past current end-of-log of 1/2280115 Database environment corrupt; the wrong log files may have been removed or incompatible database files imported from another environment PANIC: DB_RUNRECOVERY: Fatal error, run database recovery wallet.dat: unable to flush page: 11 txn_checkpoint: failed to flush the buffer cache: DB_RUNRECOVERY: Fatal error, run database recovery PANIC: fatal region error detected; run recovery PANIC: fatal region error detected; run recovery PANIC: fatal region error detected; run recovery PANIC: fatal region error detected; run recovery PANIC: fatal region error detected; run recovery PANIC: fatal region error detected; run recovery PANIC: fatal region error detected; run recovery PANIC: fatal region error detected; run recovery PANIC: fatal region error detected; run recovery File handles still open at environment close Open file handle: C:\Users\xxx\AppData\Roaming\Bitcoin\wallet.dat Open file handle: C:\Users\xxx\AppData\Roaming\Bitcoin\database\log.0000000001 PANIC: fatal region error detected; run recovery

    Thanks in advance!

  11. qubez commented at 6:24 PM on March 22, 2013: none

    The wallet.dat LSN errors indicate that the wallet.dat's BerkeleyDB was not properly closed (as detachdb does for the blockchain, issuing a LSN RESET), and the log file is either missing or does not correspond with the wallet.dat that was put in the data directory. This can also come from (a similar type of BDB database log desynchronization can be created by) a large change in the (BDB) database version or environment used in Bitcoin.

    The way I would proceed with this particular issue is to rename the wallet.dat file (and make backups of it if you don't have a before-upgrade backup), remove the database subdirectory (or all .log files inside it), and launch Bitcoin again (which creates a blank wallet.dat). After Bitcoin has completed the blockchain download, then shut it down, substitute back your original wallet.dat, remove the db.log and debug.log, and launch with the -rescan and -upgradewallet options. If Bitcoin completes startup and shows your balance, I would still send the Bitcoins to a new wallet if any strange errors appear in the logs.

  12. sipa commented at 6:27 PM on March 22, 2013: member

    @qubez Since 0.8, BDB is only used for the wallet, so that is the problem, and syncing the block chain without the walelt won't change anything.

    I don't understand why -salvagewallet doesn't solve this, as it rebuilds the wallet from scratch. The only thing I can imagine is something very broken in in of the database/* files. I'd try wiping database/*, and then starting with -salvagewallet.

  13. qubez commented at 6:54 PM on March 22, 2013: none

    I have a 0.3.24 corrupted wallet I can send you that will prevent an upgrade or blockchain sync, however it can be dropped into a fully synced 0.8.0, and an automatic salvagewallet will complete successfully. My advice is based on this experience.

  14. laanwj closed this on Nov 7, 2013

  15. 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-04-17 15:16 UTC

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