From 48133a63cb0097762e8750ae3c461e1f49c8df88 Mon Sep 17 00:00:00 2001 From: Gsyleric Date: Sun, 24 May 2026 14:36:28 +0200 Subject: [PATCH] Upload files to "/" --- README_jellyfin_sqlite_wal.md | 91 +++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 README_jellyfin_sqlite_wal.md diff --git a/README_jellyfin_sqlite_wal.md b/README_jellyfin_sqlite_wal.md new file mode 100644 index 0000000..bce8f11 --- /dev/null +++ b/README_jellyfin_sqlite_wal.md @@ -0,0 +1,91 @@ +# Jellyfin – Incident SQLite WAL (2026-05-24) + +**LXC :** 20308096 +**Version :** Jellyfin 10.11.9 + +--- + +## Symptôme + +Jellyfin injoignable, forcé de rebooter le LXC depuis PVE. + +--- + +## Cause + +La tâche planifiée `OptimizeDatabaseTask` a déclenché un `PRAGMA wal_checkpoint(TRUNCATE)` en interne. +Le checkpoint s'est bloqué pendant **64 minutes** (3 844 360 ms) puis a crashé avec : + +``` +System.IndexOutOfRangeException + at Jellyfin.Database.Implementations.Locking.OptimisticLockBehavior +``` + +Bug connu Jellyfin sur SQLite. Le WAL n'a jamais été fusionné → fichier WAL de 25 MB au moment du diagnostic. +La DB elle-même est **intègre** (`PRAGMA integrity_check` = `ok`). + +--- + +## Fix appliqué + +```bash +systemctl stop jellyfin +sqlite3 /var/lib/jellyfin/data/jellyfin.db "PRAGMA wal_checkpoint(TRUNCATE);" +# résultat attendu : 0|0|0 +systemctl start jellyfin +``` + +--- + +## Prévention + +### 1. Mode journal SQLite → DELETE + +Passage du mode WAL au mode DELETE, qui élimine l'accumulation du fichier WAL : + +```bash +systemctl stop jellyfin +sqlite3 /var/lib/jellyfin/data/jellyfin.db "PRAGMA journal_mode=DELETE;" +systemctl start jellyfin +``` + +Vérification (Jellyfin démarré) : + +```bash +sqlite3 /var/lib/jellyfin/data/jellyfin.db "PRAGMA journal_mode;" +# attendu : delete +``` + +Jellyfin 10.11.9 ne force pas le retour en WAL — le mode `delete` persiste après restart. ✓ + +### 2. Cron (root, LXC jellyfin) + +```cron +10 12 * * * /usr/bin/systemctl reboot +``` + +Reboot quotidien à 12h10. La ligne de checkpoint WAL a été supprimée (inutile en mode DELETE). + +### 3. UI Jellyfin + +Dashboard → Tâches planifiées → **Optimize Database** → déclencheur automatique désactivé. + +--- + +## Fichiers concernés + +### Avant (au moment du crash) + +| Fichier | Taille | Notes | +|---|---|---| +| `jellyfin.db` | 1.9 GB | DB principale, intègre | +| `jellyfin.db-wal` | 25 MB | WAL bloqué, non fusionné | +| `jellyfin.db-shm` | 64 KB | Shared memory WAL | + +### Après (solution appliquée) + +| Fichier | Taille | Notes | +|---|---|---| +| `jellyfin.db` | 1.9 GB | Inchangée | +| `jellyfin.db-wal` | — | Absent (mode DELETE) | +| `jellyfin.db-shm` | — | Absent (mode DELETE) |