Jellyfin Bug Report - Database Initialization Failure #7958

Closed
opened 2026-02-07 05:31:10 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @JonathanYoung2161 on GitHub (Dec 29, 2025).

Description of the bug

Fresh Jellyfin 10.11.5 installations intermittently fail to initialize the database schema, resulting in a 0-byte library.db file. The database remains completely empty even after completing the first-time setup wizard and adding media libraries. Library scans report successful completion in logs, but no content appears in the UI and database queries fail with "no such table" errors. This appears to be an Entity Framework Core migration system bug affecting initial database creation. Success rate is approximately 33% on first installation attempt, requiring complete purge and reinstall (often multiple times) to eventually succeed.

Reproduction steps

Reproduction steps

  1. Install Jellyfin 10.11.5 on Ubuntu 24.04 via official repository: sudo apt install jellyfin
  2. Configure custom data paths via systemd override at /etc/systemd/system/jellyfin.service.d/override.conf:
   [Service]
   ExecStart=
   ExecStart=/usr/bin/jellyfin \
       --datadir=/mnt/fileserver/jellyfin/data \
       --configdir=/mnt/fileserver/jellyfin/config \
       --logdir=/var/log/jellyfin \
       --cachedir=/mnt/fileserver/jellyfin/cache \
       --webdir=/usr/share/jellyfin/web \
       --ffmpeg=/usr/lib/jellyfin-ffmpeg/ffmpeg
  1. Create directory structure with correct permissions:
   sudo mkdir -p /mnt/fileserver/jellyfin/{data,config,cache,cache/images}
   sudo chown -R jellyfin:jellyfin /mnt/fileserver/jellyfin
   sudo chmod -R 755 /mnt/fileserver/jellyfin
  1. Reload systemd and start Jellyfin:
   sudo systemctl daemon-reload
   sudo systemctl start jellyfin
  1. Access web UI at http://10.0.1.14:8096
  2. Complete first-time setup wizard:
    • Create admin user
    • Add media library: /media/videos/movies (Movies)
    • Add media library: /media/videos/tv-shows (Shows)
    • Complete setup
  3. Trigger library scan via Dashboard → Libraries → Scan Library
  4. Wait for scan completion (logs show "Scan Media Library Completed")
  5. Check database file size:
   ls -lh /mnt/fileserver/jellyfin/data/data/library.db
  1. Attempt to query database:
    sudo sqlite3 /mnt/fileserver/jellyfin/data/data/library.db ".tables"
    sudo sqlite3 /mnt/fileserver/jellyfin/data/data/library.db \
        "SELECT COUNT(*) FROM TypedBaseItems WHERE Type='Series';"

What is the current bug behavior?

  • Database file /mnt/fileserver/jellyfin/data/data/library.db is 0 bytes after setup wizard completion
  • Querying database tables fails:
  $ sudo sqlite3 /mnt/fileserver/jellyfin/data/data/library.db ".tables"
  (returns nothing - no tables exist)
  
  $ sudo sqlite3 /mnt/fileserver/jellyfin/data/data/library.db \
      "SELECT COUNT(*) FROM TypedBaseItems WHERE Type='Series';"
  Error: in prepare, no such table: TypedBaseItems
  • Library scans complete successfully in logs but UI shows 0 movies, 0 shows
  • No media content appears in Jellyfin web interface despite scan completion messages
  • No errors visible in journalctl -u jellyfin logs - service appears to function normally
  • Database schema tables (TypedBaseItems, Ancestors, __EFMigrationsHistory, etc.) are never created
  • Web UI is fully accessible and functional except for media library functionality

Frequency: Occurs on approximately 66% of fresh installations (2 out of 3 attempts failed with 0-byte database, 1 succeeded with normal database initialization). Same configuration used for all attempts - only difference is success/failure appears random.

Evidence:

$ ls -lh /mnt/fileserver/jellyfin/data/data/library.db
-rw-r--r-- 1 root root 0 Dec 28 18:50 /mnt/fileserver/jellyfin/data/data/library.db

