Scanning lib folder fails on MacOS file system inside docker #6507

Closed
opened 2025-12-22 04:22:19 +01:00 by backuprepo · 8 comments
Owner

Originally created by @hamada147 on GitHub (Nov 23, 2024).

This issue respects the following points:

  • This is a bug, not a question or a configuration issue; Please visit our forum or chat rooms first to troubleshoot with volunteers, before creating a report. The links can be found here.
  • This issue is not already reported on GitHub (I've searched it).
  • I'm using an up to date version of Jellyfin Server stable, unstable or master; We generally do not support previous older versions. If possible, please update to the latest version before opening an issue.
  • I agree to follow Jellyfin's Code of Conduct.
  • This report addresses only a single issue; If you encounter multiple issues, kindly create separate reports for each one.

Description of the bug

On a new installation of JellyFin on a MacOS using docker, it fails to scan a folder with the MacOS file system because it is trying to read files that start with ._ and ._.DS_Store.

Reproduction steps

  1. Have a fresh installation of JellyFin with docker from linuxserver.
  2. Scan a lib folder with the macOS file system on the macOS directory.

What is the current bug behavior?

When reading a folder directory on a macOS file system, it tries to read and access all files even the ones that starts with ._ and ._.DS_Store.

What is the expected correct behavior?

When reading a folder directory on a macOS file system, it should ignore all files that start with ._ and ._.DS_Store.

Jellyfin Server version

10.10.0+

Specify commit id

No response

Specify unstable release number

No response

Specify version number

No response

Specify the build version

10.10.3

Environment

- OS: macOS
- Linux Kernel:
- Virtualization: Docker
- Clients:
- Browser: Google Chrome
- FFmpeg Version:
- Playback Method:
- Hardware Acceleration:
- GPU Model:
- Plugins:
- Reverse Proxy:
- Base URL:
- Networking:
- Storage:

Jellyfin logs

[2024-11-23 05:30:15.768 +02:00] [ERR] [22] Jellyfin.Api.Middleware.ExceptionMiddleware: Error processing request: "Could not find a part of the path '/movies'". URL "GET" "/Environment/DirectoryContents".
[2024-11-23 05:30:15.842 +02:00] [ERR] [22] Jellyfin.Api.Middleware.ExceptionMiddleware: Error processing request: "Could not find a part of the path '/movies'". URL "GET" "/Environment/DirectoryContents".
[2024-11-23 05:30:32.821 +02:00] [ERR] [3] Jellyfin.Api.Middleware.ExceptionMiddleware: Error processing request. URL "GET" "/Environment/DirectoryContents".
System.UnauthorizedAccessException: Access to the path '/data/movies/._.DS_Store' is denied.
 ---> System.IO.IOException: Operation not permitted
   --- End of inner exception stack trace ---
   at System.IO.FileSystemInfo.Create(String fullPath, String fileName, Boolean asDirectory, FileStatus& fileStatus)
   at System.IO.Enumeration.FileSystemEntry.ToFileSystemInfo()
   at System.IO.Enumeration.FileSystemEnumerator`1.MoveNext()
   at System.Linq.Enumerable.SelectEnumerableIterator`2.MoveNext()
   at System.Linq.Enumerable.WhereEnumerableIterator`1.ToArray()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.OrderedEnumerable`1.GetEnumerator()+MoveNext()
   at System.Linq.Enumerable.SelectIPartitionIterator`2.MoveNext()
   at System.Text.Json.Serialization.Converters.IEnumerableDefaultConverter`2.OnWriteResume(Utf8JsonWriter writer, TCollection value, JsonSerializerOptions options, WriteStack& state)
   at System.Text.Json.Serialization.JsonCollectionConverter`2.OnTryWrite(Utf8JsonWriter writer, TCollection value, JsonSerializerOptions options, WriteStack& state)
   at System.Text.Json.Serialization.JsonConverter`1.TryWrite(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state)
   at System.Text.Json.Serialization.JsonConverter`1.WriteCore(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state)
   at System.Text.Json.Serialization.Metadata.JsonTypeInfo`1.SerializeAsync(Stream utf8Json, T rootValue, CancellationToken cancellationToken, Object rootValueBoxed)
   at System.Text.Json.Serialization.Metadata.JsonTypeInfo`1.SerializeAsync(Stream utf8Json, T rootValue, CancellationToken cancellationToken, Object rootValueBoxed)
   at System.Text.Json.Serialization.Metadata.JsonTypeInfo`1.SerializeAsync(Stream utf8Json, T rootValue, CancellationToken cancellationToken, Object rootValueBoxed)
   at System.Text.Json.Serialization.Metadata.JsonTypeInfo`1.SerializeAsync(Stream utf8Json, T rootValue, CancellationToken cancellationToken, Object rootValueBoxed)
   at Microsoft.AspNetCore.Mvc.Formatters.SystemTextJsonOutputFormatter.WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResultFilterAsync>g__Awaited|30_0[TFilter,TFilterAsync](ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeResultFilters()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Jellyfin.Api.Middleware.ServerStartupMessageMiddleware.Invoke(HttpContext httpContext, IServerApplicationHost serverApplicationHost, ILocalizationManager localizationManager)
   at Jellyfin.Api.Middleware.WebSocketHandlerMiddleware.Invoke(HttpContext httpContext, IWebSocketManager webSocketManager)
   at Jellyfin.Api.Middleware.IPBasedAccessValidationMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager)
   at Jellyfin.Api.Middleware.LanFilteringMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager, IServerConfigurationManager serverConfigurationManager)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Jellyfin.Api.Middleware.QueryStringDecodingMiddleware.Invoke(HttpContext httpContext)
   at Swashbuckle.AspNetCore.ReDoc.ReDocMiddleware.Invoke(HttpContext httpContext)
   at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
   at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Jellyfin.Api.Middleware.RobotsRedirectionMiddleware.Invoke(HttpContext httpContext)
   at Jellyfin.Api.Middleware.LegacyEmbyRouteRewriteMiddleware.Invoke(HttpContext httpContext)
   at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContext context)
   at Jellyfin.Api.Middleware.ResponseTimeMiddleware.Invoke(HttpContext context, IServerConfigurationManager serverConfigurationManager)
   at Jellyfin.Api.Middleware.ExceptionMiddleware.Invoke(HttpContext context)
[2024-11-23 05:38:31.457 +02:00] [ERR] [41] MediaBrowser.Controller.Entities.BaseItem: Error retrieving children
System.UnauthorizedAccessException: Access to the path '/data/tvshows/._Hellbound (2021)' is denied.
 ---> System.IO.IOException: Operation not permitted
   --- End of inner exception stack trace ---
   at System.IO.FileSystemInfo.Create(String fullPath, String fileName, Boolean asDirectory, FileStatus& fileStatus)
   at System.IO.Enumeration.FileSystemEntry.ToFileSystemInfo()
   at System.IO.Enumeration.FileSystemEnumerator`1.MoveNext()
   at System.Linq.Enumerable.SelectEnumerableIterator`2.ToArray()
   at MediaBrowser.Controller.Providers.DirectoryService.GetFileSystemEntries(String path)
   at MediaBrowser.Controller.Entities.BaseItem.GetFileSystemChildren(IDirectoryService directoryService)
   at MediaBrowser.Controller.Entities.Folder.GetNonCachedChildren(IDirectoryService directoryService)
   at MediaBrowser.Controller.Entities.Folder.ValidateChildrenInternal2(IProgress`1 progress, Boolean recursive, Boolean refreshChildMetadata, Boolean allowRemoveRoot, MetadataRefreshOptions refreshOptions, IDirectoryService directoryService, CancellationToken cancellationToken)

