First startup endless loop with db error - orphanFelix - 2025-08-26
Hi,
I am having trouble starting JellyFin for the first time.
I run docker compose up. Scrolling text happens.
Then this happens:
Code: jellyfin | [22:05:30] [INF] [4] Emby.Server.Implementations.ApplicationHost: There are pending EFCore migrations in the database. Applying... (This may take a while, do not stop Jellyfin)
jellyfin | [22:06:00] [ERR] [4] Microsoft.EntityFrameworkCore.Database.Command: Failed executing DbCommand (30,147ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
jellyfin | PRAGMA journal_mode = 'wal';
jellyfin | [22:06:00] [FTL] [4] Main: Error while starting server
jellyfin | Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 5: 'database is locked'.
jellyfin | at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
jellyfin | at Microsoft.Data.Sqlite.SqliteDataReader.NextResult()
jellyfin | at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
jellyfin | at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader()
jellyfin | at Microsoft.Data.Sqlite.SqliteCommand.ExecuteNonQuery()
jellyfin | at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQuery(RelationalCommandParameterObject parameterObject)
jellyfin | at Microsoft.EntityFrameworkCore.Sqlite.Storage.Internal.SqliteDatabaseCreator.Create()
jellyfin | at Microsoft.EntityFrameworkCore.Storage.RelationalDatabaseCreator.CreateAsync(CancellationToken cancellationToken)
jellyfin | at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.MigrateAsync(String targetMigration, CancellationToken cancellationToken)
jellyfin | at Emby.Server.Implementations.ApplicationHost.InitializeServices()
jellyfin | at Emby.Server.Implementations.ApplicationHost.InitializeServices()
jellyfin | at Jellyfin.Server.Program.StartServer(IServerApplicationPaths appPaths, StartupOptions options, IConfiguration startupConfig)
jellyfin | [22:06:00] [INF] [4] Main: Running query planner optimizations in the database... This might take a while
After that it seems to retry.
Different but also db related error happens:
Code: jellyfin | [22:06:03] [INF] [1] Emby.Server.Implementations.ApplicationHost: There are pending EFCore migrations in the database. Applying... (This may take a while, do not stop Jellyfin)
jellyfin | [22:06:33] [ERR] [1] Microsoft.EntityFrameworkCore.Database.Command: Failed executing DbCommand (30,010ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
jellyfin | CREATE TABLE "__EFMigrationsHistory" (
jellyfin | "MigrationId" TEXT NOT NULL CONSTRAINT "PK___EFMigrationsHistory" PRIMARY KEY,
jellyfin | "ProductVersion" TEXT NOT NULL
jellyfin | );
jellyfin | [22:06:33] [FTL] [1] Main: Error while starting server
jellyfin | Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 5: 'database is locked'.
jellyfin | at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
jellyfin | at Microsoft.Data.Sqlite.SqliteDataReader.NextResult()
jellyfin | at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
jellyfin | at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader()
jellyfin | at Microsoft.Data.Sqlite.SqliteCommand.ExecuteNonQuery()
jellyfin | at System.Data.Common.DbCommand.ExecuteNonQueryAsync(CancellationToken cancellationToken)
jellyfin | --- End of stack trace from previous location ---
jellyfin | at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQueryAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
jellyfin | at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQueryAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
jellyfin | at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQueryAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
jellyfin | at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.MigrateAsync(String targetMigration, CancellationToken cancellationToken)
jellyfin | at Emby.Server.Implementations.ApplicationHost.InitializeServices()
jellyfin | at Emby.Server.Implementations.ApplicationHost.InitializeServices()
jellyfin | at Jellyfin.Server.Program.StartServer(IServerApplicationPaths appPaths, StartupOptions options, IConfiguration startupConfig)
jellyfin | [22:06:33] [INF] [1] Main: Running query planner optimizations in the database... This might take a while
Then this runs in a loop forever.
I think what happens is that it tries to write something to the db about it being a fresh install.
It fails to do that properly, then reruns but then fails to write completly because the previous write messed up.
Any idea how to approach this?
Basic info about the system:
jellyfin | **** permissions for /dev/dri/renderD128 are good ****
jellyfin | **** permissions for /dev/dri/card1 are good ****
jellyfin | **** permissions for /dev/dri/card0 are good ****
jellyfin | [custom-init] No custom files found, skipping...
jellyfin | [22:05:29] [INF] [4] Main: Jellyfin version: 10.10.7
jellyfin | [22:05:29] [INF] [4] Main: Environment Variables: ["[JELLYFIN_CONFIG_DIR, /config]", "[JELLYFIN_WEB_DIR, /usr/share/jellyfin/web]", "[JELLYFIN_LOG_DIR, /config/log]", "[JELLYFIN_DATA_DIR, /config/data]", "[JELLYFIN_CACHE_DIR, /config/cache]"]
jellyfin | [22:05:29] [INF] [4] Main: Arguments: ["/usr/lib/jellyfin/bin/jellyfin.dll", "--ffmpeg=/usr/lib/jellyfin-ffmpeg/ffmpeg"]
jellyfin | [22:05:29] [INF] [4] Main: Operating system: Ubuntu 24.04.3 LTS
jellyfin | [22:05:29] [INF] [4] Main: Architecture: X64
jellyfin | [22:05:29] [INF] [4] Main: 64-Bit Process: True
jellyfin | [22:05:29] [INF] [4] Main: User Interactive: True
jellyfin | [22:05:29] [INF] [4] Main: Processor count: 4
jellyfin | [22:05:29] [INF] [4] Main: Program data path: /config/data
jellyfin | [22:05:29] [INF] [4] Main: Log directory path: /config/log
jellyfin | [22:05:29] [INF] [4] Main: Config directory path: /config
jellyfin | [22:05:29] [INF] [4] Main: Cache path: /config/cache
jellyfin | [22:05:29] [INF] [4] Main: Temp directory path: /tmp/jellyfin
jellyfin | [22:05:29] [INF] [4] Main: Web resources path: /usr/share/jellyfin/web
jellyfin | [22:05:29] [INF] [4] Main: Application directory: /usr/lib/jellyfin/bin/
RE: First startup endless loop with db error - orphanFelix - 2025-08-26
Well, I got it working basically right after posting.
Everything was on a network drive.
After moving everything to a local drive it immediatly worked.
So jellyfin itself local. Movies and stuff can still be network drive and added later.
|