DB locked when moving from arm Docker to x64 Docker #1704

Closed
opened 2026-02-06 21:16:18 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @Spomyx on GitHub (May 17, 2020).

Describe the bug
I wanted to have a kubernetes deployment capable of moving my Jellyfin container between arm and x64 hosts machines but the databased initialy created on the arm host appears locked in the logs when trying to start the container on the x64 server.
When moving the container back to the arm host it works again.
I obviously don't try to have the same db running on different hosts simlutaneously

System (please complete the following information):

  • OS: Ubuntu and Debian
  • Virtualization: Docker / Kubernetes
  • Clients: any
  • Browser: Chrome 81
  • Jellyfin Version: 10.5.5
  • Playback: n/a
  • Installed Plugins: none
  • Reverse Proxy: nginx
  • Base URL: /jellyfin
  • Networking: local network
  • Storage: CIFS mounts

To Reproduce

  1. Start a jellyfin docker container on arm host with persistent config directory
  2. Shutdown the container and create another one with the same peristent config directory on a x86_64 host
  3. The container doesn't start and received SIGTERM because database is locked

Expected behavior
The container starts with the existing configuration regardless of the host architecture

Logs
[2020-05-17 20:29:35.131 +00:00] [INF] [1] Main: Arguments: ["/jellyfin/jellyfin.dll", "--datadir", "/config", "--cachedir", "/cache", "--ffmpeg", "/usr/lib/jellyfin-ffmpeg/ffmpeg"]
[2020-05-17 20:29:35.133 +00:00] [INF] [1] Main: Operating system: "Linux"
[2020-05-17 20:29:35.133 +00:00] [INF] [1] Main: Architecture: X64
[2020-05-17 20:29:35.134 +00:00] [INF] [1] Main: 64-Bit Process: True
[2020-05-17 20:29:35.134 +00:00] [INF] [1] Main: User Interactive: True
[2020-05-17 20:29:35.134 +00:00] [INF] [1] Main: Processor count: 8
[2020-05-17 20:29:35.134 +00:00] [INF] [1] Main: Program data path: "/config"
[2020-05-17 20:29:35.134 +00:00] [INF] [1] Main: Web resources path: "/jellyfin/jellyfin-web"
[2020-05-17 20:29:35.134 +00:00] [INF] [1] Main: Application directory: "/jellyfin/"
[2020-05-17 20:29:35.285 +00:00] [INF] [1] ServerConfigurationManager: Setting cache path: "/cache"
[2020-05-17 20:29:35.308 +00:00] [INF] [1] App: Loading assemblies
[2020-05-17 20:29:35.409 +00:00] [FTL] [1] Main: Error while starting server.
Busy: SQLitePCL.pretty.SQLiteException: database is locked
at SQLitePCL.pretty.SQLiteException.Throw(Int32 rc, Int32 extended, String msg)
at SQLitePCL.pretty.SQLiteException.CheckOk(sqlite3 db, Int32 rc)
at SQLitePCL.pretty.SQLiteException.CheckOk(sqlite3_stmt stmt, Int32 rc)
at SQLitePCL.pretty.StatementImpl.MoveNext()
at SQLitePCL.pretty.DatabaseConnection.Execute(IDatabaseConnection This, String sql)
at Emby.Server.Implementations.Data.BaseSqliteRepository.GetConnection(Boolean _)
at Emby.Server.Implementations.Security.AuthenticationRepository.Initialize()
at Emby.Server.Implementations.ApplicationHost.GetAuthenticationRepository()
at Emby.Server.Implementations.ApplicationHost.RegisterResources(IServiceCollection serviceCollection)
at Emby.Server.Implementations.ApplicationHost.InitAsync(IServiceCollection serviceCollection)
at Jellyfin.Server.Program.StartApp(StartupOptions options)
[2020-05-17 20:29:35.416 +00:00] [INF] [1] App: Disposing "CoreAppHost"
[2020-05-17 20:29:35.417 +00:00] [INF] [2] Main: Received a SIGTERM signal, shutting down