FFmpeg logs


Client / Browser logs

No response

Relevant screenshots or videos

No response

Additional information

No response

Originally created by @hamada147 on GitHub (Nov 23, 2024). ### This issue respects the following points: - [x] This is a **bug**, not a question or a configuration issue; Please visit our forum or chat rooms first to troubleshoot with volunteers, before creating a report. The links can be found [here](https://jellyfin.org/contact/). - [x] This issue is **not** already reported on [GitHub](https://github.com/jellyfin/jellyfin/issues?q=is%3Aopen+is%3Aissue) _(I've searched it)_. - [x] I'm using an up to date version of Jellyfin Server stable, unstable or master; We generally do not support previous older versions. If possible, please update to the latest version before opening an issue. - [x] I agree to follow Jellyfin's [Code of Conduct](https://jellyfin.org/docs/general/community-standards.html#code-of-conduct). - [x] This report addresses only a single issue; If you encounter multiple issues, kindly create separate reports for each one. ### Description of the bug On a new installation of JellyFin on a MacOS using docker, it fails to scan a folder with the MacOS file system because it is trying to read files that start with `._` and `._.DS_Store`. ### Reproduction steps 1. Have a fresh installation of JellyFin with docker from [linuxserver](https://docs.linuxserver.io/images/docker-jellyfin/). 2. Scan a lib folder with the macOS file system on the macOS directory. ### What is the current _bug_ behavior? When reading a folder directory on a macOS file system, it tries to read and access all files even the ones that starts with `._` and `._.DS_Store`. ### What is the expected _correct_ behavior? When reading a folder directory on a macOS file system, it should ignore all files that start with `._` and `._.DS_Store`. ### Jellyfin Server version 10.10.0+ ### Specify commit id _No response_ ### Specify unstable release number _No response_ ### Specify version number _No response_ ### Specify the build version 10.10.3 ### Environment ```markdown - OS: macOS - Linux Kernel: - Virtualization: Docker - Clients: - Browser: Google Chrome - FFmpeg Version: - Playback Method: - Hardware Acceleration: - GPU Model: - Plugins: - Reverse Proxy: - Base URL: - Networking: - Storage: ``` ### Jellyfin logs ```shell [2024-11-23 05:30:15.768 +02:00] [ERR] [22] Jellyfin.Api.Middleware.ExceptionMiddleware: Error processing request: "Could not find a part of the path '/movies'". URL "GET" "/Environment/DirectoryContents". [2024-11-23 05:30:15.842 +02:00] [ERR] [22] Jellyfin.Api.Middleware.ExceptionMiddleware: Error processing request: "Could not find a part of the path '/movies'". URL "GET" "/Environment/DirectoryContents". [2024-11-23 05:30:32.821 +02:00] [ERR] [3] Jellyfin.Api.Middleware.ExceptionMiddleware: Error processing request. URL "GET" "/Environment/DirectoryContents". System.UnauthorizedAccessException: Access to the path '/data/movies/._.DS_Store' is denied. ---> System.IO.IOException: Operation not permitted --- End of inner exception stack trace --- at System.IO.FileSystemInfo.Create(String fullPath, String fileName, Boolean asDirectory, FileStatus& fileStatus) at System.IO.Enumeration.FileSystemEntry.ToFileSystemInfo() at System.IO.Enumeration.FileSystemEnumerator`1.MoveNext() at System.Linq.Enumerable.SelectEnumerableIterator`2.MoveNext() at System.Linq.Enumerable.WhereEnumerableIterator`1.ToArray() at System.Linq.Buffer`1..ctor(IEnumerable`1 source) at System.Linq.OrderedEnumerable`1.GetEnumerator()+MoveNext() at System.Linq.Enumerable.SelectIPartitionIterator`2.MoveNext() at System.Text.Json.Serialization.Converters.IEnumerableDefaultConverter`2.OnWriteResume(Utf8JsonWriter writer, TCollection value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.JsonCollectionConverter`2.OnTryWrite(Utf8JsonWriter writer, TCollection value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.JsonConverter`1.TryWrite(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.JsonConverter`1.WriteCore(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.Metadata.JsonTypeInfo`1.SerializeAsync(Stream utf8Json, T rootValue, CancellationToken cancellationToken, Object rootValueBoxed) at System.Text.Json.Serialization.Metadata.JsonTypeInfo`1.SerializeAsync(Stream utf8Json, T rootValue, CancellationToken cancellationToken, Object rootValueBoxed) at System.Text.Json.Serialization.Metadata.JsonTypeInfo`1.SerializeAsync(Stream utf8Json, T rootValue, CancellationToken cancellationToken, Object rootValueBoxed) at System.Text.Json.Serialization.Metadata.JsonTypeInfo`1.SerializeAsync(Stream utf8Json, T rootValue, CancellationToken cancellationToken, Object rootValueBoxed) at Microsoft.AspNetCore.Mvc.Formatters.SystemTextJsonOutputFormatter.WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResultFilterAsync>g__Awaited|30_0[TFilter,TFilterAsync](ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeResultFilters() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) at Jellyfin.Api.Middleware.ServerStartupMessageMiddleware.Invoke(HttpContext httpContext, IServerApplicationHost serverApplicationHost, ILocalizationManager localizationManager) at Jellyfin.Api.Middleware.WebSocketHandlerMiddleware.Invoke(HttpContext httpContext, IWebSocketManager webSocketManager) at Jellyfin.Api.Middleware.IPBasedAccessValidationMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager) at Jellyfin.Api.Middleware.LanFilteringMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager, IServerConfigurationManager serverConfigurationManager) at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at Jellyfin.Api.Middleware.QueryStringDecodingMiddleware.Invoke(HttpContext httpContext) at Swashbuckle.AspNetCore.ReDoc.ReDocMiddleware.Invoke(HttpContext httpContext) at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext) at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider) at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Jellyfin.Api.Middleware.RobotsRedirectionMiddleware.Invoke(HttpContext httpContext) at Jellyfin.Api.Middleware.LegacyEmbyRouteRewriteMiddleware.Invoke(HttpContext httpContext) at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContext context) at Jellyfin.Api.Middleware.ResponseTimeMiddleware.Invoke(HttpContext context, IServerConfigurationManager serverConfigurationManager) at Jellyfin.Api.Middleware.ExceptionMiddleware.Invoke(HttpContext context) [2024-11-23 05:38:31.457 +02:00] [ERR] [41] MediaBrowser.Controller.Entities.BaseItem: Error retrieving children System.UnauthorizedAccessException: Access to the path '/data/tvshows/._Hellbound (2021)' is denied. ---> System.IO.IOException: Operation not permitted --- End of inner exception stack trace --- at System.IO.FileSystemInfo.Create(String fullPath, String fileName, Boolean asDirectory, FileStatus& fileStatus) at System.IO.Enumeration.FileSystemEntry.ToFileSystemInfo() at System.IO.Enumeration.FileSystemEnumerator`1.MoveNext() at System.Linq.Enumerable.SelectEnumerableIterator`2.ToArray() at MediaBrowser.Controller.Providers.DirectoryService.GetFileSystemEntries(String path) at MediaBrowser.Controller.Entities.BaseItem.GetFileSystemChildren(IDirectoryService directoryService) at MediaBrowser.Controller.Entities.Folder.GetNonCachedChildren(IDirectoryService directoryService) at MediaBrowser.Controller.Entities.Folder.ValidateChildrenInternal2(IProgress`1 progress, Boolean recursive, Boolean refreshChildMetadata, Boolean allowRemoveRoot, MetadataRefreshOptions refreshOptions, IDirectoryService directoryService, CancellationToken cancellationToken) ``` ### FFmpeg logs ```shell ``` ### Client / Browser logs _No response_ ### Relevant screenshots or videos _No response_ ### Additional information _No response_
backuprepo 2025-12-22 04:22:19 +01:00
Author
Owner