$ sudo sqlite3 /mnt/fileserver/jellyfin/data/data/library.db ".tables"
(no output - database is empty)

What is the expected correct behavior?

  • Database file should be >5MB after completing setup wizard
  • Database should contain schema tables including:
    • TypedBaseItems (primary media items table)
    • Ancestors
    • AncestorIds
    • __EFMigrationsHistory (migration tracking)
    • Additional schema tables for metadata, users, configuration
  • Library scans should populate database with media content
  • Media should appear in web UI with correct counts (e.g., "86 Movies", "42 Shows")
  • Database queries should succeed:
  $ sudo sqlite3 /mnt/fileserver/jellyfin/data/data/library.db \
      "SELECT COUNT(*) FROM TypedBaseItems WHERE Type='Series';"
  42
  • Consistent behavior across fresh installs with identical configuration

Jellyfin Server version

10.11.5

Specify commit id

No response

Specify unstable release number

No response

Specify version number

No response

Specify the build version

10.11.5-1 (Ubuntu 24.04 package from official Jellyfin repository)

Environment

**OS:** Ubuntu Server 24.04.3 LTS (Noble Numbat)

**Linux Kernel:** 6.14.0-37-generic

**Virtualization:** None (bare metal server)

**Clients:** Firefox 133.0 on Windows 11 (client accessing Jellyfin web UI)

**Browser:** Firefox 133.0

**FFmpeg Version:** jellyfin-ffmpeg7 7.1.3-1 (bundled with Jellyfin package)

**Playback:** Not applicable (bug prevents media from appearing in library, no playback attempted)

**Hardware Acceleration:** none (configured in encoding.xml)

**CPU Model:** 2x Intel Xeon Gold 6148 @ 2.40GHz (40 cores / 80 threads total)

**GPU Model:** None (server has no dedicated GPU)

**Installed Plugins:** None (fresh install, no plugins added)

