Jellyfin Forum
Database is locked - Jellyfin 10.9.8 - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: Troubleshooting (https://forum.jellyfin.org/f-troubleshooting)
+--- Thread: Database is locked - Jellyfin 10.9.8 (/t-database-is-locked-jellyfin-10-9-8)



Database is locked - Jellyfin 10.9.8 - Ammer Ashraf Emon - 2024-08-02

I am facing this issue every few hours "SQLite Error 5: 'database is locked'." When this happens I have to restart the jellyfin service. My media libraries are shared from a NAS and mounted to the VM. I tried to increase the values of ulimit in Linux, but nothing solved this issue. Any help would be appreciated. Thanks.

OS: Ubuntu 22.04 LTS
Jellyfin Version: 10.9.8

Logs:
[2024-08-02 18:01:57.700 +06:00] [ERR] [3675] Microsoft.EntityFrameworkCore.Update: An exception occurred in the database while saving changes for context type '"Jellyfin.Server.Implementations.JellyfinDbContext"'."
""Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while saving the entity changes. See the inner exception for details.
---> Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 5: 'database is locked'.
  at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
  at Microsoft.Data.Sqlite.SqliteDataReader.NextResult()
  at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
  at Microsoft.Data.Sqlite.SqliteCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
  at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
  at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
  at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken)
  --- End of inner exception stack trace ---
  at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken)
  at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken)
  at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable
1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken)


RE: Database is locked - Jellyfin 10.9.8 - Efficient_Good_5784 - 2024-08-02

1. Is the drive that Jellyfin's config folder is installed on running out of space?

2. Did you ever upgrade to any v10.9.# release and immediately restart or shut down the server right after the update was done?


RE: Database is locked - Jellyfin 10.9.8 - Ammer Ashraf Emon - 2024-08-02

1. No it has sufficient available space, more than 200GB
2. I am not sure, I am upgrading to every 10.9 version since the release.


RE: Database is locked - Jellyfin 10.9.8 - TheDreadPirate - 2024-08-02

Is this from a restart from the dasbharod or from a systemctl restart/stop/start?

And what plugins do you have installed? I had issues with the playback reporting plugin causing occasional database lock issues when initiating a restart from the dashboard.


RE: Database is locked - Jellyfin 10.9.8 - Ammer Ashraf Emon - 2024-08-02

I restart the jellyfin from the terminal using systemctl restart, I can not access jellyfin web when this happens. Normally when this occurs, the 'thr' number in 'htop' gets higher(I have seen minimum 2000-15000+) and keeps increasing.
I had playback reporting plugin installed previously, to figure out this issue I uninstalled relevant plugins.

I have a VM with 12core and 16GB RAM where Jellyfin is installed, and nothing else is running in this VM.

I think I will remove the VM and start everything fresh. It will be a lot of work to reorganize everything again. But I will do it again to solve this issue.