@gnattu commented on GitHub (Nov 23, 2024):

All Unix hidden files should be ignored per this: 06c603428b/Emby.Server.Implementations/Library/IgnorePatterns.cs (L83-L88)

I don’t know why it does not work in docker because this does not happen with the native install on macOS, the fact that any hidden files is being scanned is weird.

@gnattu commented on GitHub (Nov 23, 2024): All Unix hidden files should be ignored per this: https://github.com/jellyfin/jellyfin/blob/06c603428bceccdb793eb34cc0340e25552d6c1d/Emby.Server.Implementations/Library/IgnorePatterns.cs#L83-L88 I don’t know why it does not work in docker because this does not happen with the native install on macOS, the fact that any hidden files is being scanned is weird.
Author
Owner

@hamada147 commented on GitHub (Nov 23, 2024):

This is so weird, I just compiled and ran the source code from the master branch (commit SHA: 2b0f028b6f1c471db16996a36d0d6ee6f23bde57) and it does ignore all Unix hidden files. I don't know why in the docker instance it doesn't.

@hamada147 commented on GitHub (Nov 23, 2024): This is so weird, I just compiled and ran the source code from the master branch (commit SHA: 2b0f028b6f1c471db16996a36d0d6ee6f23bde57) and it does ignore all Unix hidden files. I don't know why in the docker instance it doesn't.
Author
Owner

