Can’t upgrade wallet with 0.17.0’s new -upgradewallet feature #14422

issue redblade7 openend this issue on October 7, 2018
  1. redblade7 commented at 5:25 am on October 7, 2018: none

    When using the new Bitcoin Core v0.17.0, and trying to pass -upgradewallet to upgrade to HD, results in an error.

    • Bitcoin-Qt shows a popup box entitled “Runaway exception” with “A fatal error occurred. Bitcoin can no longer continue safely and will quit.” Terminal output shows:

    EXCEPTION: St13runtime_error
    DeriveNewSeed: AddKeyPubKey failed
    bitcoin in Runaway exception

    bitcoin-qt: /usr/include/boost/thread/pthread/condition_variable_fwd.hpp:116: boost::condition_variable::~condition_variable(): Assertion `!ret’ failed. Aborted

    When attempting to do so via bitcoind -upgradewallet, the following is displayed before a shutdown:

    2018-10-07T05:24:05Z [default wallet] nFileVersion = 170000 2018-10-07T05:24:05Z [default wallet] Keys: 0 plaintext, 1158 encrypted, 1158 w/ metadata, 1158 total. Unknown wallet records: 2 2018-10-07T05:24:06Z [default wallet] Performing wallet upgrade to 169900 2018-10-07T05:24:06Z [default wallet] Upgrading wallet to HD 2018-10-07T05:24:06Z [default wallet] Releasing wallet 2018-10-07T05:24:06Z


    EXCEPTION: St13runtime_error
    DeriveNewSeed: AddKeyPubKey failed
    bitcoin in AppInit()


    EXCEPTION: St13runtime_error
    DeriveNewSeed: AddKeyPubKey failed
    bitcoin in AppInit()

    2018-10-07T05:24:06Z Shutdown: In progress… 2018-10-07T05:24:06Z scheduler thread interrupt 2018-10-07T05:24:06Z Shutdown: done

    The wallet is shown correctly, and with the correct balance, if I run it without -upgradewallet

  2. ryanofsky commented at 4:17 am on October 8, 2018: member
    Is the wallet encrypted? Looking at wallet code, it seems like AddKeyPubKey fails when wallet is encrypted and locked, but generally succeeds otherwise.
  3. achow101 commented at 4:23 am on October 8, 2018: member

    The wallet looks like it is encrypted.

    2018-10-07T05:24:05Z [default wallet] Keys: 0 plaintext, 1158 encrypted, 1158 w/ metadata, 1158 total. Unknown wallet records: 2

    I guess upgradewallet isn’t going to work when the wallet is encrypted. I guess we will need to have some RPC method for upgrading encrypted wallets.

  4. redblade7 commented at 5:12 am on October 8, 2018: none
    Yes, the wallet is encrypted.
  5. meshcollider added the label Wallet on Oct 15, 2018
  6. dna-johnny commented at 5:23 pm on October 26, 2018: none
    FYI: I have the same behaviour as @redblade7
  7. talisein commented at 11:13 pm on May 5, 2019: none
    0.18.0 still crashing
  8. codewiz commented at 6:12 am on July 9, 2019: none

    Are there any known workarounds for this?

    I thought of decrypting the wallet temporarily, but both the GUI and the console disallow empty passwords.

  9. mattpopovich commented at 5:06 am on August 28, 2019: none

    v0.18.1, still crashing. Wallet created around v0.11.1 and encrypted some time after that, ~v0.15.0 or so.

    Let me know if you need anything from me to help troubleshoot/reproduce. I’d be more than happy to help!

  10. ppppso commented at 7:34 pm on March 6, 2020: none
    Still crashing on 0.19.0.1
  11. MarcoFalke commented at 4:14 pm on April 24, 2020: member
    Is this still an issue after #15761 ?
  12. codewiz commented at 3:07 pm on June 14, 2020: none
    It seems #15761 was not merged in time for v0.20 :-( When is the 0.21 release planned for?
  13. MarcoFalke commented at 3:11 pm on June 14, 2020: member
  14. MarcoFalke added this to the milestone 0.21.0 on Jun 14, 2020
  15. codewiz commented at 8:05 pm on June 14, 2020: none
    I built bitcoin-qt from source (master branch), and I was able to update a pre-0.17 encrypted wallet. Thank you for doing this work, @achow101 .
  16. ryanofsky commented at 5:22 pm on June 24, 2020: member

    Not sure if we ever found out what underlying bug was, but if #14422 (comment) is an indication, it seems like it may be fixed.

    Will close this bug report, but if anyone is still having an issue upgrading, feel to reopen and post here so we can try to debug. Maybe we can post a gitian build to make the new upgrade RPC easier to test.

  17. ryanofsky closed this on Jun 24, 2020

  18. mattpopovich commented at 6:52 am on July 23, 2020: none

    All, excuse my ignorance as I’ve only used the GUI client previously. @codewiz, what was the process you used to upgrade your pre-0.17 encrypted wallet? Did #15761 get included in v0.20.1rc1? Or do I need to build from master? If I do build from master, it seems as if -upgradewallet startup option has been removed. So now would I use upgradewallet via bitcoin-cli?

    I just built v0.20.1rc1 from source and am still receiving Error: DeriveNewSeed: AddKeyPubKey failed when I try to use the -upgradewallet startup option. I get a “Method not found” when I try to run bitcoin-cli upgradewallet.

    I will try to build from master in the next day or two and report back.

  19. mattpopovich commented at 10:59 pm on July 26, 2020: none

    All, excuse my ignorance as I’ve only used the GUI client previously. @codewiz, what was the process you used to upgrade your pre-0.17 encrypted wallet? Did #15761 get included in v0.20.1rc1? Or do I need to build from master? If I do build from master, it seems as if -upgradewallet startup option has been removed. So now would I use upgradewallet via bitcoin-cli?

    I just built v0.20.1rc1 from source and am still receiving Error: DeriveNewSeed: AddKeyPubKey failed when I try to use the -upgradewallet startup option. I get a “Method not found” when I try to run bitcoin-cli upgradewallet.

    I will try to build from master in the next day or two and report back.

    I have rebuilt from master (v0.20.99.0- ccef10261) and can confirm that the upgradewallet RPC works successfully on my wallet. Thanks for the development @achow101. FWIW: My wallet was created around v0.11.1 and encrypted some time after that, ~v0.15.0 or so.

  20. MarcoFalke commented at 8:06 am on November 27, 2020: member

    fyi, rc2 is now available (if you test, please test with caution, as this is not a final release)

  21. MarcoFalke locked this on Feb 15, 2022

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: 2024-07-05 19:13 UTC

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