Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: FreeMoney on June 24, 2012, 04:32:57 PM



Title: EXCEPTION: 11DbException Db::open: Invalid argument bitcoin in Run
Post by: FreeMoney on June 24, 2012, 04:32:57 PM
I can't stop getting this error: EXCEPTION: 11DbException        Db::open: Invalid argument        bitcoin in Runaway exception

It started when I tried to open a version 3 wallet with version 5. After clearing everything I got it again, then again after clearing everything and using 0.6.2. Then again using the version 5 wallet I've been using.

Usually I'm getting it about 40k blocks into the download.

I'm using ubuntu 11.10. Plenty of memory and disk. I have had problems with memory before (FF leaking memory I think), but I don't have any other symptoms of that now.


Title: Re: EXCEPTION: 11DbException Db::open: Invalid argument bitcoin in Run
Post by: EnergyVampire on June 24, 2012, 04:36:29 PM
Hello FreeMoney,

Use the -detachdb option and you should be okay: https://bitcointalk.org/index.php?topic=88734.msg978187#msg978187


Title: Re: EXCEPTION: 11DbException Db::open: Invalid argument bitcoin in Run
Post by: FreeMoney on June 24, 2012, 05:06:13 PM
Hmm, this happens even when I don't load files in though. I delete everything, put a wallet in the dir, it loads up, downloads ~40k blocks and gives that error.

Will try it anyway.


Title: Re: EXCEPTION: 11DbException Db::open: Invalid argument bitcoin in Run
Post by: FreeMoney on June 24, 2012, 05:45:40 PM
I clicked the "detach on shutdown option" then closed bitcoin, waited, opened it again, same problem. (Something Gavin said made me thing maybe I have to actually shutdown the computer, do I?) It also seems to be jumping ahead in how many blocks it reports having when the error happens. It was at like 25k, one minute later I looked again and it said 43k and had that error.


Title: Re: EXCEPTION: 11DbException Db::open: Invalid argument bitcoin in Run
Post by: EnergyVampire on June 24, 2012, 06:31:45 PM
Have you tried downloading the blocks with a brand new wallet.dat file?


Title: Re: EXCEPTION: 11DbException Db::open: Invalid argument bitcoin in Run
Post by: deepceleron on June 24, 2012, 06:43:05 PM
The debug log may give some indication of what is going on. One scenario if you are using the release client is that something is borked in your wallet database - when Bitcoin tries to update the wallet (writing something like the "last block seen" counter) it fails. The wallet file may corrupted, but could also be locked by another Bitcoin process or left unwriteable or without correct permissions by something with the operating system. You also may have a bad area of your hard drive or other such hardware problem - writing to the same bad sectors when attempting to erase and re-download the blockchain gets you the same database error. It would be worth the time to make another wallet.dat backup of your current wallet, and do a hard drive surface scan.

There a few things other things you can do to discover the problem:
- delete the blockchain database and rename the wallet (or just rename the whole bitcoin data directory), and see Bitcoin get all the blocks normally,
- restore an older wallet backup and see if the problem returns,
- use a blockchain download, and do a rescan with your current wallet and see if the error crops up.


Title: Re: EXCEPTION: 11DbException Db::open: Invalid argument bitcoin in Run
Post by: FreeMoney on June 24, 2012, 08:37:16 PM
Have you tried downloading the blocks with a brand new wallet.dat file?

Yes, also fails.

The error has changed, not just when trying with a blank wallet:

EXCEPTION: 11DbException       
Db::open: Cannot allocate memory       
bitcoin in Runaway exception       

It seems to always be at exactly block 43788.


Title: Re: EXCEPTION: 11DbException Db::open: Invalid argument bitcoin in Run
Post by: FreeMoney on June 24, 2012, 09:16:03 PM
Decided to use a different computer. Fresh OS (Ubuntu 12.04), fresh bitcoin install, fresh wallet, got to 50k or so blocks and gives me the same error. WTF is going on?

Actually error is a little different.

EXCEPTION: 11DbException
DB::put: Cannot allocate memory
bitcoin in ProcessMessage()


Title: Re: EXCEPTION: 11DbException Db::open: Invalid argument bitcoin in Run
Post by: FreeMoney on June 24, 2012, 09:58:12 PM
In windows now on the original machine, 90k blocks and counting with no problem. So I closed, loaded wallet in, it seems to rescan automatically, sees all my unconfirmed tx, and is getting more blocks now.

So I would be sure that is was a disk problem or a ubuntu problem, but then what was the deal with my other computer with everything completely fresh? Very puzzling.


