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

Wallet "passphrase" info gets lost after updating cardano-wallet #1701

Closed
nikolaglumac opened this issue Jun 1, 2020 · 7 comments
Closed
Assignees

Comments

@nikolaglumac
Copy link

Context

We are currently working on a next Daedalus ITN release (2.4.0-ITN1) which uses cardano-wallet 031835950a38384b289f3adc43c671a00ef9000b revision.
We've found an issue that is currently blocking us from proceeding with our release.
Given that you had a wallet created in the current production Daedalus ITN version (2.3.1-ITN1) which uses cardano-wallet 8316bffdd05596e8830da9129f3a3907c6fba684 revision and then you update Daedalus to this next release, the wallet's passphrase info is lost - which makes Daedalus think this wallet has no password set.
There is no option to have a passwordless wallet in any of the Daedalus ITN builds

Information -
Version 0318359
Platform All
Installation Daedalus 2.4.0-ITN1

Steps to Reproduce

  1. Install production Daedalus ITN version: 2.3.1-ITN1
  2. Create/restore a wallet (doesn't matter if it is a Byron/Shelley wallet)
  3. Update Daedalus to the pre-production version: 2.4.0-ITN1
  4. Daedalus will ask you to set a password for your existing wallet which will fail as the wallet already has a password set but the Api doesn't return this info correctly.
  5. If you then proceed and create a new wallet in this version of Daedalus it will correctly display passphrase info.

Postman GET wallets response

screenshot

☝️ as can be seen from this screenshot, the 1st wallet has no "passphrase" attribute, while the 2nd one (created after the update) has.

Expected behavior

Wallet passphrase info should be preserved after the update.

Actual behavior

Wallet passphrase info is lost after the update.


Resolution


QA

@KtorZ KtorZ self-assigned this Jun 2, 2020
iohk-bors bot added a commit that referenced this issue Jun 2, 2020
1704: assign default encryption scheme for passphrase with none. r=KtorZ a=KtorZ

# Issue Number

<!-- Put here a reference to the issue this PR relates to and which requirements it tackles -->

#1701 

# Overview

<!-- Detail in a few bullet points the work accomplished in this PR -->

- a4dd767
  📍 **assign default encryption scheme for passphrase with none.**


# Comments

<!-- Additional comments or screenshots to attach if any -->

cc @nikolaglumac

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Assign the PR to a corresponding milestone
 ✓ Acknowledge any changes required to the Wiki
-->


Co-authored-by: KtorZ <[email protected]>
iohk-bors bot added a commit that referenced this issue Jun 2, 2020
1704: assign default encryption scheme for passphrase with none. r=KtorZ a=KtorZ

# Issue Number

<!-- Put here a reference to the issue this PR relates to and which requirements it tackles -->

#1701 

# Overview

<!-- Detail in a few bullet points the work accomplished in this PR -->

- a4dd767
  📍 **assign default encryption scheme for passphrase with none.**


# Comments

<!-- Additional comments or screenshots to attach if any -->

cc @nikolaglumac

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Assign the PR to a corresponding milestone
 ✓ Acknowledge any changes required to the Wiki
-->


Co-authored-by: KtorZ <[email protected]>
@piotr-iohk
Copy link
Contributor

If I'm not mistaken this is the manifestation of the issue -> #1552 (Migration issue on Jormungandr (v2020-03-16 => v2020-04-01 | 07)).

Daedalus ITN version: 2.3.1-ITN1 actually uses cardano-wallet v2020-03-16.

@piotr-iohk
Copy link
Contributor

I see that there is a problem when doing migration v2020-03-16 -> current master (2020.6.2 (git revision: b3cfd5f)):

  1. Start v2020-03-16 on Jormungandr.
cd cardano-wallet/lib/jormungandr/test/data/jormungandr/test_scripts
cardano-wallet-jormungandr-v2020-03-16 launch --genesis-block ../block0.bin --port 8090 --node-port 8080 --state-dir ./data_launch -- --secret ../secret.yaml --config ../config.yaml
  1. Create a wallet.
  2. Start current version.
    On starting we have:
[cardano-wallet.wallet-db:Notice:21] [2020-06-03 06:57:18.14 UTC] wallet table does not contain required field 'passphrase_scheme'. Adding this field with a default value of "EncryptWithPBKDF2".
[cardano-wallet.wallet-engine:Error:21] [2020-06-03 06:57:18.14 UTC] Worker has exited unexpectedly: SQLite3 returned ErrorError while attempting to perform prepare "UPDATE wallet SET passphrase_scheme = \"EncryptWithPBKDF2\" WHERE passphrase_scheme IS NULL AND passphrase_last_updated_at IS NOT NULL ;": no such column: passphrase_scheme

And trying to list wallet give 500:

[cardano-wallet.wallet-db:Info:211] [2020-06-03 06:58:47.85 UTC] Found existing wallet: f425f750be117385fb7c4280dee5cf9be2f0e71c
[cardano-wallet.wallet-db:Info:211] [2020-06-03 06:58:47.85 UTC] Found existing wallet: f425f750be117385fb7c4280dee5cf9be2f0e71c
[cardano-wallet.wallet-db:Notice:211] [2020-06-03 06:58:47.85 UTC] wallet table does not contain required field 'passphrase_scheme'. Adding this field with a default value of "EncryptWithPBKDF2".
SQLite3 returned ErrorError while attempting to perform prepare "UPDATE wallet SET passphrase_scheme = \"EncryptWithPBKDF2\" WHERE passphrase_scheme IS NULL AND passphrase_last_updated_at IS NOT NULL ;": no such column: passphrase_scheme

@piotr-iohk
Copy link
Contributor

I didn't see a problem when doing this migration path:

v2020-03-16 -> (master before the fix #1704) -> (master after the fix #1704)

but

v2020-03-16 -> (master after the fix #1704)

is problematic... (as described above)

cc: @KtorZ.

iohk-bors bot added a commit that referenced this issue Jun 3, 2020
1717: Replace 'Maybe Bool'  with a dedicated sum-type.  r=KtorZ a=KtorZ

# Issue Number

<!-- Put here a reference to the issue this PR relates to and which requirements it tackles -->

#1701

# Overview

<!-- Detail in a few bullet points the work accomplished in this PR -->

- 9aaf4ad
  📍 **log when no migration is needed**
  
- 7c3d459
  📍 **replace 'Maybe Bool' with a dedicated sum-type for more clarity**
  
# Comments

<!-- Additional comments or screenshots to attach if any -->

Caught me one time already... Won't caught anyone else. 

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Assign the PR to a corresponding milestone
 ✓ Acknowledge any changes required to the Wiki
-->


Co-authored-by: KtorZ <[email protected]>
@piotr-iohk
Copy link
Contributor

fixed with #1717.

@nathannoble
Copy link

Looks like the issue is back. I restored two wallets into Daedalus and the last one had this error.

wallet table does not contain required field 'passphrase_scheme'. Adding this field with a default value of "EncryptWithPBKDF2".

Is there something that can be done to fix this?

@KtorZ
Copy link
Member

KtorZ commented Feb 22, 2021

@nathannoble that message in itself isn't an issue. It's part of the normal migration process actually; the server will announce what migrations are being done upon start. When you say, "the last one had this error.", could you give slightly more details?

@nathannoble
Copy link

@KtorZ It is all good. IOHK support helped me get over it. Apparently I had to delete the State directory. Something I had done before in older version of Daedalus. I understand these issues are growing pains. So if this happens to anyone else. 1. Delete the State Directory then re import your wallets.

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

No branches or pull requests

4 participants