2025-06-15, 05:44 PM
Hey,
I just noticed that jellyfin doesn't delete empty collections.
Example of correct collection xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Item>
<ContentRating>FSK-12</ContentRating>
<Added>03/18/2025 17:19:56</Added>
<LockData>false</LockData>
<Overview>Collection XYZ.</Overview>
<LocalTitle>Example123</LocalTitle>
<PremiereDate>2018-12-07</PremiereDate>
<DisplayOrder>PremiereDate</DisplayOrder>
<ProductionYear>2018</ProductionYear>
<TmdbId>573693</TmdbId>
<Genres>
<Genre>Action</Genre>
<Genre>Abenteuer</Genre>
<Genre>Fantasy</Genre>
</Genres>
<Studios>
<Studio> XYZ </Studio>
<Studio> XYZ </Studio>
<Studio> XYZ </Studio>
<Studio> XYZ </Studio>
<Studio> XYZ </Studio>
</Studios>
<CollectionItems>
<CollectionItem>
<Path>/arr/movies/Collection XYZ - Example123 (201
/Example123(201
[imdbid-tt1477834] - [Remux-2160p][DV HDR10][TrueHD Atmos 7.1][HEVC]-pmHD.mkv</Path>
</CollectionItem>
<CollectionItem>
<Path>/arr/movies/ Collection XYZ - Example1234 (201
/Example1234(201
(2023) [imdbid-tt9663764] - Imax [Bluray-2160p][DV HDR10][TrueHD Atmos 7.1][x265]-iND.mkv</Path>
</CollectionItem>
</CollectionItems>
</Item>
Example of bad collection.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Item>
<Added>05/23/2025 15:28:31</Added>
<LockData>false</LockData>
<LocalTitle>Bad Collection</LocalTitle>
<DisplayOrder>PremiereDate</DisplayOrder>
<TmdbId>1155702</TmdbId>
</Item>
As you can see there is no "CollectionItems" entry, but the collection doesn't get deleted. I found the following error message in the logs:
[2025-04-30 00:00:00.003 +02:00] [INF] [36] Emby.Server.Implementations.ScheduledTasks.Tasks.CleanupCollectionAndPlaylistPathsTask: Item in Bad Collection cannot be found at /arr/movies/Bad collection - Example1234 (2024)/Example1234 (2024) [imdbid-tt30021427] - [WEBDL-1080p][EAC3 5.1][x264]-ZeroTwo.mkv
[2025-04-30 00:00:00.003 +02:00] [INF] [36] Emby.Server.Implementations.ScheduledTasks.Tasks.CleanupCollectionAndPlaylistPathsTask: Item in Bad Collection cannot be found at /arr/media/leaving-soon/movies/media/Bad collection - Example1234 (2024)/Example1234 (2024) [imdbid-tt30021427] - [WEBDL-1080p][EAC3 5.1][x264]-ZeroTwo.mkv
[2025-04-30 00:00:00.025 +02:00] [ERR] [36] MediaBrowser.Providers.Manager.ProviderManager: Error in metadata saver
System.IO.IOException: The process cannot access the file '/config/data/collections/Bad Collection [boxset]/collection.xml' because it is being used by another process.
at Microsoft.Win32.SafeHandles.SafeFileHandle.Init(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Int64& fileLength, UnixFileMode& filePermissions)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Boolean failForSymlink, Boolean& wasSymlink, Func
at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable1 unixCreateMode)
at System.IO.FileStream..ctor(String path, FileStreamOptions options)
at MediaBrowser.LocalMetadata.Savers.BaseXmlSaver.SaveAsync(BaseItem item, CancellationToken cancellationToken)
at MediaBrowser.Providers.Manager.ProviderManager.SaveMetadataAsync(BaseItem item, ItemUpdateType updateType, IEnumerable`1 savers)
How can I debug what process is using that exact collection.xml? How can I solve this problem?
Thanks in advance for your help.
Jellyfin version: 10.10.7Version
JJellyfin
I just noticed that jellyfin doesn't delete empty collections.
Example of correct collection xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Item>
<ContentRating>FSK-12</ContentRating>
<Added>03/18/2025 17:19:56</Added>
<LockData>false</LockData>
<Overview>Collection XYZ.</Overview>
<LocalTitle>Example123</LocalTitle>
<PremiereDate>2018-12-07</PremiereDate>
<DisplayOrder>PremiereDate</DisplayOrder>
<ProductionYear>2018</ProductionYear>
<TmdbId>573693</TmdbId>
<Genres>
<Genre>Action</Genre>
<Genre>Abenteuer</Genre>
<Genre>Fantasy</Genre>
</Genres>
<Studios>
<Studio> XYZ </Studio>
<Studio> XYZ </Studio>
<Studio> XYZ </Studio>
<Studio> XYZ </Studio>
<Studio> XYZ </Studio>
</Studios>
<CollectionItems>
<CollectionItem>
<Path>/arr/movies/Collection XYZ - Example123 (201


</CollectionItem>
<CollectionItem>
<Path>/arr/movies/ Collection XYZ - Example1234 (201


</CollectionItem>
</CollectionItems>
</Item>
Example of bad collection.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Item>
<Added>05/23/2025 15:28:31</Added>
<LockData>false</LockData>
<LocalTitle>Bad Collection</LocalTitle>
<DisplayOrder>PremiereDate</DisplayOrder>
<TmdbId>1155702</TmdbId>
</Item>
As you can see there is no "CollectionItems" entry, but the collection doesn't get deleted. I found the following error message in the logs:
[2025-04-30 00:00:00.003 +02:00] [INF] [36] Emby.Server.Implementations.ScheduledTasks.Tasks.CleanupCollectionAndPlaylistPathsTask: Item in Bad Collection cannot be found at /arr/movies/Bad collection - Example1234 (2024)/Example1234 (2024) [imdbid-tt30021427] - [WEBDL-1080p][EAC3 5.1][x264]-ZeroTwo.mkv
[2025-04-30 00:00:00.003 +02:00] [INF] [36] Emby.Server.Implementations.ScheduledTasks.Tasks.CleanupCollectionAndPlaylistPathsTask: Item in Bad Collection cannot be found at /arr/media/leaving-soon/movies/media/Bad collection - Example1234 (2024)/Example1234 (2024) [imdbid-tt30021427] - [WEBDL-1080p][EAC3 5.1][x264]-ZeroTwo.mkv
[2025-04-30 00:00:00.025 +02:00] [ERR] [36] MediaBrowser.Providers.Manager.ProviderManager: Error in metadata saver
System.IO.IOException: The process cannot access the file '/config/data/collections/Bad Collection [boxset]/collection.xml' because it is being used by another process.
at Microsoft.Win32.SafeHandles.SafeFileHandle.Init(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Int64& fileLength, UnixFileMode& filePermissions)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Boolean failForSymlink, Boolean& wasSymlink, Func
4 createOpenException)at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable1 unixCreateMode)
at System.IO.FileStream..ctor(String path, FileStreamOptions options)
at MediaBrowser.LocalMetadata.Savers.BaseXmlSaver.SaveAsync(BaseItem item, CancellationToken cancellationToken)
at MediaBrowser.Providers.Manager.ProviderManager.SaveMetadataAsync(BaseItem item, ItemUpdateType updateType, IEnumerable`1 savers)
How can I debug what process is using that exact collection.xml? How can I solve this problem?
Thanks in advance for your help.
Jellyfin version: 10.10.7Version
JJellyfin