SQLite FTS4aux regression causes LMS to delete and rebuild a valid music database
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
Read Slim/Plugin/FullTextSearch/Plugin.pm around _initPopularTerms() and Slim/Schema/Storage::throw_exception(), then reproduce the reported FTS4aux query against SQLite 3.53.2 or later. Trace how the auxiliary table error reaches the database rebuild path. Done when an auxiliary search failure no longer causes a valid library.db to be deleted, while the failure is logged and LMS can continue where possible.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Note: English is not my native language, so I used AI assistance to help translate and structure this report. However, all tests described below were performed by me on my own system, and I personally verified the results. This is a real, reproducible issue, not an AI-generated assumption.
SQLite FTS4aux regression causes LMS to delete and rebuild a valid music database
Environment
Lyrion Music Server 9.1.1
Fedora 45, x86_64
Perl 5.44
SQLite 3.53.4
DBD::SQLite 1.78
Problem
Lyrion Music Server treats an SQLite SQLITE_CORRUPT error originating from its FTS4 auxiliary table as corruption of the entire music database.
As a result, LMS attempts to delete and rebuild library.db, even though the underlying problem is an SQLite regression and not actual database corruption.
Root cause
SQLite introduced an FTS4aux regression between versions 3.53.1 and 3.53.2.
The issue is reproducible independently of LMS, Perl, or Fedora-specific SQLite patches.
Minimal SQLite reproducer:
CREATE VIRTUAL TABLE ft USING fts4(c1,c2,c3);
INSERT INTO ft VALUES ('Depeche Mode','Depeche Mode','Depeche Mode');
CREATE VIRTUAL TABLE aux USING fts4aux(ft);
SELECT term, col, documents FROM aux LIMIT 10;Results:
SQLite version | Result -- | -- 3.52.0 | Works 3.53.0 | Works 3.53.1 | Works 3.53.2 | SQLITE_CORRUPT 3.53.4 | SQLITE_CORRUPTThese versions were tested using official SQLite source distributions.
LMS failure
During initialization, Slim::Plugin::FullTextSearch::Plugin::_initPopularTerms() executes a query against fulltext_terms, an FTS4aux virtual table.
The query fails with:
DBD::SQLite::db selectcol_arrayref failed:
database disk image is malformedThe exception reaches Slim::Schema::Storage::throw_exception(), which logs:
Trying to rebuild /var/lib/lyrionmusicserver/cache/library.db from scratch.The existing music database is then removed, and subsequent queries fail with errors such as:
no such table: tracksIn my case, the server failed to initialize correctly and the music library had to be rebuilt.
Workaround
I temporarily added an early return to _initPopularTerms() in Slim/Plugin/FullTextSearch/Plugin.pm:
sub _initPopularTerms {
return; # Temporary workaround for SQLite FTS4aux regression
my $scanDone = shift;After applying this workaround, LMS started successfully and completed a full library scan of 38,732 tracks.
The full-text index was built successfully, and album artwork including dynamic resizing worked again.
Suggested improvement
Even if SQLite is responsible for returning the incorrect corruption error, LMS should ideally avoid deleting the entire music database based solely on an error from an auxiliary full-text search table.
Possible improvements:
Handle errors from
fts4auxseparately from errors indicating corruption of the main database.Preserve the existing
library.dbwhen an auxiliary index query fails.Log the failure and allow the server to continue with reduced search functionality where possible.
The underlying SQLite regression has also been reported upstream.
- Lingua principale
- Perl
- Stelle
- 1.8k
- Fork
- 389
- Merge medio
- 1g 4h
- PR unite (30g)
- 10
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di LMS-Community/slimserver
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 67/100
LMS-Community/slimserver#1742 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
LMS-Community/slimserver#1555 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
CPAN modules for Perl 5.44Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
LMS-Community/slimserver#1744 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Serve a static FLAC DASH manifest as a FLAC streamForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 42/100
LMS-Community/slimserver#1741 · 5 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
compatibility
Difficoltà 4/5 3-5 giorni Idoneità per principianti 22/100
LMS-Community/slimserver#1739 · 6 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di LMS-Community/slimserver
Issue simili
-
area:cpan-port area:performance bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
fglock/PerlOnJava#2230 ·
I maintainer di solito rispondono entro 1 giorno
-
Make logo .svgApertadocumentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
larchanka/ppc-code-ai-agent#38 ·
I maintainer di solito rispondono entro 1 giorno
-
[doc] perlsub wrongly says that `"sub { ... }" creates a new subroutine each time it is executed'Apertadocumentation Needs Triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 69/100
I maintainer di solito rispondono entro 1 giorno
-
docs(api): /api/v3/external_sources spec is missing lc and section_titleForse già presa @subhwastaken l’ha presa oggi. Aperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 82/100
openfoodfacts/openfoodfacts-server#15626 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100