SQLite Error: database is locked - 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: SQLite Error: database is locked (/t-sqlite-error-database-is-locked) |
SQLite Error: database is locked - happyvoid - 2024-06-11 After using SynoCommunity packager for a few years with 10.8 running ok, after runnnig into issues with 10.9 switched to Docker setup on a Synology 218+. This is a new setup using the following docker_compose.yml file: Code: services: Added folders from the three different shares to Library. Let Jellyfin sit, scan and do it's thing for a few days. It seems scans and Audio Normalisation have finished. But whenever trying to access Jellyfin there is a lot of audible accessing going on on the NAS to the point where everything seems to lockup (two hhds on a 218+, no NVMe). Clicking menu items e.g. like Scheduled Tasks just shows the spinner and no info ever loads. Same is true trying to access home. Sometimes the items load, but it is slow to a point where the library is not usable. Looking at the logs, database is locked does not sound great:Code: [2024-06-11 06:23:54.110 +02:00] [ERR] [279] Jellyfin.Api.Middleware.ExceptionMiddleware: Error processing request. URL "POST" "/Users/AuthenticateByName". More log: https://bin.disroot.org/?ce008bc32593b7a2#JB6MnkFTsFkSoeJRe8YxGKpnGGSaA5tZkTSeDgtnf98N (1 month) Was unsure about Code: [2024-06-11 06:13:45.194 +02:00] [INF] [257] Jellyfin.Api.Auth.CustomAuthenticationHandler: "CustomAuthentication" was not authenticated. Failure message: "Invalid token." Any idea what I am doing wrong or why the NAS chokes up? I know this isn't an ideal setup performance wise. But in the past this worked on acceptable level using v10.8 and the SynoCommunity package. RE: SQLite Error: database is locked - crobibero - 2024-06-11 Please upgrade to 10.9.6. If you are already on 10.9.6 we would need a full log, not just the exception. RE: SQLite Error: database is locked - happyvoid - 2024-06-11 Thanks for taking a look. This is 10.9.6. Full log: https://bin.disroot.org/?4db311bd04dfb923#7pxcRt2nSSgMLi3uSApFG1pwuBcQ76Rmbr6B7DQKr3VG There's some logging in going on as I migrated client apps to the new server on a few devices. RE: SQLite Error: database is locked - pcm - 2024-06-11 I kept having this *exactly same* issue too. I had (have) this issue on 1.9.2 and 1.9.3 (my current) and I had to change "Parallel library scan tasks limit" to 1 (it's 0 by default, which will set the number of scans to number of cpu-threads your computer can run). And that fixed the issue for me because now there is only one thread doing the library scan and writing to library.db file and hence no way to do get into a race condition/deadlock ... Not the most performant solution but got the job done for me. Be aware that your scans will take a lot longer but they'll complete guaranteed. You can find 'Parallel library scan tasks limit' config setting under "general" section in your admin-dashboard. RE: SQLite Error: database is locked - happyvoid - 2024-06-14 Thanks for sharing your suggestion to change Parallel library scan tasks limit to 1. I tried that, while it may have helped, it did not resolve the overall slowness I was encountering.What did help was setting an environment variable for the docker container: 1. stopped the docker project 2. in the environment: section of the docker-compose-yml file I added the line - JELLYFIN_SQLITE__disableSecondLevelCache=true 3. re-build docker project This did help and Jellyfin was in usable state for a while. Currently though I am again seeing the problematic errors in the log, so I was wrong thinking this was no longer a problem and sadly both the change for scan tasks and the env var did not resolve the issue:
1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken)at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable 1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken) 1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken)at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(IList 1 entriesToSave, CancellationToken cancellationToken)
RE: SQLite Error: database is locked - gnattu - 2024-06-14 More likely you will need https://github.com/jellyfin/jellyfin/pull/11901 merged for your issue as 2nd level cache works badly for your setup and need a device cache to be implemented separately. |