Skip to content

[bug]: don't warn user about existing/old bbolt DB if they have selected SQLite and the .sqlite files exist #9708

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

Open
ZZiigguurraatt opened this issue Apr 14, 2025 · 1 comment
Labels
bug Unintended code behaviour migration

Comments

@ZZiigguurraatt
Copy link

After using lndinit migrate-db, when I startup lnd with --lnd.db.backend=sqlite --lnd.db.use-native-sql I get the following information in the log:

2025-04-14 05:32:01.152 [INF] LTND: Opening the main database, this might take a few minutes...
2025-04-14 05:32:01.229 [WRN] LTND: Found existing bbolt database file in /home/litd/.lnd/data/chain/bitcoin/regtest/wallet.db while using database type sqlite. Existing data will NOT be migrated to sqlite automatically!
2025-04-14 05:32:01.229 [WRN] LTND: Found existing bbolt database file in /home/litd/.lnd/data/graph/regtest/channel.db while using database type sqlite. Existing data will NOT be migrated to sqlite automatically!

This is a bit confusing and unnecessary information. I think it should only look for a bbolt DB and inform the user of its existence if the user has requested a SQLite DB AND the SQLite DB does not actually exist (likely because they never ran lndinit migrate-db yet). Also, if we do do these checks because the SQLite DB doesn't exist and we are trying to warn the user of what they actually have, we should also check for macaroons.db and sphinxreplay.db.

@Dhiren-Mhatre
Copy link

Just submitted a PR to fix this. I added checks so warnings only appear when there's no SQLite file yet. Should work for all the DB types mentioned in the issue. Let me know if you need any changes!

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

No branches or pull requests

3 participants