brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: LockingBehavior in database.xml is the fix for Jellyfin Database Locked errors

Arr-suite
~/tips/tip-jellyfin-database-xml-locking-behavior

cat ~/tips/tip-jellyfin-database-xml-locking-behavior.md

Switch the SQLite locking mode to Optimistic when scans fail with Database Locked in the log.

Failed library scans with a Database Locked error in the log are a known Jellyfin problem. The docs have a ladder of fixes, and the first rung is not the database file.

First, lower the parallel library scan task limit in the admin dashboard. The docs say that if it is set to 0, you should set it to half your cores. If that does not help, change the locking mode. Stop the server, open database.xml in the configuration directory, and edit the LockingBehavior value:

<?xml version="1.0" encoding="utf-8"?>
<DatabaseConfigurationOptions>
  <DatabaseType>Jellyfin-SQLite</DatabaseType>
  <LockingBehavior>Optimistic</LockingBehavior>
</DatabaseConfigurationOptions>

Start the server again afterwards. The docs list three modes. NoLock is the default and works for most people. Optimistic attempts all writes and retries them when they fail. Pessimistic blocks all reads while any write is happening.

The caveat is the last mode. The docs say Pessimistic has a significant performance impact and recommend it only when Optimistic does not help. They also note that on LXC, if the errors stay after switching to Optimistic, the team suggests moving to a virtual machine or Docker.

I’d keep a copy of the whole file before editing it. The example in the docs has namespace attributes on the root element, which I left out above, so keep whatever your own file has and change only that one value.

Further reading: Jellyfin troubleshooting: database locked errors

Going deeper: Guide: the Bazarr settings that matter, from languages to the minimum score

More Arr-suite tips Scene S01E01-E02-E03 Minimum Seeders Add {edition-{Edition Tags}} to the Radarr movie format for director's cuts Sonarr: None, Local Release, UTC Release Date Prowlarr does not sync download clients, so add one only for searches inside Prowlarr All Arr-suite tips (56) All topics

Link