@gnattu commented on GitHub (Nov 24, 2024):

I don't know why in the docker instance it doesn't.

After some investigation I found this is tricky to fix because it will change the file system enumeration quite a bit. The dotnet internal EnumerateFileSystemInfos requires read access to each and every file in the specified path as the IgnoreInaccessible property is not correctly handled inside the implementation: f1332ab0d8/src/libraries/System.Private.CoreLib/src/System/IO/Enumeration/FileSystemEnumerableFactory.cs (L198)

We have set the IgnoreInaccessible property to true in the EnumerationOptions. However, the implementation of .NET does not attempt to catch the exception raised by the ToFileSystemInfo call and simply throws even when IgnoreInaccessible is set to true. It should just silently ignore the file if an UnauthorizedAccessException was thrown.

@gnattu commented on GitHub (Nov 24, 2024): > I don't know why in the docker instance it doesn't. After some investigation I found this is tricky to fix because it will change the file system enumeration quite a bit. The dotnet internal `EnumerateFileSystemInfos` requires read access to each and every file in the specified path as the `IgnoreInaccessible` property is not correctly handled inside the implementation: https://github.com/dotnet/runtime/blob/f1332ab0d82ee0e21ca387cbd1c8a87c5dfa4906/src/libraries/System.Private.CoreLib/src/System/IO/Enumeration/FileSystemEnumerableFactory.cs#L198 We have set the `IgnoreInaccessible` property to `true` in the `EnumerationOptions`. However, the implementation of .NET does not attempt to catch the exception raised by the `ToFileSystemInfo` call and simply throws even when `IgnoreInaccessible` is set to `true`. It should just silently ignore the file if an `UnauthorizedAccessException` was thrown.
Author
Owner

