Jellyfin Forum
Library Scan Fails 10.9.0 - 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: Library Scan Fails 10.9.0 (/t-library-scan-fails-10-9-0)

Pages: 1 2


Library Scan Fails 10.9.0 - lechevaliernoir - 2024-03-28

Build version: jellyfin-server_2024032505+deb12_amd64.deb
Unstable, upgraded from 10.8.3

I created a library, "Shows2", then went to the dashboard and removed it. After removing it, it still is displayed under "My Media" on the home page. Additionally, library scans are now failing with the log info listed below. I have been looking through the library.db to find where this is saved in order to remove reference to it, but am unable to find the pertinent information. Any ideas how I can remove these? 

[2024-03-28 08:36:33.473 -09:00] [INF] Validating media library
[2024-03-28 08:36:33.611 -09:00] [WRN] Library folder "/var/lib/jellyfin/data/playlists" is inaccessible or empty, skipping
[2024-03-28 08:36:33.651 -09:00] [ERR] Error refreshing owned items for "/var/lib/jellyfin/root/default/Shows2"
System.IO.DirectoryNotFoundException: Could not find a part of the path '/var/lib/jellyfin/root/default/Shows2'.
  at System.IO.Enumeration.FileSystemEnumerator1.Init()
  at System.IO.Enumeration.FileSystemEnumerable
1..ctor(String directory, FindTransform transform, EnumerationOptions options, Boolean isNormalized)
  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.ConcurrentDictionary2.GetOrAdd[TArg](TKey key, Func3 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)
[2024-03-28 08:36:33.653 -09:00] [ERR] Error executing Scheduled Task
System.IO.DirectoryNotFoundException: Could not find a part of the path '/var/lib/jellyfin/root/default/Shows2'.
  at System.IO.Enumeration.FileSystemEnumerator1.Init()
  at System.IO.Enumeration.FileSystemEnumerable
1..ctor(String directory, FindTransform transform, EnumerationOptions options, Boolean isNormalized)
  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.ConcurrentDictionary2.GetOrAdd[TArg](TKey key, Func3 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


RE: Library Scan Fails 10.9.0 - TheDreadPirate - 2024-03-28

Stop jellyfin and go to /var/lib/jellyfin/root/default/ and delete the "Shows2" folder in there.


RE: Library Scan Fails 10.9.0 - lechevaliernoir - 2024-03-28

I actually did check that directory. After removing the library from Administration>Dashboard>Libraries, the folder has disappeared from /var/lib/jellyfin/root/default/ but still shows up under "My Media" on the homepage and as a folder under Administration>Metadata. That's why I started looking through database files and figured it was worth reporting.

Edit: Also, I do appreciate your prompt review and reply!


RE: Library Scan Fails 10.9.0 - TheDreadPirate - 2024-03-28

AFAIK, /var/lib/jellyfin/root/default/ is where JF stores folders that represent libraries. If it didn't clean up the DB that is definitely a reportable issue.

https://github.com/jellyfin/jellyfin/issues

I don't see one that sounds like yours. Provide as much information and logs as you can.


RE: Library Scan Fails 10.9.0 - 素兮若雪 - 2024-04-05

(2024-03-28, 11:59 PM)TheDreadPirate Wrote: AFAIK, /var/lib/jellyfin/root/default/ is where JF stores folders that represent libraries.  If it didn't clean up the DB that is definitely a reportable issue.

https://github.com/jellyfin/jellyfin/issues

I don't see one that sounds like yours.  Provide as much information and logs as you can.

I also encountered it on 10.9.0, and 100% triggered a bug, so I can no longer scan the repository. You can try renaming any media library. This bug is 100% triggered. Please prepare for testing as the database will be damaged and unable to scan media. Optimizing the database is invalid.
The corresponding repository configuration file will not be created under the directory where media configuration is stored, such as/configure/root/default


RE: Library Scan Fails 10.9.0 - acn - 2024-05-14

Had the same problem after recent upgrade to 10.9.1 (linux host, official docker image).
System.IO.DirectoryNotFoundException: Could not find a part of the path '/config/data/root/default/TV Shows'.
I was able to solve it by updating a couple of rows in database library.db, as explained in this ticket:
https://github.com/jellyfin/jellyfin/issues/7576#issuecomment-1094171148
Path /config/data/root/default/ is wrong and in should be /config/root/default/.
In retrospect a couple of months ago did a migration from LSIO docker image to official. Their image uses exactly that path (/config/data/root/default/) for library definitions :-)
It was working fine for a couple of months until official image got upgraded to 10.9.
How did the old path get used in the database I'm not going to investigate but now all is working fine :-)


RE: Library Scan Fails 10.9.0 - TheDreadPirate - 2024-05-14

When you migrated from the LSIO to official image, did you start from scratch or did you use your existing /config directory? Because the two images do not use identical directory layouts, which would explain what you experienced.


RE: Library Scan Fails 10.9.0 - acn - 2024-05-14

Old LSIO container was purged and fresh pulled from JF repo. Moved/rsynced content from LSIO to the JF directory structure. Directories were correctly mapped in my docker-compose.yaml.
This ticket gave me the idea, but I think it's not entirely accurate: https://github.com/jellyfin/jellyfin/issues/3717
It was working fine for 2 months, pulled some minor upgrades to the container, new content was scanned to the library.
I don't know how but it was working Grinning-face
Upgrade to the 10.9.x was fine, only found out after a day or two that the library refresh is not working.
Attached a screenshot from TypedBaseItems table in library.db with the wrong entries.


RE: Library Scan Fails 10.9.0 - TheDreadPirate - 2024-05-14

I'm talking about the contents of /config, like your database and metadata. Were they purged? Or did you re-use those files?


RE: Library Scan Fails 10.9.0 - acn - 2024-05-17

Sorry if I wasn't clear. It was reused.
I didn't want to have to rescan the whole library.