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

3.48.0 fails to start: Caught std::exception: Sqlite3: INSERT INTO track_backup SELECT id, version, scan_version ... #413

Closed
yurivict opened this issue Jan 30, 2024 · 5 comments
Labels
Milestone

Comments

@yurivict
Copy link

lms-3.47.0 worked fine, but 3.48.0 fails to start, and writes this into the log:

[2024-Jan-29 22:58:44.398] 87559 - [info] "config: reading Wt config file: /var/db/lms/wt_config.xml (location = '/usr/local/bin/lms')"
[2024-Jan-29 22:58:44.402] 87559 - [info] - 0x1f39b9e12000 [UTILS] Starting IO context with 8 threads...
[2024-Jan-29 22:58:44.402] 87559 - [info] - 0x1f39b9e12000 [DB] Creating connection pool on file /var/db/lms/lms.db
[2024-Jan-29 22:58:44.423] 87559 - [info] - 0x1f39b9e12000 [DB] Preparing tables...
[2024-Jan-29 22:58:44.426] 87559 - [info] - 0x1f39b9e12000 [DB] Database version = 50, LMS binary version = 51
[2024-Jan-29 22:58:44.426] 87559 - [info] - 0x1f39b9e12000 [DB] Migrating database from version 50 to 51...
Caught std::exception: Sqlite3: INSERT INTO track_backup SELECT id, version, scan_version, track_number, disc_number, total_track, disc_subtitle, name, duration, bitrate, date, year, original_date, original_year, file_path, file_last_write, file_added, has_cover, mbid, recording_mbid, copyright, copyright_url, track_replay_gain, release_replay_gain, artist_display_name, release_id, 1 FROM track: NOT NULL constraint failed: track_backup.bitrate
__cxa_thread_call_dtors: dtr 0x82cb9e3d0 from unloaded dso, skipping

FreeBSD 14.0

@epoupon
Copy link
Owner

epoupon commented Jan 30, 2024

Could you try to full rescan in 3.47.0 first and then upgrade?

@flroppy
Copy link

flroppy commented Feb 3, 2024

I had the same error when upgrading from a very old version, and doing what @epoupon suggested of doing a rescan in 3.47.0 and then upgrading fixed it. Thanks!

@epoupon
Copy link
Owner

epoupon commented Feb 3, 2024

Ok thanks for the test.
Will fix that clunky migration for the next release.

@yurivict
Copy link
Author

yurivict commented Feb 3, 2024

lms should maintain the DB schema version and it should be able to upgrade DB correctly by itself.

@Maxmystere
Copy link

Maxmystere commented Feb 4, 2024

In case it's needed here is the error output

sqlite> pragma integrity_check;
wrong # of entries in index listen_user_track_backend_date_time_idx
wrong # of entries in index listen_track_user_backend_idx

Following this website doing REINDEX; fixed the crash then I did a full rescan

@epoupon epoupon added the bug label Feb 4, 2024
@epoupon epoupon added this to the v3.49.0 milestone Feb 4, 2024
@epoupon epoupon closed this as completed Feb 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants