BirthdayResearch / defichain-app

DeFi Blockchain desktop app for Windows, Linux and Mac.
https://defichain.com
MIT License
157 stars 57 forks source link

Error: ReserveKeyFromKeyPool: unknown key in key pool #990

Closed saibot600 closed 3 years ago

saibot600 commented 3 years ago

Actual behavior:

I am getting this error in my wallet when trying to swap, liquidity mine or send funds: "ReserveKeyFromKeyPool: unknown key in key pool".

Expected behavior:

No errors.

How to reproduce it (as minimally and precisely as possible):

No idea how or why this even appeared. This wallet has never had any problems for about 6 months and suddenly this error appeared. I did all the usual stuff (restarting, importing the wallet again, renaming the wallet file etc.) but to no avail. Also, an older file version of this wallet (from another backup) caused the same error. I have a second wallet file on my computer (not a backup but a different wallet) which works without this error by the way.

What are your environment parameters?

Anything else we need to know?

During my testing, at one point I think I was able to get the private keys through the dumpprivkey command without even unlocking the wallet but now I can't reproduce it anymore. So, maybe something is wrong with the encryption somehow.

I obviously don't want to lose any funds. I've also found this thread in Bitcointalk forum but I don't know if this applies here in some way as well: https://bitcointalk.org/index.php?topic=5039507.0

Thanks a lot for your help!

grafik grafik

defichain-bot commented 3 years ago

@saibot600: Thanks for opening an issue, it is currently awaiting triage.

The triage/accepted label can be added by foundation members by writing /triage accepted in a comment.

In the meantime, you can:

  1. Checkout DeFiChain’s Github issue page to see if your issue has already been reported
  2. Submit any logs if you have them, this will greatly expedite the process for us.
  3. You can also join our Telegram or Reddit community channels.
Details I am a bot created to help the [DeFiCh](https://github.com/DeFiCh) developers manage community feedback and contributions. You can check out my [manifest file](https://github.com/DeFiCh/app/blob/master/.github/governance.yml) to understand my behavior and what I can do. If you want to use this for your project, you can check out the [DeFiCh/oss-governance-bot](https://github.com/DeFiCh/oss-governance-bot) repository.
izzycsy commented 3 years ago

Hi @saibot600 , some suggestions that might help, I suggest not to rename your wallet.dat files, or move it when the app is running. If anything,

  1. create a new wallet backup, specify your preferred name for the file, select your preferred folder and then save.
  2. copy and paste the wallet.dat to another folder for safe keeping
Menu bar   Backup Wallet Select folder to backup wallet1 Select folder to backup wallet2

Thanks for doing some investigation. Regarding "ReserveKeyFromKeyPool: unknown key in key pool", according to the link you sent, it could be a corrupted wallet.dat, I would suggest you to try and move your funds.

Can you send your logs please? It'll help us understand and confirm the issue.

1 App log 2 Compress

—————————————————————— In the mean time, can you try other wallet.dat files? In the wallets folder you'll likely see wallet-bak-123456789 as well, these are additional wallet backups. Try those.

For Windows it's located here:
 C:\Users\<username>\AppData\Roaming\DeFi Blockchain\wallets\

wallet dat location

You may refer to the following steps on how to Restore Wallet via Backup:

1. Ensure app is 100% synchronized (green tick at bottom left hand corner), select Restore wallet via backup (wallet.dat)

Restore wallet from backup

2. A window should pop up, direct the app to your wallet.dat location

• In the wallets folder you'll likely see wallet-bak-123456789 as well, these are additional backups. • Select the wallet.dat *Note: the wallets folder is a default location and should not be moved

Restore   Select folder of backup1

3. Another possible scenario, could be that you saved it in another folder.

• For example, I saved the wallet backup in Documents/_BACKUP • Hence, I'd redirect the app to the folder Documents/_BACKUP, and select the wallet.dat

Restore   Select folder of backup2
saibot600 commented 3 years ago

Thank you very much for your help. Through that I think I was able to solve it by now. What I did:

Remaining questions:

  1. Is it actually necessary to continuously make backups of the wallet file or should one backup be enough as the wallet file is ideally not changed afterwards anymore by the app?
  2. I wonder how the wallet file got corrupted in the first place. Perhaps it has to do with an automated file backup solution I am using and some bad coincidence or so. Or anything that is more likely than that?
  3. Do you still need any logs etc. or only in case the error appears again?
  4. Should I still move all my funds to a new wallet or should it be ok now as there is no error anymore?

Thanks again!

izzycsy commented 3 years ago

Hi @saibot600 , glad it's resolved, to answer your questions:

  1. Yes, it's advised. Sometimes users face some issues. And having additional backups resolves the problems most of the time. A example of when to backup could be before an app update.
  2. What automatic backup are you using? It could be possible that was the cause but we can't determine since we don't have the logs. Other causes could be old hardware, user went to rename/move the wallet.dat when app is running, etc.
  3. Sure, you can send it over so we can understand, but for your unique case, the solution is to find a working wallet.dat.
  4. It's up to you, but please create a new backup and keep it safe. You might want to stick to the normal way of creating a backup.
Menu bar   Backup Wallet Select folder to backup wallet1 Select folder to backup wallet2
saibot600 commented 3 years ago

Thanks a lot again. To address your points:

2.) From all the points you mentioned it can only be the backup solution in my case. I am using PCloud and have experienced some other similar file corruptions on files that I or some programs were using at the time PCloud was trying to back them up.

3.) I didn't create logs while I had the problem but only afterwards. Does that still help? If so, I would be a bit hesitant to just upload everything here publicly. Not sure how sensitive that info might be in the worst case.

izzycsy commented 3 years ago

Hi @saibot600 , we do not support any other platform you decide to use, we can only help figure out if you've an issue and what went wrong and work from there. I'd suggest that you backup your wallet the conventional way to prevent the same thing from happening. I'll be closing your issue. Thank you.

Menu bar   Backup Wallet