• 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 General Questions Cleanup after deleted library

     
    • 0 Vote(s) - 0 Average

    Cleanup after deleted library

    ajp_anton
    Offline

    Junior Member

    Posts: 7
    Threads: 3
    Joined: 2024 Jun
    Reputation: 0
    Country:Finland
    #1
    2025-02-03, 01:59 PM
    I just deleted a library, but it seems that it didn't clean up anything. All the metadata files and all the entries in the database that belonged to this library are still present. How do I go back to how it was before this library was added?

    Alternatively, because this was the only library I had, how do I preserve all server settings and plugins if I just start over? Although this feels more like a workaround to a problem I'm going to encounter again in the future.
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,375
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #2
    2025-02-03, 02:10 PM
    There are scheduled jobs that will clean most of that up. Optimize Database, cache cleanup, etc.

    What OS is Jellyfin running on? If Linux, is it installed directly in Linux or are you using Docker?
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    ajp_anton
    Offline

    Junior Member

    Posts: 7
    Threads: 3
    Joined: 2024 Jun
    Reputation: 0
    Country:Finland
    #3
    2025-02-03, 02:29 PM
    (2025-02-03, 02:10 PM)TheDreadPirate Wrote: There are scheduled jobs that will clean most of that up.  Optimize Database, cache cleanup, etc.

    What OS is Jellyfin running on?  If Linux, is it installed directly in Linux or are you using Docker?
    I'm using Docker (on Linux).

    I tried running those manually now, and the metadata directory was almost cleared. Some lyrics files are still there left by the lrclib plugin, but I'm not sure if that's the responsibility of the plugin and not something you can control.

    The database still contains everything though. And going to Home, My Media still shows everything I had. The Dashboard's Libraries is empty, as that's where I deleted the library.

    Manually running Scan Media Library fails. Logs has the following:
    Code:
    [2025-02-03 14:19:04.876 +00:00] [ERR] [51] MediaBrowser.Controller.Entities.BaseItem: Error refreshing owned items for "/config/root/default/LibraryName"
    System.IO.DirectoryNotFoundException: Could not find a part of the path '/config/root/default/LibraryName'.
      at System.IO.Enumeration.FileSystemEnumerator`1.Init()
      at System.IO.Enumeration.FileSystemEnumerableFactory.FileSystemInfos(String directory, String expression, EnumerationOptions options, Boolean isNormalized)
      at System.IO.DirectoryInfo.InternalEnumerateInfos(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options)
      at Emby.Server.Implementations.IO.ManagedFileSystem.GetFileSystemEntries(String path, Boolean recursive)
      at MediaBrowser.Controller.Providers.DirectoryService.<>c.<GetFileSystemEntries>b__5_0(String p, IFileSystem fileSystem)
      at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd[TArg](TKey key, Func`3 valueFactory, TArg factoryArgument)
      at MediaBrowser.Controller.Providers.DirectoryService.GetFileSystemEntries(String path)
      at MediaBrowser.Controller.IO.FileData.GetFilteredFileSystemEntries(IDirectoryService directoryService, String path, IFileSystem fileSystem, IServerApplicationHost appHost, ILogger logger, ItemResolveArgs args, Int32 flattenFolderDepth, Boolean resolveShortcuts)
      at MediaBrowser.Controller.Entities.CollectionFolder.CreateResolveArgs(IDirectoryService directoryService, Boolean setPhysicalLocations)
      at MediaBrowser.Controller.Entities.CollectionFolder.GetFileSystemChildren(IDirectoryService directoryService)
      at MediaBrowser.Controller.Entities.BaseItem.RefreshMetadata(MetadataRefreshOptions options, CancellationToken cancellationToken)
    [2025-02-03 14:19:04.877 +00:00] [ERR] [51] Emby.Server.Implementations.ScheduledTasks.TaskManager: Error executing Scheduled Task
    System.IO.DirectoryNotFoundException: Could not find a part of the path '/config/root/default/LibraryName'.
      at System.IO.Enumeration.FileSystemEnumerator`1.Init()
      at System.IO.Enumeration.FileSystemEnumerableFactory.FileSystemInfos(String directory, String expression, EnumerationOptions options, Boolean isNormalized)
      at System.IO.DirectoryInfo.InternalEnumerateInfos(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options)
      at Emby.Server.Implementations.IO.ManagedFileSystem.GetFileSystemEntries(String path, Boolean recursive)
      at MediaBrowser.Controller.Providers.DirectoryService.<>c.<GetFileSystemEntries>b__5_0(String p, IFileSystem fileSystem)
      at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd[TArg](TKey key, Func`3 valueFactory, TArg factoryArgument)
      at MediaBrowser.Controller.Providers.DirectoryService.GetFileSystemEntries(String path)
      at MediaBrowser.Controller.IO.FileData.GetFilteredFileSystemEntries(IDirectoryService directoryService, String path, IFileSystem fileSystem, IServerApplicationHost appHost, ILogger logger, ItemResolveArgs args, Int32 flattenFolderDepth, Boolean resolveShortcuts)
      at MediaBrowser.Controller.Entities.CollectionFolder.CreateResolveArgs(IDirectoryService directoryService, Boolean setPhysicalLocations)
      at MediaBrowser.Controller.Entities.CollectionFolder.RequiresRefresh()
      at MediaBrowser.Providers.Manager.MetadataService`2.RefreshMetadata(BaseItem item, MetadataRefreshOptions refreshOptions, CancellationToken cancellationToken)
      at MediaBrowser.Controller.Entities.BaseItem.RefreshMetadata(MetadataRefreshOptions options, CancellationToken cancellationToken)
      at Emby.Server.Implementations.Library.LibraryManager.ValidateTopLibraryFolders(CancellationToken cancellationToken, Boolean removeRoot)
      at Emby.Server.Implementations.Library.LibraryManager.PerformLibraryValidation(IProgress`1 progress, CancellationToken cancellationToken)
      at Emby.Server.Implementations.Library.LibraryManager.ValidateMediaLibraryInternal(IProgress`1 progress, CancellationToken cancellationToken)
      at Emby.Server.Implementations.ScheduledTasks.ScheduledTaskWorker.ExecuteInternal(TaskOptions options)
    [2025-02-03 14:19:04.878 +00:00] [INF] [51] Emby.Server.Implementations.ScheduledTasks.TaskManager: "Scan Media Library" Failed after 0 minute(s) and 0 seconds
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,375
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #4
    2025-02-03, 02:48 PM
    Can you share your full log via privatebin.net? The database entries should have been cleared.

    Regarding your backup question. Wherever you mounted /config is the only folder you need to backup to restore jellyfin. You should also backup and restore /cache, but that isn't required.
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,375
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #5
    2025-02-03, 10:47 PM
    For anyone following, OP sent me their logs via PM.

    Can you re-create the library with exactly the same name then delete it again?
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    ajp_anton
    Offline

    Junior Member

    Posts: 7
    Threads: 3
    Joined: 2024 Jun
    Reputation: 0
    Country:Finland
    #6
    2025-02-04, 07:15 AM
    (2025-02-03, 10:47 PM)TheDreadPirate Wrote: Can you re-create the library with exactly the same name then delete it again?
    It worked, thanks. I also thought of this, but wasn't sure if libraries are stored as the library name, or as a unique ID.

    Since the original library contained 20k files that took forever to scan, I created the new one with a slightly smaller subset. This replaced the old library in Home with the new one (meaning the 20k files from before were replaced with the ~10 in the new one).
    Then I removed it, which again removed it from Dashboard but not from Home. This time, however, a simple restart of the server cleared Home. The database file remained huge, but a docker compose down -> up cleared that as well.
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,375
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #7
    2025-02-04, 01:51 PM
    I think most databases work this way. They don't immediately cleaning up/"vacuum"/compact their database files.
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    « 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