question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] Wallet DB Paths incorrect after DB Upgrade from V1 to V2

See original GitHub issue

What happened?

Think I’ve found a bug in the chia db upgrade that appears to have been partially fixed in 1.6.0, but introducess new “buggy” behavior.

I have three machines with multiple keys that run full_nodes & wallets. Two were upgraded from V1 to V2 using some version prior to 1.6.0. The pre-upgrade DB Path in the wallet: section of config.yaml was database_path: wallet/db/blockchain_wallet_v1_CHALLENGE_KEY.sqlite. After the upgrade the DB Path was: database_path: wallet/db/blockchain_v2_mainnet.sqlite. This hard-coded path resulted in all keys having exactly the same balances & transactions, and only one sqllite DB existed in the wallet DB dir.

Doing a clean chia init results in database_path: wallet/db/blockchain_wallet_v2_CHALLENGE_KEY.sqlite, and a separate sqllite DB for each key.

Today to test I upgraded the third machine DB to 1.6.0 to V2. Post upgrade the DB path was database_path: wallet/db/blockchain_wallet_v1_CHALLENGE_KEY.sqlite - the same as the V1 path. It now correctly generates a sqllite DB per key, HOWEVER, the files in the wallet/db path are named blockchain_wallet_v2_r1_mainnet_<key>.sqllite.

  • So in pre 1.6.0 you get a single hard-coded path and all keys used the one hard coded path.
  • With 1.6.0 and clean init we get the expected path and DB names.
  • With 1.6.0 upgrade it appears the path doesn’t get modified, but the template for the DB names is not honored. The files are ...v2... vs the expected ...v1... names

Version

1.6.0

What platform are you using?

Linux

What ui mode are you using?

CLI

Relevant log output

No response

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kiwihaitchcommented, Sep 27, 2022

Just simply chia db upgrade

On Tue, Sep 27, 2022 at 9:14 AM Arvid Norberg @.***> wrote:

  1. No other arguments on the upgrade command

Can you post the complete command line you ran?

— Reply to this email directly, view it on GitHub https://github.com/Chia-Network/chia-blockchain/issues/13547#issuecomment-1259573227, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADNM5UQHR6LEF3UNGHYJFUTWAL6NVANCNFSM6AAAAAAQWKNBXQ . You are receiving this because you authored the thread.Message ID: @.***>

0reactions
arvidncommented, Sep 30, 2022

it’s quite the mystery. I can’t find any part of the code that alters the wallet database path. The upgrade command updates the full node database path. The way we handle the config file in general is not great though, so it’s possible for changes to be clobbered if another process writes to the file, failing to first read the most recent changes to it.

I can’t see a way for that issue to cause this symptom though.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Known Issues In A TDE Environment (Doc ID 1301365.1)
If a database with tablespace encryption is opened using an incorrect wallet and if the regeneration of the masterkey is attempted, the ...
Read more >
Chia db upgrade - wallets? : r/chia
I notice in the .config it only changes the path when it comes to db path. Not wallet path. also i got a...
Read more >
Release Notes - Flyway by Redgate • Database Migrations ...
2 (2022-09-02). Bug fixes. Fix issue with Flyway not running correctly on Macs with a path that has a space; Added null-check to...
Read more >
Bug listing with status RESOLVED with resolution OBSOLETE ...
Bug :1523 - "[IDEA] Offload work by distributing trivial ebuild maintenance to users, ... Bug:157427 - "Version bump dev-db/c-jdbc to 2.0.2" status:RESOLVED ...
Read more >
Apigee release notes | Apigee X
185849286, java.lang.NoClassDefFoundError in Java Callout after upgrading from 1.3.5 to 1.4.2. After upgrading from Apigee hybrid v1.3.5 to v1.4.2, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found