• 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 Library Scan doesn't remove missing media

     
    • 0 Vote(s) - 0 Average

    Library Scan doesn't remove missing media

    Cannot get Jellyfin to update library after manually removing/renaming media from the filesystem
    Builder Bob
    Offline

    Junior Member

    Posts: 2
    Threads: 1
    Joined: 2025 Dec
    Reputation: 0
    Country:United States
    #1
    2025-12-05, 02:30 AM
    This is my first foray into Jellyfin and I must be doing something wrong because when I delete a video from my harddrive nothing I do can get Jellyfin to remove the video from it's library, so I'm hoping some knowledgeable soul can point me in the right direction.


    Context:

    Installed latest Docker instance of Jellyfin, pointed it at a NAS with ReadOnly permissions. Initial scan worked fine but caused me to notice that at some point in the past I'd managed to end up with lots of duplicated videos. So I went through and sifted through all the duplicates removing the ones I didn't want and then re-scanned the library in the expectation that Jellyfin would remove the missing videos from my library and update the remaining records when I renamed things. Sadly no amount of re-scanning, restarting, or even removing the library and adding it back seemed to do so. I did have some success when deleting things one at a time via the Jellyfin UI, but have been to scared to test that in cases where I renamed the file but still wanted to keep it, as the prompt suggested it was going to try and delete the folder (even though it is supposed to be in Read Only mode). Ultimately I ended up deleting the entire container and starting over, which was fine up until I realized I'd missed some files. >.< So now I'm back here because I need to figure out how to work around this if I'm going to be able to use Jellyfin going forward.

    When looking into the log file I see it complaining about "SQLite Error 19: 'UNIQUE constraint failed: UserData.ItemId, UserData.UserId, UserData.CustomDataKey'" But I'm not sure how I'm intended to prevent that in the first place, as the videos all follow pretty vanilla Radarr/Sonarr naming conventions. Full snippet of relevant logs below.


    Quote:[2025-12-04 15:31:42.115 -08:00] [INF] [84] Emby.Server.Implementations.Library.LibraryManager: Removing item, Type: "Folder", Name: "Video I Legally Own (2014)", Path: "/movies/Video I Legally Own (2014)", Id: 02059e1f-3233-4f68-81c9-295efbfba677
    [2025-12-04 15:31:42.123 -08:00] [ERR] [84] Microsoft.EntityFrameworkCore.Database.Command: Failed executing DbCommand ("0"ms) [Parameters=["@__date_1='?' (DbType = DateTime), @__p_0='?' (Size = 196)"], CommandType='Text', CommandTimeout='30']"
    ""UPDATE \"UserData\" AS \"u\"
    SET \"ItemId\" = '00000000-0000-0000-0000-000000000001',
        \"RetentionDate\" = @__date_1
    WHERE \"u\".\"ItemId\" IN (
        SELECT \"p\".\"value\"
        FROM json_each(@__p_0) AS \"p\"
    )"
    [2025-12-04 15:31:42.124 -08:00] [ERR] [84] Microsoft.EntityFrameworkCore.Query: An exception occurred while executing an 'ExecuteUpdate' operation for context type '"Jellyfin.Database.Implementations.JellyfinDbContext"'."
    ""Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 19: 'UNIQUE constraint failed: UserData.ItemId, UserData.UserId, UserData.CustomDataKey'.
      at Microsoft.Data.Sqlite.SqliteDataReader.NextResult()
      at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
      at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQuery(RelationalCommandParameterObject parameterObject)
      at Microsoft.EntityFrameworkCore.Query.RelationalShapedQueryCompilingExpressionVisitor.<>c.<NonQueryResult>b__31_0(DbContext _, ValueTuple3 state)
      at Microsoft.EntityFrameworkCore.Query.RelationalShapedQueryCompilingExpressionVisitor.NonQueryResult(RelationalQueryContext relationalQueryContext, RelationalCommandResolver relationalCommandResolver, Type contextType, CommandSource commandSource, Boolean threadSafetyChecksEnabled)"
    Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 19: 'UNIQUE constraint failed: UserData.ItemId, UserData.UserId, UserData.CustomDataKey'.
      at Microsoft.Data.Sqlite.SqliteDataReader.NextResult()
      at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
      at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQuery(RelationalCommandParameterObject parameterObject)
      at Microsoft.EntityFrameworkCore.Query.RelationalShapedQueryCompilingExpressionVisitor.<>c.<NonQueryResult>b__31_0(DbContext _, ValueTuple
    3 state)
      at Microsoft.EntityFrameworkCore.Query.RelationalShapedQueryCompilingExpressionVisitor.NonQueryResult(RelationalQueryContext relationalQueryContext, RelationalCommandResolver relationalCommandResolver, Type contextType, CommandSource commandSource, Boolean threadSafetyChecksEnabled)
      at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.ExecuteCore[TResult](Expression query, Boolean async, CancellationToken cancellationToken)
      at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.Execute[TResult](Expression query)
      at Jellyfin.Server.Implementations.Item.BaseItemRepository.DeleteItem(IReadOnlyList1 ids)
      at Emby.Server.Implementations.Library.LibraryManager.DeleteItem(BaseItem item, DeleteOptions options, BaseItem parent, Boolean notifyParentItem)
      at MediaBrowser.Controller.Entities.Folder.ValidateChildrenInternal2(IProgress
    1 progress, Boolean recursive, Boolean refreshChildMetadata, Boolean allowRemoveRoot, MetadataRefreshOptions refreshOptions, IDirectoryService directoryService, CancellationToken cancellationToken)
    [2025-12-04 15:31:42.124 -08:00] [ERR] [84] MediaBrowser.Controller.LibraryTaskScheduler.LimitedConcurrencyLibraryScheduler: Error while performing a library operation
    Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 19: 'UNIQUE constraint failed: UserData.ItemId, UserData.UserId, UserData.CustomDataKey'.
      at Microsoft.Data.Sqlite.SqliteDataReader.NextResult()
      at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
      at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQuery(RelationalCommandParameterObject parameterObject)
      at Microsoft.EntityFrameworkCore.Query.RelationalShapedQueryCompilingExpressionVisitor.<>c.<NonQueryResult>b__31_0(DbContext _, ValueTuple3 state)
      at Microsoft.EntityFrameworkCore.Query.RelationalShapedQueryCompilingExpressionVisitor.NonQueryResult(RelationalQueryContext relationalQueryContext, RelationalCommandResolver relationalCommandResolver, Type contextType, CommandSource commandSource, Boolean threadSafetyChecksEnabled)
      at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.ExecuteCore[TResult](Expression query, Boolean async, CancellationToken cancellationToken)
      at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.Execute[TResult](Expression query)
      at Jellyfin.Server.Implementations.Item.BaseItemRepository.DeleteItem(IReadOnlyList
    1 ids)
      at Emby.Server.Implementations.Library.LibraryManager.DeleteItem(BaseItem item, DeleteOptions options, BaseItem parent, Boolean notifyParentItem)
      at MediaBrowser.Controller.Entities.Folder.ValidateChildrenInternal2(IProgress1 progress, Boolean recursive, Boolean refreshChildMetadata, Boolean allowRemoveRoot, MetadataRefreshOptions refreshOptions, IDirectoryService directoryService, CancellationToken cancellationToken)
      at MediaBrowser.Controller.Entities.Folder.ValidateChildrenInternal(IProgress
    1 progress, Boolean recursive, Boolean refreshChildMetadata, Boolean allowRemoveRoot, MetadataRefreshOptions refreshOptions, IDirectoryService directoryService, CancellationToken cancellationToken)
      at MediaBrowser.Controller.LibraryTaskScheduler.LimitedConcurrencyLibraryScheduler.ProcessItem(TaskQueueItem item)
    RestaurantMarsupial
    Offline

    Junior Member

    Posts: 5
    Threads: 3
    Joined: 2025 Oct
    Reputation: 0
    Country:United Kingdom
    #2
    2025-12-09, 12:43 PM (This post was last modified: 2025-12-09, 04:45 PM by RestaurantMarsupial. Edited 2 times in total.)
    Unfortunately I can't help you but just wanted to state I'm having the same issue despite having a different set-up to yours. I hope there's some fix! I suppose in terms of issues to have it's not the worst but damn it's annoying to see those broken items in the library lol.

    EDIT: I would just like to point out that this has also only happened to me where I've had a "duplicate" of a film. In my case, sometimes I have to Remux a video to change the audio codec so I end up with two (almost) identical copies of a video. Then, for some reason, on 3 separate occasions, I've deleted both of them and yet they've stubbornly stuck in my Jellyfin library.
    Builder Bob
    Offline

    Junior Member

    Posts: 2
    Threads: 1
    Joined: 2025 Dec
    Reputation: 0
    Country:United States
    #3
    2025-12-09, 09:32 PM
    Thanks for at least confirming that I'm not just doing something obviously wrong! And to add to your edit, I should confirm I've only noticed this behaviour for certain with the movies I had "duplicates" of, I hadn't really been paying close attention to any other variations just because I had more duplicates than files I just wanted to remove.

    Does this mean I cannot use Jellyfin for tracking different copies of the same media? Like if I've got a favorite DVD imported so I can watch the extras but also a newer BR version to rewatch at higher quality, or a 3D and non 3D version of the same film? I get that it would work the first time, but it seems like if I ever got inspired to re-encode either with a newer codec that they'd just break?
    « Next Oldest | Next Newest »

    Users browsing this thread:


    • 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