Originally created by @Spomyx on GitHub (May 17, 2020). **Describe the bug** I wanted to have a kubernetes deployment capable of moving my Jellyfin container between arm and x64 hosts machines but the databased initialy created on the arm host appears locked in the logs when trying to start the container on the x64 server. When moving the container back to the arm host it works again. I obviously don't try to have the same db running on different hosts simlutaneously **System (please complete the following information):** - OS: Ubuntu and Debian - Virtualization: Docker / Kubernetes - Clients: any - Browser: Chrome 81 - Jellyfin Version: 10.5.5 - Playback: n/a - Installed Plugins: none - Reverse Proxy: nginx - Base URL: /jellyfin - Networking: local network - Storage: CIFS mounts **To Reproduce** 1. Start a jellyfin docker container on arm host with persistent config directory 2. Shutdown the container and create another one with the same peristent config directory on a x86_64 host 3. The container doesn't start and received SIGTERM because database is locked **Expected behavior** The container starts with the existing configuration regardless of the host architecture **Logs** [2020-05-17 20:29:35.131 +00:00] [INF] [1] Main: Arguments: ["/jellyfin/jellyfin.dll", "--datadir", "/config", "--cachedir", "/cache", "--ffmpeg", "/usr/lib/jellyfin-ffmpeg/ffmpeg"] [2020-05-17 20:29:35.133 +00:00] [INF] [1] Main: Operating system: "Linux" [2020-05-17 20:29:35.133 +00:00] [INF] [1] Main: Architecture: X64 [2020-05-17 20:29:35.134 +00:00] [INF] [1] Main: 64-Bit Process: True [2020-05-17 20:29:35.134 +00:00] [INF] [1] Main: User Interactive: True [2020-05-17 20:29:35.134 +00:00] [INF] [1] Main: Processor count: 8 [2020-05-17 20:29:35.134 +00:00] [INF] [1] Main: Program data path: "/config" [2020-05-17 20:29:35.134 +00:00] [INF] [1] Main: Web resources path: "/jellyfin/jellyfin-web" [2020-05-17 20:29:35.134 +00:00] [INF] [1] Main: Application directory: "/jellyfin/" [2020-05-17 20:29:35.285 +00:00] [INF] [1] ServerConfigurationManager: Setting cache path: "/cache" [2020-05-17 20:29:35.308 +00:00] [INF] [1] App: Loading assemblies [2020-05-17 20:29:35.409 +00:00] [FTL] [1] Main: Error while starting server. Busy: SQLitePCL.pretty.SQLiteException: database is locked at SQLitePCL.pretty.SQLiteException.Throw(Int32 rc, Int32 extended, String msg) at SQLitePCL.pretty.SQLiteException.CheckOk(sqlite3 db, Int32 rc) at SQLitePCL.pretty.SQLiteException.CheckOk(sqlite3_stmt stmt, Int32 rc) at SQLitePCL.pretty.StatementImpl.MoveNext() at SQLitePCL.pretty.DatabaseConnection.Execute(IDatabaseConnection This, String sql) at Emby.Server.Implementations.Data.BaseSqliteRepository.GetConnection(Boolean _) at Emby.Server.Implementations.Security.AuthenticationRepository.Initialize() at Emby.Server.Implementations.ApplicationHost.GetAuthenticationRepository() at Emby.Server.Implementations.ApplicationHost.RegisterResources(IServiceCollection serviceCollection) at Emby.Server.Implementations.ApplicationHost.InitAsync(IServiceCollection serviceCollection) at Jellyfin.Server.Program.StartApp(StartupOptions options) [2020-05-17 20:29:35.416 +00:00] [INF] [1] App: Disposing "CoreAppHost" [2020-05-17 20:29:35.417 +00:00] [INF] [2] Main: Received a SIGTERM signal, shutting down
OVERLORD added the bugstale labels 2026-02-06 21:16:18 +03:00
Author
Owner

@Spomyx commented on GitHub (Jun 1, 2020):

After testing it seems not related to the architecture of the host.
It seems that deleting a container doesn't release the database properly.
The ongoing work on multi database support may resolve the issue even if it doesn't really deals with the problem

My conclusion is that the current version of jellyfin doesn't support a failover on a different machine after unexpected outage.
Regarding my container i don't even know how to stop it gracefuly since it's restarting if i try to shut it down using the dashboard. Edit: managed to shut it down through dashboard but db still isn't released properly

My SQLite knowledge doesn't allow me to properly release the db in order to use it in a different machine

@Spomyx commented on GitHub (Jun 1, 2020): After testing it seems not related to the architecture of the host. It seems that deleting a container doesn't release the database properly. The ongoing work on multi database support may resolve the issue even if it doesn't really deals with the problem My conclusion is that the current version of jellyfin doesn't support a failover on a different machine after unexpected outage. Regarding my container i don't even know how to stop it gracefuly since it's restarting if i try to shut it down using the dashboard. Edit: managed to shut it down through dashboard but db still isn't released properly My SQLite knowledge doesn't allow me to properly release the db in order to use it in a different machine
Author
Owner

@stale[bot] commented on GitHub (Sep 30, 2020):

This issue has gone 120 days without comment. To avoid abandoned issues, it will be closed in 21 days if there are no new comments.
If you're the original submitter of this issue, please comment confirming if this issue still affects you in the latest release or nightlies, or close the issue if it has been fixed. If you're another user also affected by this bug, please comment confirming so. Either action will remove the stale label.
This bot exists to prevent issues from becoming stale and forgotten. Jellyfin is always moving forward, and bugs are often fixed as side effects of other changes. We therefore ask that bug report authors remain vigilant about their issues to ensure they are closed if fixed, or re-confirmed - perhaps with fresh logs or reproduction examples - regularly. If you have any questions you can reach us on Matrix or Social Media.

@stale[bot] commented on GitHub (Sep 30, 2020): This issue has gone 120 days without comment. To avoid abandoned issues, it will be closed in 21 days if there are no new comments. If you're the original submitter of this issue, please comment confirming if this issue still affects you in the latest release or nightlies, or close the issue if it has been fixed. If you're another user also affected by this bug, please comment confirming so. Either action will remove the stale label. This bot exists to prevent issues from becoming stale and forgotten. Jellyfin is always moving forward, and bugs are often fixed as side effects of other changes. We therefore ask that bug report authors remain vigilant about their issues to ensure they are closed if fixed, or re-confirmed - perhaps with fresh logs or reproduction examples - regularly. If you have any questions you can reach us on [Matrix or Social Media](https://docs.jellyfin.org/general/getting-help.html).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#1704