@agardnerIT commented on GitHub (Feb 8, 2025):

Not sure if I'm hitting this too or something else, but attempting to create a library from an external drive while running in Docker on macOS:

myuser uid is 501 and group is staff so the standard gid of 20.

docker run -d \
...
 --user 501:20 \
--mount type=bind,source=/Volumes/4tbexternal/Adam/jellyfin,target=/files \
...

I can create the library via UI fine. But indexing throws:

[2025-02-08 22:29:49.417 +00:00] [ERR] [24] Emby.Server.Implementations.Library.LibraryManager: Error resolving path "/files/shows/*****"
System.UnauthorizedAccessException: Access to the path '/files/shows/******/._.DS_Store' is denied.
 ---> System.IO.IOException: Operation not permitted
   --- End of inner exception stack trace ---
   at System.IO.FileSystemInfo.Create(String fullPath, String fileName, Boolean asDirectory, FileStatus& fileStatus)
   at System.IO.Enumeration.FileSystemEntry.ToFileSystemInfo()
   at System.IO.Enumeration.FileSystemEnumerator`1.MoveNext()
   at System.Linq.Enumerable.SelectEnumerableIterator`2.ToArray()
   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 Emby.Server.Implementations.Library.LibraryManager.ResolvePath(FileSystemMetadata fileInfo, IDirectoryService directoryService, IItemResolver[] resolvers, Folder parent, Nullable`1 collectionType, LibraryOptions libraryOptions)
   at Emby.Server.Implementations.Library.LibraryManager.ResolveFileList(IReadOnlyList`1 fileList, IDirectoryService directoryService, Folder parent, Nullable`1 collectionType, IItemResolver[] resolvers, LibraryOptions libraryOptions)+MoveNext()

ls-al

% ls -al
total 2560
drwx------  1 myuser  staff  262144  8 Feb 18:23 .
drwx------  1 myuser  staff  262144  8 Feb 19:51 ..
-rwx------@ 1 myuser  staff    6148  8 Feb 18:23 .DS_Store
-rwx------  1 myuser  staff    4096  8 Feb 19:52 ._.DS_Store
drwx------  1 myuser  staff  262144  8 Feb 18:26 Season 01
@agardnerIT commented on GitHub (Feb 8, 2025): Not sure if I'm hitting this too or something else, but attempting to create a library from an external drive while running in Docker on macOS: `myuser` uid is `501` and group is `staff` so the standard `gid` of `20`. ``` docker run -d \ ... --user 501:20 \ --mount type=bind,source=/Volumes/4tbexternal/Adam/jellyfin,target=/files \ ... ``` I can create the library via UI fine. But indexing throws: ``` [2025-02-08 22:29:49.417 +00:00] [ERR] [24] Emby.Server.Implementations.Library.LibraryManager: Error resolving path "/files/shows/*****" System.UnauthorizedAccessException: Access to the path '/files/shows/******/._.DS_Store' is denied. ---> System.IO.IOException: Operation not permitted --- End of inner exception stack trace --- at System.IO.FileSystemInfo.Create(String fullPath, String fileName, Boolean asDirectory, FileStatus& fileStatus) at System.IO.Enumeration.FileSystemEntry.ToFileSystemInfo() at System.IO.Enumeration.FileSystemEnumerator`1.MoveNext() at System.Linq.Enumerable.SelectEnumerableIterator`2.ToArray() 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 Emby.Server.Implementations.Library.LibraryManager.ResolvePath(FileSystemMetadata fileInfo, IDirectoryService directoryService, IItemResolver[] resolvers, Folder parent, Nullable`1 collectionType, LibraryOptions libraryOptions) at Emby.Server.Implementations.Library.LibraryManager.ResolveFileList(IReadOnlyList`1 fileList, IDirectoryService directoryService, Folder parent, Nullable`1 collectionType, IItemResolver[] resolvers, LibraryOptions libraryOptions)+MoveNext() ``` ## `ls-al` ``` % ls -al total 2560 drwx------ 1 myuser staff 262144 8 Feb 18:23 . drwx------ 1 myuser staff 262144 8 Feb 19:51 .. -rwx------@ 1 myuser staff 6148 8 Feb 18:23 .DS_Store -rwx------ 1 myuser staff 4096 8 Feb 19:52 ._.DS_Store drwx------ 1 myuser staff 262144 8 Feb 18:26 Season 01 ```
Author
Owner

@gnattu commented on GitHub (Feb 8, 2025):

You cannot really use docker and we can do almost nothing if the dot net native method just throws.

We do provide native macOS packages, why not use that instead? You won’t have such issue by using that.

@gnattu commented on GitHub (Feb 8, 2025): You cannot really use docker and we can do almost nothing if the dot net native method just throws. We do provide native macOS packages, why not use that instead? You won’t have such issue by using that.
Author
Owner

@dylan-klomparens commented on GitHub (Feb 20, 2025):

For those interested in a temporary workaround...

ONLY if you are using an external USB drive to store your media, you can disable .DS_Store and related "view preference" files (that start with ".").

In the Terminal, issue this command:
sudo defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true

Then reboot your Mac.

Delete all "._" files on your media drive.

In Jellyfin, re-scan your media library. If you see any more errors, you may have missed deleting a hidden file, and the log output will reveal the file responsible.

I hope this helps anyone trying to run Jellyfin on Mac in Docker. I was able to successfully do it. Love the software, and the devs for this project rock!

@dylan-klomparens commented on GitHub (Feb 20, 2025): For those interested in a temporary workaround... ONLY if you are using an external USB drive to store your media, you can disable ._DS_Store and related "view preference" files (that start with "._"). In the Terminal, issue this command: `sudo defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true` Then reboot your Mac. Delete all "._" files on your media drive. In Jellyfin, re-scan your media library. If you see any more errors, you may have missed deleting a hidden file, and the log output will reveal the file responsible. I hope this helps anyone trying to run Jellyfin on Mac in Docker. I was able to successfully do it. Love the software, and the devs for this project rock!
Author
Owner

@jellyfin-bot commented on GitHub (Jun 21, 2025):

This issue has gone 120 days without an update and will be closed within 21 days if there is no new activity. To prevent this issue from being closed, please confirm the issue has not already been fixed by providing updated examples or logs.

If you have any questions you can use one of several ways to contact us.

@jellyfin-bot commented on GitHub (Jun 21, 2025): This issue has gone 120 days without an update and will be closed within 21 days if there is no new activity. To prevent this issue from being closed, please confirm the issue has not already been fixed by providing updated examples or logs. If you have any questions you can use one of several ways to [contact us](https://jellyfin.org/contact).
Author
Owner

@jellyfin-bot commented on GitHub (Jul 12, 2025):

This issue was closed due to inactivity.

@jellyfin-bot commented on GitHub (Jul 12, 2025): This issue was closed due to inactivity.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: starred/jellyfin#6507
No description provided.