Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to send transactions #20871

Closed
Smesterj1952 opened this issue Jan 6, 2021 · 25 comments
Closed

Unable to send transactions #20871

Smesterj1952 opened this issue Jan 6, 2021 · 25 comments

Comments

@Smesterj1952
Copy link

Hello
Bitcoin Core version 0.20.1
Last transaction sent 7/29/2020.
Upgrade from 0.18 to 0.20.
Last transaction received 10/27/2020
Upgrade from 0.20 to 0.20.1 today.
Cannot send any transaction, error;
"Can't generate a change-address key. No keys in the internal keypool and can't generate any keys."
Any feedback will be appreciated, can't use my wallet.
Looked other issues like this, can't find a way to fix it.
Wallet is looked and encrypted since 2014.

@maflcko
Copy link
Member

maflcko commented Jan 7, 2021

Duplicate of #16091 ? Thus, fixed in 0.21.0

@p3yot3
Copy link

p3yot3 commented Jan 7, 2021

Is it - definitely? I ask because I got no response when I asked this in #16091 & the issue has been ongoing since 26 May 2019 - that's 20 months of users being unable to access their BTC or use their wallets, which is quite disturbing for us early adopters considering the recent price increases.

@Smesterj1952
Copy link
Author

It looks like definitely, will try to make another brand new wallet and restore from a previous backup to see what happen. Did you try installing v0.17.1 using same wallet.dat and then use the upgrade command?

@p3yot3
Copy link

p3yot3 commented Jan 7, 2021

I was going to try that, but other users complained of stuck transactions after doing so in the other thread, so I wasn't prepared to risk it.

@Smesterj1952
Copy link
Author

To risk what? We cannot use the wallet anyway whatever is there we lost it already. I will try it if the new restored wallet does not work.

@Smesterj1952
Copy link
Author

Smesterj1952 commented Jan 7, 2021 via email

@p3yot3
Copy link

p3yot3 commented Jan 7, 2021

I am using 0.21.1 and still having same issue. ?????

This is what I feared. With the current price rises there will be more & more early adopters digging out their old wallets only to find that they are unusable - it's a terrible situation to find oneself in & should have been documented & addressed as soon as the issue became apparent - which was almost two years ago now. WTF?!

@maflcko
Copy link
Member

maflcko commented Jan 7, 2021

There is no Bitcoin Core 0.21.1. However, there is a 0.21.0rc5 (pre release version), so use at you own risk. See #20555.

What was the result of the upgradewallet RPC?

@Smesterj1952
Copy link
Author

Smesterj1952 commented Jan 7, 2021 via email

@maflcko
Copy link
Member

maflcko commented Jan 7, 2021

Yes, this should be fixed in 0.21.0, not 0.20.1

@p3yot3
Copy link

p3yot3 commented Jan 7, 2021

Yes, this should be fixed in 0.21.0, not 0.20.1

Should be fixed? Sounds like you're still not sure - has the fix not been tested in the pre-release yet?

@maflcko
Copy link
Member

maflcko commented Jan 7, 2021

I don't have a "broken" wallet personally and I didn't create one to test this, but according to #16091 (comment) this is fixed in 0.21.0

@p3yot3
Copy link

p3yot3 commented Jan 7, 2021

Yes, I saw that comment. That's fine for code gurus, but what about the average users (me included) who don't have a clue what "bashing" & "looping scripts" are - how would they apply the fix?
The wallets aren't "broken" per-se, they are what was supplied for download & worked perfectly at the time. Code changes in releases since then are the problem because devs didn't fully check for backwards compatibility then ignored the issue when it was discovered over 20 months ago. this needs to be addressed as a matter of urgency & a fully tested & working fix applied, not just because I & a few others can't access their funds or use their wallets - but because there will be many more people running into the same problem very soon.
The lamestream media will have a field day if this gets out - I can see the headline now: Early Bitcoin adopters locked out of wallets - devs unmoved.
Really, this has gone on for far too long already.

@maflcko
Copy link
Member

maflcko commented Jan 7, 2021

There is no need to apply the fix. You simply download the release once it is available and test whether it works, with the usual caution of course. If you don't want to wait for the final release, you can get the pre-release version from https://bitcoincore.org/bin/bitcoin-core-0.21.0/test.rc5/

@p3yot3
Copy link

p3yot3 commented Jan 7, 2021

There is no need to apply the fix. You simply download the release once it is available and test whether it works, with the usual caution of course. If you don't want to wait for the final release, you can get the pre-release version from https://bitcoincore.org/bin/bitcoin-core-0.21.0/test.rc5/

But @Smesterj1952 has already confirmed a few posts up that it doesn't work.

Edit: I'm trying the RC5 now, but "Warning: Fee estimation is not possible". Failed.

Edit1: Estimation now working. Tried sending & was asked to run "keypoolrefill":

Did that & tried again - same thing. Transaction failed.
Capture

@p3yot3
Copy link