Title: Re: EXCEPTION: 11DbException Db::open: Invalid argument bitcoin in Run
Post by: EnergyVampire on June 24, 2012, 10:17:04 PM
Was the original linux download?:

bitcoin-0.6.2-linux.tar.gz

SHA1: f0e396ecdd2d9cd70ccce7b5c0bff1bf2834a2b0
MD5: 6a95e87a8f1ce38f69fe3f38173f9549


Title: Re: EXCEPTION: 11DbException Db::open: Invalid argument bitcoin in Run
Post by: EnergyVampire on June 24, 2012, 11:46:04 PM
Your issue might be a good candidate for a bug report: https://github.com/bitcoin/bitcoin/issues


Title: Re: EXCEPTION: 11DbException Db::open: Invalid argument bitcoin in Run
Post by: FreeMoney on June 25, 2012, 03:53:44 AM
Thanks for your help guys. For now I'll just have to boot into windowz occasionally.


Title: Re: EXCEPTION: 11DbException Db::open: Invalid argument bitcoin in Run
Post by: FreeMoney on June 25, 2012, 03:54:34 AM
Your issue might be a good candidate for a bug report: https://github.com/bitcoin/bitcoin/issues

Yeah, I was astonished that I got the same (well similar) problem with fresh everything. It was ubuntu 12.04, probably not that tested yet.

I did find a gavin/dooglus convo somewhere about which wallets where causing this with what frequency with which versions. So it is somewhat known. But everything fresh is odd and I've not seen it reported.


Title: Re: EXCEPTION: 11DbException Db::open: Invalid argument bitcoin in Run
Post by: DavinciJ15 on July 19, 2012, 06:50:54 PM
I moved my db to a new drive and did a symbolic link and at first it worked then I stopped the bitcoind then started it again and it failed with...

Code:
ubuntu@cs3:~/.bitcoin$ bitcoin server starting


************************
EXCEPTION: 11DbException
Db::open: Invalid argument
bitcoin in AppInit()

terminate called after throwing an instance of 'DbException'
  what():  Db::open: Invalid argument

Not sure whats going on.


Title: Re: EXCEPTION: 11DbException Db::open: Invalid argument bitcoin in Run
Post by: bytedisorder on August 01, 2012, 11:35:58 PM
I am having the same error on WUBI Ubuntu 12.

Code:
EXCEPTION: 11DbException       
Db::put: Cannot allocate memory       
bitcoin in ProcessMessages()

Is there any solution out there for this as of yet?


Title: Re: EXCEPTION: 11DbException Db::open: Invalid argument bitcoin in Run
Post by: deepceleron on August 04, 2012, 06:10:58 PM
I am having the same error on WUBI Ubuntu 12.

Code:
EXCEPTION: 11DbException       
Db::put: Cannot allocate memory       
bitcoin in ProcessMessages()

Is there any solution out there for this as of yet?

The addr.dat file is a likely culprit - especially after version changes, the database doesn't seem to be updated and old versions are incompatible. This is a cache of recently-seen clients, so it can just be deleted from your Bitcoin data directory, and you can restart Bitcoin.


Title: Re: EXCEPTION: 11DbException Db::open: Invalid argument bitcoin in Run
Post by: DigitalHermit on September 05, 2012, 04:02:07 AM
I moved my db to a new drive and did a symbolic link and at first it worked then I stopped the bitcoind then started it again and it failed with...

Code:
ubuntu@cs3:~/.bitcoin$ bitcoin server starting


************************
EXCEPTION: 11DbException
Db::open: Invalid argument
bitcoin in AppInit()

terminate called after throwing an instance of 'DbException'
  what():  Db::open: Invalid argument

Not sure whats going on.

I hit this exact same error running on an instance of Ubuntu 12.04. I then checked the debug.log file created in the .bitcoin/ directory and found:

Code:
LoadBlockIndex(): hashBestChain=00000000000001b38e93  height=197280
Verifying last 2500 blocks at level 1
ERROR: CheckBlock() : block timestamp too far in the future
LoadBlockIndex() : *** found bad block at 197280, hash=00000000000001b38e93f02be1f00ae3f39c4ab32dfb989154d38cfce2b29a4a
ERROR: CheckBlock() : block timestamp too far in the future
LoadBlockIndex() : *** found bad block at 197279, hash=0000000000000088246a0a90732f7fca77d0b0087c1997a91311e70a54b33da8
ERROR: CheckBlock() : block timestamp too far in the future

This further led me to discover that my server time was far off the correct time (by several hours!). So I then explicitly set the time via "date -s".

Example: sudo date -s "Tue Sep  4 22:37:51"

Rerunning the bitcoin server after doing that worked great (fixed the problem!).