Possibly corrupted wallet.dat. Help?

Good day folks,

I’ve been a lurker of the sub-reddit and bitcointalk,
I’ve mined a few PPC and one day i decided to reinstall windows.

I backed everything up but I encountered this issue when restoring the wallet

I tired everything I can think of basically. :confused:

That looks like it’s related to the block database, rather than the wallet, but I could be wrong.

Can you detail the steps you took when you reinstalled PPCoin-Qt.exe and then migrated your wallet in?

  1. Installed a fresh copy of ppcoin-qt
  2. Waited for the block database to load
  3. Replaced the wallet.dat with the one I wanted
  4. This came along.

I did the -rescan thing, still gives me the same issue.

What does debug.log say?

Are you replacing wallet.dat with the qt client already open and synced, or is qt fully closed when you replace wallet.dat ?

Fully closed.

It gives me an error even if it isn’t synced too.

Here’s what the latest log says

[code]
PPCoin version v0.3.0ppc-beta (2013-02-16 03:18:47 +0000)
Default data directory C:\Users\AwangIlyas\AppData\Roaming\PPCoin
Loading addresses…
dbenv.open LogDir=C:\Users\AwangIlyas\AppData\Roaming\PPCoin\database ErrorFile=C:\Users\AwangIlyas\AppData\Roaming\PPCoin\db.log
Loaded 9766 addresses
addresses 574ms
Loading block index…
PPCoin Network: genesis=0x0000000032fe677166d5 nBitsLimit=0x1d00ffff nBitsInitial=0x1c00ffff nStakeMinAge=2592000 nCoinbaseMaturity=500 nModifierInterval=21600
LoadBlockIndex(): hashBestChain=e277e036c5188e1f1d68 height=84690 trust=1422420145501353
LoadBlockIndex(): synchronized checkpoint 000000000000000e6bf0c55e9728076d4540f96b51ee8811ed300f2ca3a86fe2
Verifying last 2500 blocks at level 1
block index 8163ms
Loading wallet…


EXCEPTION: 11DbException
Db::open: Invalid argument
C:\Program Files (x86)\PPCoin\ppcoin-qt.exe in Runaway exception

EnvShutdown exception: DbEnv::close: Invalid argument (22)[/code]

How long ago did you mine Peercoin?

How long ago did you mine Peercoin?[/quote]

A month or two back. Difficulty was like 10 million ish.

Ok, I was just trying to make sure you weren’t on a really old version wallet (say, pre-v0.3) and that maybe there was an issue there.

Trujillo reported the same “runaway exception” isssue on Windows, too, recently.

My wallet is stored on a Mac, but if I can get a chance today, I’ll try to spin up a Windows VM and try to recreate the defect. What version of Windows do you use?

awgilyas, can you try something for me, please?

First, let’s check to see if the wallet is corrupted for some reason. Using information from this Bitcoin thread, I’d like you to follow these steps:

[ol][li]Rename [font=courier]C:\Users\AwangIlyas\AppData\Roaming\PPCoin[/font] to [font=courier]C:\Users\AwangIlyas\AppData\Roaming\PPCoin.OLD[/font][/li]
[li]Create a new, empty directory: [font=courier]C:\Users\AwangIlyas\AppData\Roaming\PPCoin[/font][/li]
[li]Take a copy of the backed up wallet.dat file and place it in the newly created directory from the previous step[/li]
[li]From the Windows Start Menu, navigate to All Programs > Accessories > Run[/li]
[li]In the Open box, type: ppcoin-qt.exe -salvagewallet[/li][/ol]

If it gives you the same error, it may be that the wallet.dat file has become completely corrupted somehow. But before we write it off completely, we can try a couple more things.

[ol][li]Make sure your wallet.dat is backed up (the one from when you were mining, and that contains the records of your Peercoins).[/li]
[li]Once you’re sure that it is backed up, uninstall PPCoin-Qt.exe, completely[/li]
[li]Reinstall PPCoin-Qt.exe[/li]
[li]Launch the application and allow the blockchain to completely synchronize[/li][/ol]

I started to look around the web for anything that could help and I came across this Bitcoin post. If PPCoin-Qt.exe runs without an exception, after you do the previous steps, we can then see about replacing the wallet.dat with your backed-up version.

[quote=“Ben, post:8, topic:1125”]Ok, I was just trying to make sure you weren’t on a really old version wallet (say, pre-v0.3) and that maybe there was an issue there.

Trujillo reported the same “runaway exception” isssue on Windows, too, recently.

My wallet is stored on a Mac, but if I can get a chance today, I’ll try to spin up a Windows VM and try to recreate the defect. What version of Windows do you use?[/quote]

Windows 8.1

Just did that. I gives out the same thing.

I’ll try re installing it later.

Reinstalled it Cleaned everything out. Same issue :confused:

is your computer clock correct?

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!).

[quote=“irritant, post:11, topic:1125”]is your computer clock correct?

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!).

[/quote]

It’s correct. Checked it even to be sure.

hmm strange,
I don’t know what is going on… I was hoping it was something stupid like incorrect clock, but it seems to be something else :frowning:

How did you backup wallet.dat?

Is it possible that ppcoind was still open when you copied the file?

Did it go to a thumb drive or usb connected drive?

[quote=“ppcman, post:14, topic:1125”]How did you backup wallet.dat?

Is it possible that ppcoind was still open when you copied the file?

Did it go to a thumb drive or usb connected drive?[/quote]

I just copied the file.
I think so.

I uploaded it on Google Drive. So, there’s a chance that it got corrupted because of that. :confused:

[quote=“irritant, post:13, topic:1125”]hmm strange,
I don’t know what is going on… I was hoping it was something stupid like incorrect clock, but it seems to be something else :([/quote]

Yeah. I’m reading up on ways to extract my privkey using a PPC PyWallet fork.

Frankly I can’t make heads or tails of it

could it be that when you copied it to google drive, the datestamp of the file changed, causing this problem (i guess highly unlikely) ?

Don’t think so. :confused:

Interesting.

another token reply so i can create a help topic…