p3yot3 commented Jan 7, 2021

So, I can confirm what @Smesterj1952 has already said - the issue is still ongoing on RC5.

If you need any more help/info then let me know, but in the meantime please do not close this issue like you did the last one until a fully tested & proven fix is available. After waiting patiently for 20 months I think we deserve it, before the next release.

@achow101
Copy link
Member

achow101 commented Jan 7, 2021

@Smesterj1952 @p3yot3 Can you open the debug window and post the results of getwalletinfo? For your privacy, please remove the lines for balance, unconfirmed_balance, and immature_balance before posting.

From the other issue, it seems like using rc5 to upgrade the wallet fixed the issue, not using rc5 itself.

@p3yot3
Copy link

p3yot3 commented Jan 7, 2021

@achow101 Here you go:

"walletname": "",
"walletversion": 169900,
"format": "bdb",
"txcount": 815,
"keypoololdest": 1435111019,
"keypoolsize": 998,
"keypoolsize_hd_internal": 0,
"unlocked_until": 0,
"paytxfee": 0.00000000,
"private_keys_enabled": true,
"avoid_reuse": false,
"scanning": false,
"descriptors": false

@achow101
Copy link
Member

achow101 commented Jan 7, 2021

@p3yot3 Did you try to use -upgradewallet on this wallet with 0.17+ at some point? Looking back at the upgrading code, I believe that trying that would cause the wallet to become broken.

@p3yot3
Copy link

p3yot3 commented Jan 7, 2021

In all honesty, I'm sure I must have done at some point since 0.17 - it was a long time ago so can't be sure when. I've not done it with this version though. What syntax should one use now when upgrading a wallet?

@achow101
Copy link
Member

achow101 commented Jan 7, 2021

In 0.21.0rc5, go to the debug console and do upgradewallet. That should fix the problem. You must create a new backup after upgrading.


It looks like the cause of this problem is having a wallet version that is supposed to be HD split, but not having an hd seed in the wallet. You can tell because the wallet version is greater than 139900, but there is no hdseedid in the getwalletinfo output. So how did this happen?

In 0.17, we allowed the -upgradewallet option to upgrade a non-HD wallet to HD. This would set the version number to something that actually supports HD, HD split, and pre-split keypool. This upgrade would first increase the wallet version number, and then generate the new hd seed. However the hd seed would fail to generate for encrypted wallets and the software would crash at this point. But the new version number would already be written to the wallet file. Subsequent use of that wallet would make the software think it can support HD split even though it doesn't actually. Because of that, it would try to fetch keys from the empty internal keypool and additionally fail the check for whether new keys could be generated, thus causing the error you see.

The check for whether new keys were generated depended on either the wallet version saying it is non-HD, or for there to be a HD seed. Since the wallet version purports to be HD and there is no HD seed, this would fail. The only reason you could still get new addresses and receive Bitcoin is because the keypool is big.

This should be resolved by 0.21 now supporting upgrading encrypted wallets. This upgrade will generate a HD seed for wallets that should be supporting HD based on the version number but do not currently have a seed (this is a side effect of how the upgrade works). However because your wallet will be believed to already support the split keypool, the pre-split keypool will not be used so a new backup must be created after upgrading. After the upgrade, all newly fetched change addresses will come from the newly generated HD seed.


To replicate this issue, create a non-HD wallet using 0.15.2 or older. Encrypt that wallet. Using any version 0.17 - 0.20 inclusive, do -upgradewallet. The wallet will then have the same issue as described. getrawchangeaddress should fail. Using 0.21+, unlock the wallet and do upgradewallet. getrawchangeaddress should now work.

@p3yot3
Copy link

p3yot3 commented Jan 7, 2021

Right.....that's all well above my pay grade I'm afraid.......anyway - here's the result of using upgradewallet as you suggested:

"wallet_name": "",
"previous_version": 169900,
"current_version": 169900,
"result": "Already at latest version. Wallet version unchanged."

Should I now try to make a transaction?.....

@achow101
Copy link
Member

achow101 commented Jan 7, 2021

Yes, try making a transaction.

That message is a bit misleading in this case, but it is reasonable given the state of the wallet. The upgrade still occurs as this message is produced after the upgrade function is called.

@p3yot3
Copy link

p3yot3 commented Jan 7, 2021

SUCCESS!!!

I don't believe it - I was beginning to think I'd lost my entire investment - thankyouthankyouthankyou!! Praise the cybergods & yourself for saving my financial life - achow101 for president!!

Think I'm gonna cry - I need to lie down......

@Smesterj1952
Copy link
Author

Hey guys thank you for your help, when I created a new 0.20.1 wallet from scratch and restore from the previous "broken" wallet that bring the message, it went away, I can send Transactions now without any error.
I also though I lost my Bitcoins but everything looks good now.
I recommend everybody to have backups at least before installing a new version so anything happen you are able to recover.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@achow101 @maflcko @p3yot3 @Smesterj1952 and others