• Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below
  • Forum
  • Website
  • GitHub
  • Status
  • Translation
  • Features
  • Team
  • Rules
  • Help
  • Feeds
User Links
  • Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below

    Useful Links Forum Website GitHub Status Translation Features Team Rules Help Feeds
    Jellyfin Forum Support Troubleshooting Media Scanning & Identification SOLVED: Database Lock prevents new media from being scanned in

     
    • 0 Vote(s) - 0 Average

    SOLVED: Database Lock prevents new media from being scanned in

    Over 200+ missing movies and tv show episodes missing due to database lock
    Ellermw
    Offline

    Junior Member

    Posts: 7
    Threads: 2
    Joined: 2025 Jun
    Reputation: 0
    #1
    Yesterday, 09:09 PM
    The logs show constant database is locked errors.  Because of this a lot of new media just isn't being picked up.  I end up having to use Claude to force the database to add these pieces of media otherwise it locks up and doesn't add in new content.

    Should I change it from NoLock to Pessimistic?  I remember during that during one of the 10.11.X betas.

    I'm currently on 10.11.5, running in linux (ubuntu 22.04 LTS).
    Go to solution
    Ellermw
    Offline

    Junior Member

    Posts: 7
    Threads: 2
    Joined: 2025 Jun
    Reputation: 0
    #2
    Yesterday, 09:18 PM (This post was last modified: Yesterday, 11:13 PM by Ellermw. Edited 1 time in total.)
    Ok so Pessimistic wasn't the move. It then causes query congestion, meaning if a library scan is in process, it locks/blocks UI queries... so you can't even load Jellyfin's home page.

    Some of the errors from the logs when it was set to NoLock

    Bash(journalctl -u jellyfin --since "2 minutes ago" 2>/dev/null | tail -30)
    ⎿ Dec 19 21:12:43 LXCJellyfin jellyfin[833181]: Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 19: 'UNIQUE constraint failed: UserDat
    a.ItemId, UserData.UserId, UserData.CustomDataKey'.
    Dec 19 21:12:43 LXCJellyfin jellyfin[833181]: at Microsoft.Data.Sqlite.SqliteDataReader.NextResult()

    Going to try Optimistic now instead of Pessimistic for the DB Locking behavior

    Also like to note that I have my parallel tasks limited to 2 for both.
    Ellermw
    Offline

    Junior Member

    Posts: 7
    Threads: 2
    Joined: 2025 Jun
    Reputation: 0
    #3
    Yesterday, 09:48 PM (This post was last modified: Yesterday, 09:56 PM by Ellermw. Edited 2 times in total.)
    I've also started to notice that Jellyfin is also not removing entries from the database for pieces of media that are no longer there. Along with it doesn't discover new series.

    **Ignore this. I can't delete this comment. It seems it is, kinda of. I see several FFMEG probe errors for tv show episodes I no longer have, but they still exist in the db. So I don't know
    Ellermw
    Offline

    Junior Member

    Posts: 7
    Threads: 2
    Joined: 2025 Jun
    Reputation: 0
    #4
    Yesterday, 10:33 PM
    Bug report generated by Claude:

    Bug Report: Library scan not discovering new symlinked folders

    Jellyfin Version: 10.11.5

    Environment:
    - Ubuntu 22.04.5 LTS
    - x64 architecture
    - SQLite database with Optimistic locking
    - Media stored on network storage (Ceph), accessed via symlinks on local ext4 filesystem

    Problem Description:

    Library scans are not discovering new symlinked folders. The scan only refreshes existing database entries but does not enumerate the filesystem to find new content.

    Timeline:
    - Last successfully added series: November 27, 2025
    - 95+ symlinks created after this date exist on disk but are NOT in the database
    - All scans since then have failed to discover these new folders

    What I've verified:
    - All symlinks are valid and accessible
    - The jellyfin user has read permissions to all symlinks and their targets
    - sudo -u jellyfin ls "/path/to/symlinked/folder/" works correctly
    - inotify limits are sufficient (max_user_watches: 4194304)
    - Library configuration is correct with single path entry
    - EnableRealtimeMonitor is true

    Reproduction steps:
    1. Have a TV library pointing to a directory containing symlinks to network storage
    2. Create new symlinks in that directory
    3. Run a library scan
    4. New symlinks are not discovered or added to the database

    Additional observation:

    When I manually insert database entries for the missing symlinked series using SQL, Jellyfin removes them during the "Validating media library" phase at startup. The log shows:

    [INF] Validating media library
    [INF] Removing item, Type: Series, Name: [Series Name], Path: /path/to/symlink, Id: [uuid]

    This suggests the validation code also cannot "see" the symlinks, even though they are valid and readable.

    Expected behavior:
    Library scan should enumerate all folders (including symlinks) in the library path and add new ones to the database.

    Actual behavior:
    Library scan only iterates over existing database entries. New symlinked folders are never discovered, and manually-added entries are removed during validation.

    Logs showing the issue:

    During scan, I see "Running enqueue of items in library [Library Name]" but no new series are added. The scan proceeds to refresh existing items only.

    At startup, "Validating media library" removes entries for valid symlinks:
    [INF] Stopping directory watching for path /media/TV
    [INF] Validating media library
    [INF] Removing item, Type: Series, Name: [Show1], Path: /media/TV/[Show1]
    [INF] Removing item, Type: Series, Name: [Show2], Path: /media/TV/[Show2]
    ...

    Workarounds attempted:
    - Creating a new library pointing to the same path - shares same folder entry, doesn't help
    - Multiple server restarts
    - Multiple library scans
    - Manual SQL insertion (entries get removed by validation)
    Ellermw
    Offline

    Junior Member

    Posts: 7
    Threads: 2
    Joined: 2025 Jun
    Reputation: 0
    #5
    7 hours ago
    I believe I fixed this. It appears the DateCreated field for the folder entry for a library media path was empty, possibly from a past migration. By fixing this field, it fixed it's ability to detect and add new media.
    « Next Oldest | Next Newest »

    Users browsing this thread: 1 Guest(s)


    • View a Printable Version
    • Subscribe to this thread
    Forum Jump:

    Home · Team · Help · Contact
    © Designed by D&D - Powered by MyBB
    L


    Jellyfin

    The Free Software Media System

    Linear Mode
    Threaded Mode