**Reverse Proxy:** none (direct access via http://10.0.1.14:8096)

**Base URL:** none

**Networking:** Host networking (no Docker/containers)

**Jellyfin Data Storage & Filesystem:**
- Path: `/mnt/fileserver/jellyfin/` (custom path via systemd override)
- Storage: Local RAID 10 array (md4)
- Hardware: 8x Seagate ST1000NX0363 1TB SAS 12Gb/s 10K RPM 2.5" drives
- Filesystem: ext4
- Capacity: 3.6TB total, 3.6TB free
- Mount: `/dev/md4` on `/mnt/fileserver`

**Media Storage & Filesystem:**
- Path: `/media/videos/` (movies and tv-shows subdirectories)
- Storage: Local RAID 5 array (md0)
- Hardware: 3x Toshiba MB6000FEDAU 6TB SAS III drives
- Filesystem: ext4
- Capacity: 11TB total, 8.7TB free
- Mount: `/dev/md0` on `/media`

**External Integrations:** None

**Additional Environment Details:**
- RAM: 64GB ECC DDR4-2400
- Network: 4x Intel X710 10GbE SFP+ (triple LACP bonding)
- Storage Controllers: Intel C620 SATA, Broadcom LSI SAS3008
- Systemd version: 255 (Ubuntu 24.04 default)
- SQLite version: 3.45.1 (Ubuntu 24.04 package)
- .NET Runtime: Bundled with Jellyfin package (no separate installation)

**Permission Verification:**

$ sudo -u jellyfin ls -lh /mnt/fileserver/jellyfin/data/data/
total 0
-rw-r--r-- 1 root root 0 Dec 28 18:50 library.db

$ ls -ld /mnt/fileserver/jellyfin/
drwxr-xr-x 5 jellyfin jellyfin 4096 Dec 28 18:51 /mnt/fileserver/jellyfin/

$ ls -ld /media/videos/
drwxr-xr-x 5 omeganet media-users 4096 Dec 28 17:30 /media/videos/


**Media accessible to jellyfin user:**

$ sudo -u jellyfin ls /media/videos/movies | head -3
Inception (2010).mkv
The Matrix (1999).mkv
Interstellar (2014).mkv

$ sudo -u jellyfin ls /media/videos/tv-shows | head -3
Breaking Bad
Game of Thrones
The Office

Jellyfin logs

## Jellyfin logs

### Startup logs (successful start, database never initializes)

Dec 28 18:51:21 VM-Server001 systemd[1]: Starting jellyfin.service - Jellyfin Media Server...
Dec 28 18:51:21 VM-Server001 jellyfin[1802985]: [18:51:21] [INF] [1] Main: Jellyfin version: 10.11.5
Dec 28 18:51:21 VM-Server001 jellyfin[1802985]: [18:51:21] [INF] [1] Main: Arguments: /usr/bin/jellyfin --datadir=/mnt/fileserver/jellyfin/data --configdir=/mnt/fileserver/jellyfin/config --logdir=/var/log/jellyfin --cachedir=/mnt/fileserver/jellyfin/cache --webdir=/usr/share/jellyfin/web --ffmpeg=/usr/lib/jellyfin-ffmpeg/ffmpeg
Dec 28 18:51:21 VM-Server001 jellyfin[1802985]: [18:51:21] [INF] [1] Main: Operating system: Linux
Dec 28 18:51:21 VM-Server001 jellyfin[1802985]: [18:51:21] [INF] [1] Main: Architecture: X64
Dec 28 18:51:21 VM-Server001 jellyfin[1802985]: [18:51:21] [INF] [1] Main: 64-Bit Process: True
Dec 28 18:51:21 VM-Server001 jellyfin[1802985]: [18:51:21] [INF] [1] Main: User Interactive: True
Dec 28 18:51:21 VM-Server001 jellyfin[1802985]: [18:51:21] [INF] [1] Main: Processor count: 80
Dec 28 18:51:21 VM-Server001 jellyfin[1802985]: [18:51:21] [INF] [1] Main: Program data path: /mnt/fileserver/jellyfin/data
Dec 28 18:51:21 VM-Server001 jellyfin[1802985]: [18:51:21] [INF] [1] Main: Web resources path: /usr/share/jellyfin/web
Dec 28 18:51:21 VM-Server001 jellyfin[1802985]: [18:51:21] [INF] [1] Main: Application directory: /usr/lib/jellyfin/
Dec 28 18:51:22 VM-Server001 systemd[1]: Started jellyfin.service - Jellyfin Media Server.
Dec 28 18:51:23 VM-Server001 jellyfin[1802985]: [18:51:23] [INF] [1] Emby.Server.Implementations.ApplicationHost: Kestrel listening on http://[::]:8096


**NOTE:** No migration errors, no database initialization messages, no failures logged. Service starts normally and appears healthy.

### Library scan logs (reports success but nothing stored)

Dec 28 18:52:22 VM-Server001 jellyfin[1802985]: [18:52:22] [INF] [23] Emby.Server.Implementations.IO.LibraryMonitor: Stopping directory watching for path /media/videos/tv-shows
Dec 28 18:52:22 VM-Server001 jellyfin[1802985]: [18:52:22] [INF] [23] Emby.Server.Implementations.IO.LibraryMonitor: Stopping directory watching for path /media/videos/movies
Dec 28 18:52:22 VM-Server001 jellyfin[1802985]: [18:52:22] [INF] [23] Emby.Server.Implementations.Library.LibraryManager: Validating media library
Dec 28 18:52:23 VM-Server001 jellyfin[1802985]: [18:52:23] [WRN] [23] MediaBrowser.Controller.Entities.BaseItem: Library folder /mnt/fileserver/jellyfin/data/data/playlists is inaccessible or empty, skipping
Dec 28 18:52:47 VM-Server001 jellyfin[1802985]: [18:52:47] [INF] [18] Emby.Server.Implementations.ScheduledTasks.TaskManager: Scan Media Library Completed after 0 minute(s) and 24 seconds
Dec 28 18:52:47 VM-Server001 jellyfin[1802985]: [18:52:47] [INF] [9] Emby.Server.Implementations.IO.LibraryMonitor: Watching directory /media/videos/movies
Dec 28 18:52:47 VM-Server001 jellyfin[1802985]: [18:52:47] [INF] [30] Emby.Server.Implementations.IO.LibraryMonitor: Watching directory /media/videos/tv-shows


**Scan reports completion successfully but database remains 0 bytes - no media was actually stored.**

### Codec warnings during scan (informational - not related to database bug)

Dec 28 18:51:25 VM-Server001 jellyfin[1797738]: Unsupported codec with id 0 for input stream 8
Dec 28 18:51:25 VM-Server001 jellyfin[1799808]: Unsupported codec with id 98310 for input stream 5
Dec 28 18:51:25 VM-Server001 jellyfin[1799808]: Unsupported codec with id 98304 for input stream 6


*(Multiple similar codec warnings for various input streams - these appear to be informational FFmpeg messages during media file probing and are not related to the database initialization failure)*

### Full journalctl output (30 minute window)
Available upon request - no migration errors or database-related errors visible in any logs. Service operates normally except database never initializes.

---

FFmpeg logs


Client / Browser logs

No response

Relevant screenshots or videos

No response

Additional information

Workaround

Complete purge and reinstall procedure (may require 2-3 attempts):

# Stop service
sudo systemctl stop jellyfin

# Purge all packages
sudo apt remove --purge jellyfin jellyfin-server jellyfin-web jellyfin-ffmpeg7 -y
sudo apt autoremove -y

# Remove ALL traces
sudo rm -rf /etc/jellyfin /etc/systemd/system/jellyfin.service.d
sudo rm -rf /var/lib/jellyfin /var/cache/jellyfin /var/log/jellyfin
sudo rm -rf /usr/share/jellyfin /usr/lib/jellyfin
sudo rm -rf /mnt/fileserver/jellyfin/*  # Custom data path

# Reinstall
sudo apt update && sudo apt install jellyfin -y

# Recreate systemd override and directory structure
# (use same configuration as original install)

sudo systemctl daemon-reload
sudo systemctl start jellyfin

# Complete setup wizard again

Usually succeeds on 2nd or 3rd attempt with identical configuration. No code changes needed - simply repeating installation procedure eventually results in successful database initialization.


Additional Notes

Suspected Root Cause: Entity Framework Core migration system fails to create __EFMigrationsHistory table during initial database initialization, preventing all subsequent table creation. Failure is silent (no errors logged) and appears to be a race condition or timing issue.

Impact: Critical for new users - failed first install creates poor initial impression. Unpredictable success rate blocks automated deployments and production migrations from other media servers.

Testing Observations:

  • Does NOT occur consistently with default paths (/var/lib/jellyfin)
  • DOES occur with custom paths via systemd override
  • Permissions verified correct before each installation attempt
  • No disk space issues (3.6TB free on data array, 8.7TB free on media array)
  • No filesystem errors in dmesg or RAID array logs
  • Identical configuration across all 3 installation attempts (2 failed, 1 succeeded)

Suggested Investigation:

  1. Add explicit error logging for Entity Framework Core migration failures
  2. Check for race conditions in database file creation vs schema initialization
  3. Verify database file writability before attempting migration
  4. Add pre-flight validation that creates and deletes test file in data directory
  5. Consider implementing retry logic for migration initialization

Versions Affected:

  • Jellyfin 10.11.5 (confirmed via 3 installation attempts on Dec 28, 2025)
  • Jellyfin 10.11.4 (potentially - not tested)
  • Jellyfin 10.10.x series did NOT exhibit this behavior

This bug has been reproduced 3 times on production hardware with identical configuration. Intermittent failure (66% failure rate) suggests race condition or non-deterministic initialization issue rather than configuration problem.

Originally created by @JonathanYoung2161 on GitHub (Dec 29, 2025). ### Description of the bug Fresh Jellyfin 10.11.5 installations intermittently fail to initialize the database schema, resulting in a 0-byte `library.db` file. The database remains completely empty even after completing the first-time setup wizard and adding media libraries. Library scans report successful completion in logs, but no content appears in the UI and database queries fail with "no such table" errors. This appears to be an Entity Framework Core migration system bug affecting initial database creation. Success rate is approximately 33% on first installation attempt, requiring complete purge and reinstall (often multiple times) to eventually succeed. ### Reproduction steps ## Reproduction steps 1. Install Jellyfin 10.11.5 on Ubuntu 24.04 via official repository: `sudo apt install jellyfin` 2. Configure custom data paths via systemd override at `/etc/systemd/system/jellyfin.service.d/override.conf`: ``` [Service] ExecStart= ExecStart=/usr/bin/jellyfin \ --datadir=/mnt/fileserver/jellyfin/data \ --configdir=/mnt/fileserver/jellyfin/config \ --logdir=/var/log/jellyfin \ --cachedir=/mnt/fileserver/jellyfin/cache \ --webdir=/usr/share/jellyfin/web \ --ffmpeg=/usr/lib/jellyfin-ffmpeg/ffmpeg ``` 3. Create directory structure with correct permissions: ```bash sudo mkdir -p /mnt/fileserver/jellyfin/{data,config,cache,cache/images} sudo chown -R jellyfin:jellyfin /mnt/fileserver/jellyfin sudo chmod -R 755 /mnt/fileserver/jellyfin ``` 4. Reload systemd and start Jellyfin: ```bash sudo systemctl daemon-reload sudo systemctl start jellyfin ``` 5. Access web UI at `http://10.0.1.14:8096` 6. Complete first-time setup wizard: - Create admin user - Add media library: `/media/videos/movies` (Movies) - Add media library: `/media/videos/tv-shows` (Shows) - Complete setup 7. Trigger library scan via Dashboard → Libraries → Scan Library 8. Wait for scan completion (logs show "Scan Media Library Completed") 9. Check database file size: ```bash ls -lh /mnt/fileserver/jellyfin/data/data/library.db ``` 10. Attempt to query database: ```bash sudo sqlite3 /mnt/fileserver/jellyfin/data/data/library.db ".tables" sudo sqlite3 /mnt/fileserver/jellyfin/data/data/library.db \ "SELECT COUNT(*) FROM TypedBaseItems WHERE Type='Series';" ``` ### What is the current _bug_ behavior? - Database file `/mnt/fileserver/jellyfin/data/data/library.db` is **0 bytes** after setup wizard completion - Querying database tables fails: ``` $ sudo sqlite3 /mnt/fileserver/jellyfin/data/data/library.db ".tables" (returns nothing - no tables exist) $ sudo sqlite3 /mnt/fileserver/jellyfin/data/data/library.db \ "SELECT COUNT(*) FROM TypedBaseItems WHERE Type='Series';" Error: in prepare, no such table: TypedBaseItems ``` - Library scans complete successfully in logs but UI shows 0 movies, 0 shows - No media content appears in Jellyfin web interface despite scan completion messages - No errors visible in `journalctl -u jellyfin` logs - service appears to function normally - Database schema tables (`TypedBaseItems`, `Ancestors`, `__EFMigrationsHistory`, etc.) are never created - Web UI is fully accessible and functional except for media library functionality **Frequency:** Occurs on approximately **66% of fresh installations** (2 out of 3 attempts failed with 0-byte database, 1 succeeded with normal database initialization). Same configuration used for all attempts - only difference is success/failure appears random. **Evidence:** ```bash $ ls -lh /mnt/fileserver/jellyfin/data/data/library.db -rw-r--r-- 1 root root 0 Dec 28 18:50 /mnt/fileserver/jellyfin/data/data/library.db $ sudo sqlite3 /mnt/fileserver/jellyfin/data/data/library.db ".tables" (no output - database is empty) ``` ### What is the expected _correct_ behavior? - Database file should be >5MB after completing setup wizard - Database should contain schema tables including: - `TypedBaseItems` (primary media items table) - `Ancestors` - `AncestorIds` - `__EFMigrationsHistory` (migration tracking) - Additional schema tables for metadata, users, configuration - Library scans should populate database with media content - Media should appear in web UI with correct counts (e.g., "86 Movies", "42 Shows") - Database queries should succeed: ```bash $ sudo sqlite3 /mnt/fileserver/jellyfin/data/data/library.db \ "SELECT COUNT(*) FROM TypedBaseItems WHERE Type='Series';" 42 ``` - Consistent behavior across fresh installs with identical configuration ### Jellyfin Server version 10.11.5 ### Specify commit id _No response_ ### Specify unstable release number _No response_ ### Specify version number _No response_ ### Specify the build version 10.11.5-1 (Ubuntu 24.04 package from official Jellyfin repository) ### Environment ```markdown **OS:** Ubuntu Server 24.04.3 LTS (Noble Numbat) **Linux Kernel:** 6.14.0-37-generic **Virtualization:** None (bare metal server) **Clients:** Firefox 133.0 on Windows 11 (client accessing Jellyfin web UI) **Browser:** Firefox 133.0 **FFmpeg Version:** jellyfin-ffmpeg7 7.1.3-1 (bundled with Jellyfin package) **Playback:** Not applicable (bug prevents media from appearing in library, no playback attempted) **Hardware Acceleration:** none (configured in encoding.xml) **CPU Model:** 2x Intel Xeon Gold 6148 @ 2.40GHz (40 cores / 80 threads total) **GPU Model:** None (server has no dedicated GPU) **Installed Plugins:** None (fresh install, no plugins added) **Reverse Proxy:** none (direct access via http://10.0.1.14:8096) **Base URL:** none **Networking:** Host networking (no Docker/containers) **Jellyfin Data Storage & Filesystem:** - Path: `/mnt/fileserver/jellyfin/` (custom path via systemd override) - Storage: Local RAID 10 array (md4) - Hardware: 8x Seagate ST1000NX0363 1TB SAS 12Gb/s 10K RPM 2.5" drives - Filesystem: ext4 - Capacity: 3.6TB total, 3.6TB free - Mount: `/dev/md4` on `/mnt/fileserver` **Media Storage & Filesystem:** - Path: `/media/videos/` (movies and tv-shows subdirectories) - Storage: Local RAID 5 array (md0) - Hardware: 3x Toshiba MB6000FEDAU 6TB SAS III drives - Filesystem: ext4 - Capacity: 11TB total, 8.7TB free - Mount: `/dev/md0` on `/media` **External Integrations:** None **Additional Environment Details:** - RAM: 64GB ECC DDR4-2400 - Network: 4x Intel X710 10GbE SFP+ (triple LACP bonding) - Storage Controllers: Intel C620 SATA, Broadcom LSI SAS3008 - Systemd version: 255 (Ubuntu 24.04 default) - SQLite version: 3.45.1 (Ubuntu 24.04 package) - .NET Runtime: Bundled with Jellyfin package (no separate installation) **Permission Verification:** $ sudo -u jellyfin ls -lh /mnt/fileserver/jellyfin/data/data/ total 0 -rw-r--r-- 1 root root 0 Dec 28 18:50 library.db $ ls -ld /mnt/fileserver/jellyfin/ drwxr-xr-x 5 jellyfin jellyfin 4096 Dec 28 18:51 /mnt/fileserver/jellyfin/ $ ls -ld /media/videos/ drwxr-xr-x 5 omeganet media-users 4096 Dec 28 17:30 /media/videos/ **Media accessible to jellyfin user:** $ sudo -u jellyfin ls /media/videos/movies | head -3 Inception (2010).mkv The Matrix (1999).mkv Interstellar (2014).mkv $ sudo -u jellyfin ls /media/videos/tv-shows | head -3 Breaking Bad Game of Thrones The Office ``` ### Jellyfin logs ```shell ## Jellyfin logs ### Startup logs (successful start, database never initializes) Dec 28 18:51:21 VM-Server001 systemd[1]: Starting jellyfin.service - Jellyfin Media Server... Dec 28 18:51:21 VM-Server001 jellyfin[1802985]: [18:51:21] [INF] [1] Main: Jellyfin version: 10.11.5 Dec 28 18:51:21 VM-Server001 jellyfin[1802985]: [18:51:21] [INF] [1] Main: Arguments: /usr/bin/jellyfin --datadir=/mnt/fileserver/jellyfin/data --configdir=/mnt/fileserver/jellyfin/config --logdir=/var/log/jellyfin --cachedir=/mnt/fileserver/jellyfin/cache --webdir=/usr/share/jellyfin/web --ffmpeg=/usr/lib/jellyfin-ffmpeg/ffmpeg Dec 28 18:51:21 VM-Server001 jellyfin[1802985]: [18:51:21] [INF] [1] Main: Operating system: Linux Dec 28 18:51:21 VM-Server001 jellyfin[1802985]: [18:51:21] [INF] [1] Main: Architecture: X64 Dec 28 18:51:21 VM-Server001 jellyfin[1802985]: [18:51:21] [INF] [1] Main: 64-Bit Process: True Dec 28 18:51:21 VM-Server001 jellyfin[1802985]: [18:51:21] [INF] [1] Main: User Interactive: True Dec 28 18:51:21 VM-Server001 jellyfin[1802985]: [18:51:21] [INF] [1] Main: Processor count: 80 Dec 28 18:51:21 VM-Server001 jellyfin[1802985]: [18:51:21] [INF] [1] Main: Program data path: /mnt/fileserver/jellyfin/data Dec 28 18:51:21 VM-Server001 jellyfin[1802985]: [18:51:21] [INF] [1] Main: Web resources path: /usr/share/jellyfin/web Dec 28 18:51:21 VM-Server001 jellyfin[1802985]: [18:51:21] [INF] [1] Main: Application directory: /usr/lib/jellyfin/ Dec 28 18:51:22 VM-Server001 systemd[1]: Started jellyfin.service - Jellyfin Media Server. Dec 28 18:51:23 VM-Server001 jellyfin[1802985]: [18:51:23] [INF] [1] Emby.Server.Implementations.ApplicationHost: Kestrel listening on http://[::]:8096 **NOTE:** No migration errors, no database initialization messages, no failures logged. Service starts normally and appears healthy. ### Library scan logs (reports success but nothing stored) Dec 28 18:52:22 VM-Server001 jellyfin[1802985]: [18:52:22] [INF] [23] Emby.Server.Implementations.IO.LibraryMonitor: Stopping directory watching for path /media/videos/tv-shows Dec 28 18:52:22 VM-Server001 jellyfin[1802985]: [18:52:22] [INF] [23] Emby.Server.Implementations.IO.LibraryMonitor: Stopping directory watching for path /media/videos/movies Dec 28 18:52:22 VM-Server001 jellyfin[1802985]: [18:52:22] [INF] [23] Emby.Server.Implementations.Library.LibraryManager: Validating media library Dec 28 18:52:23 VM-Server001 jellyfin[1802985]: [18:52:23] [WRN] [23] MediaBrowser.Controller.Entities.BaseItem: Library folder /mnt/fileserver/jellyfin/data/data/playlists is inaccessible or empty, skipping Dec 28 18:52:47 VM-Server001 jellyfin[1802985]: [18:52:47] [INF] [18] Emby.Server.Implementations.ScheduledTasks.TaskManager: Scan Media Library Completed after 0 minute(s) and 24 seconds Dec 28 18:52:47 VM-Server001 jellyfin[1802985]: [18:52:47] [INF] [9] Emby.Server.Implementations.IO.LibraryMonitor: Watching directory /media/videos/movies Dec 28 18:52:47 VM-Server001 jellyfin[1802985]: [18:52:47] [INF] [30] Emby.Server.Implementations.IO.LibraryMonitor: Watching directory /media/videos/tv-shows **Scan reports completion successfully but database remains 0 bytes - no media was actually stored.** ### Codec warnings during scan (informational - not related to database bug) Dec 28 18:51:25 VM-Server001 jellyfin[1797738]: Unsupported codec with id 0 for input stream 8 Dec 28 18:51:25 VM-Server001 jellyfin[1799808]: Unsupported codec with id 98310 for input stream 5 Dec 28 18:51:25 VM-Server001 jellyfin[1799808]: Unsupported codec with id 98304 for input stream 6 *(Multiple similar codec warnings for various input streams - these appear to be informational FFmpeg messages during media file probing and are not related to the database initialization failure)* ### Full journalctl output (30 minute window) Available upon request - no migration errors or database-related errors visible in any logs. Service operates normally except database never initializes. --- ``` ### FFmpeg logs ```shell ``` ### Client / Browser logs _No response_ ### Relevant screenshots or videos _No response_ ### Additional information ## Workaround Complete purge and reinstall procedure (may require 2-3 attempts): ```bash # Stop service sudo systemctl stop jellyfin # Purge all packages sudo apt remove --purge jellyfin jellyfin-server jellyfin-web jellyfin-ffmpeg7 -y sudo apt autoremove -y # Remove ALL traces sudo rm -rf /etc/jellyfin /etc/systemd/system/jellyfin.service.d sudo rm -rf /var/lib/jellyfin /var/cache/jellyfin /var/log/jellyfin sudo rm -rf /usr/share/jellyfin /usr/lib/jellyfin sudo rm -rf /mnt/fileserver/jellyfin/* # Custom data path # Reinstall sudo apt update && sudo apt install jellyfin -y # Recreate systemd override and directory structure # (use same configuration as original install) sudo systemctl daemon-reload sudo systemctl start jellyfin # Complete setup wizard again ``` **Usually succeeds on 2nd or 3rd attempt** with identical configuration. No code changes needed - simply repeating installation procedure eventually results in successful database initialization. --- ## Additional Notes **Suspected Root Cause:** Entity Framework Core migration system fails to create `__EFMigrationsHistory` table during initial database initialization, preventing all subsequent table creation. Failure is silent (no errors logged) and appears to be a race condition or timing issue. **Impact:** Critical for new users - failed first install creates poor initial impression. Unpredictable success rate blocks automated deployments and production migrations from other media servers. **Testing Observations:** - Does NOT occur consistently with default paths (`/var/lib/jellyfin`) - DOES occur with custom paths via systemd override - Permissions verified correct before each installation attempt - No disk space issues (3.6TB free on data array, 8.7TB free on media array) - No filesystem errors in dmesg or RAID array logs - Identical configuration across all 3 installation attempts (2 failed, 1 succeeded) **Suggested Investigation:** 1. Add explicit error logging for Entity Framework Core migration failures 2. Check for race conditions in database file creation vs schema initialization 3. Verify database file writability before attempting migration 4. Add pre-flight validation that creates and deletes test file in data directory 5. Consider implementing retry logic for migration initialization **Versions Affected:** - Jellyfin 10.11.5 (confirmed via 3 installation attempts on Dec 28, 2025) - Jellyfin 10.11.4 (potentially - not tested) - Jellyfin 10.10.x series did NOT exhibit this behavior --- **This bug has been reproduced 3 times on production hardware with identical configuration. Intermittent failure (66% failure rate) suggests race condition or non-deterministic initialization issue rather than configuration problem.**
OVERLORD added the bug label 2026-02-07 05:31:10 +03:00
Author
Owner

@JonathanYoung2161 commented on GitHub (Dec 29, 2025):

After 3 weeks of endless issues I have migrated back to Plex for now. I want to retry Jellyfin in the future!!!

@JonathanYoung2161 commented on GitHub (Dec 29, 2025): After 3 weeks of endless issues I have migrated back to Plex for now. I want to retry Jellyfin in the future!!!
Author
Owner

@theguymadmax commented on GitHub (Jan 2, 2026):

Jellyfin 10.11.x no longer creates a library.db. Everything is now in jellyfin.db

@theguymadmax commented on GitHub (Jan 2, 2026): Jellyfin 10.11.x no longer creates a `library.db`. Everything is now in `jellyfin.db`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#7958