Trying to scan paths without permission causes a segfault #374

Closed
opened 2026-02-06 19:37:58 +03:00 by OVERLORD · 14 comments
Owner

Originally created by @lbeltrame on GitHub (Feb 2, 2019).

Describe the bug
I mistakenly forgot to fix the permissions of a few of my photos that were being scanned by Jellyfin. One evening I noticed that the kernel had detected loads and loads of segfaults in dotnet. A quick look at the systemd journal showed a path Jellyfin could not access, leading up to a crash.

To Reproduce

  1. Mark one item (photo) as not accessible by Jellyfin (e.g. chmod u-r)
  2. Have Jellyfin scan the path

Expected behavior
No crash.

Logs

gen 31 22:32:35 palver.lan dotnet[4847]: [22:32:35] [INF] Validating media library
gen 31 22:33:58 palver.lan dotnet[4847]: [22:33:58] [ERR] Image Provider - Error reading image tag for /home/storage/images/2018-03-23/IMG_20180323_224811.jpg                                                                            
gen 31 22:33:58 palver.lan dotnet[4847]: System.UnauthorizedAccessException: Access to the path '/home/storage/images/2018-03-23/IMG_20180323_224811.jpg' is denied. ---> System.IO.IOException: Permission denied                        
gen 31 22:33:58 palver.lan dotnet[4847]:    --- End of inner exception stack trace ---
gen 31 22:33:58 palver.lan dotnet[4847]:    at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)                                                                                                
gen 31 22:33:58 palver.lan dotnet[4847]:    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)                                                                                                                    
gen 31 22:33:58 palver.lan dotnet[4847]:    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
gen 31 22:33:58 palver.lan dotnet[4847]:    at TagLib.File.LocalFileAbstraction.get_ReadStream()
gen 31 22:33:58 palver.lan dotnet[4847]:    at TagLib.File.set_Mode(AccessMode value)
gen 31 22:33:58 palver.lan dotnet[4847]:    at TagLib.Jpeg.File.Read(ReadStyle propertiesStyle)   at TagLib.File.Create(IFileAbstraction abstraction, String mimetype, ReadStyle propertiesStyle)
gen 31 22:33:58 palver.lan dotnet[4847]:    at Emby.Photos.PhotoProvider.FetchAsync(Photo item, MetadataRefreshOptions options, CancellationToken cancellationToken) in /home/emby/jellyfin/Emby.Photos/PhotoProvider.cs:line 60
gen 31 22:33:58 palver.lan dotnet[4847]: [22:33:58] [INF] Getting image size for item Photo /home/storage/images/2018-03-23/IMG_20180323_224811.jpg
gen 31 22:33:59 palver.lan systemd[1]: jellyfin.service: Main process exited, code=killed, status=11/SEGV
gen 31 22:33:59 palver.lan systemd[1]: jellyfin.service: Failed with result 'signal'.
gen 31 22:34:00 palver.lan systemd[1]: jellyfin.service: Service RestartSec=100ms expired, scheduling restart.
gen 31 22:34:00 palver.lan systemd[1]: jellyfin.service: Scheduled restart job, restart counter is at 901.

System (please complete the following information):

  • openSUSE Tumbleweed
  • Browser: not applicable
  • Jellyfin Version: master
Originally created by @lbeltrame on GitHub (Feb 2, 2019). **Describe the bug** I mistakenly forgot to fix the permissions of a few of my photos that were being scanned by Jellyfin. One evening I noticed that the kernel had detected loads and loads of segfaults in dotnet. A quick look at the systemd journal showed a path Jellyfin could not access, leading up to a crash. **To Reproduce** 1. Mark one item (photo) as not accessible by Jellyfin (e.g. `chmod u-r`) 2. Have Jellyfin scan the path **Expected behavior** No crash. **Logs** ``` gen 31 22:32:35 palver.lan dotnet[4847]: [22:32:35] [INF] Validating media library gen 31 22:33:58 palver.lan dotnet[4847]: [22:33:58] [ERR] Image Provider - Error reading image tag for /home/storage/images/2018-03-23/IMG_20180323_224811.jpg gen 31 22:33:58 palver.lan dotnet[4847]: System.UnauthorizedAccessException: Access to the path '/home/storage/images/2018-03-23/IMG_20180323_224811.jpg' is denied. ---> System.IO.IOException: Permission denied gen 31 22:33:58 palver.lan dotnet[4847]: --- End of inner exception stack trace --- gen 31 22:33:58 palver.lan dotnet[4847]: at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter) gen 31 22:33:58 palver.lan dotnet[4847]: at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode) gen 31 22:33:58 palver.lan dotnet[4847]: at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) gen 31 22:33:58 palver.lan dotnet[4847]: at TagLib.File.LocalFileAbstraction.get_ReadStream() gen 31 22:33:58 palver.lan dotnet[4847]: at TagLib.File.set_Mode(AccessMode value) gen 31 22:33:58 palver.lan dotnet[4847]: at TagLib.Jpeg.File.Read(ReadStyle propertiesStyle) at TagLib.File.Create(IFileAbstraction abstraction, String mimetype, ReadStyle propertiesStyle) gen 31 22:33:58 palver.lan dotnet[4847]: at Emby.Photos.PhotoProvider.FetchAsync(Photo item, MetadataRefreshOptions options, CancellationToken cancellationToken) in /home/emby/jellyfin/Emby.Photos/PhotoProvider.cs:line 60 gen 31 22:33:58 palver.lan dotnet[4847]: [22:33:58] [INF] Getting image size for item Photo /home/storage/images/2018-03-23/IMG_20180323_224811.jpg gen 31 22:33:59 palver.lan systemd[1]: jellyfin.service: Main process exited, code=killed, status=11/SEGV gen 31 22:33:59 palver.lan systemd[1]: jellyfin.service: Failed with result 'signal'. gen 31 22:34:00 palver.lan systemd[1]: jellyfin.service: Service RestartSec=100ms expired, scheduling restart. gen 31 22:34:00 palver.lan systemd[1]: jellyfin.service: Scheduled restart job, restart counter is at 901. ``` **System (please complete the following information):** - openSUSE Tumbleweed - Browser: not applicable - Jellyfin Version: master
OVERLORD added the bug label 2026-02-06 19:37:58 +03:00
Author
Owner

@101100 commented on GitHub (May 13, 2019):

I had a similar issue with a cover art file running under docker:

[11:48:24] [ERR] Error in Dynamic Image Provider
System.UnauthorizedAccessException: Access to the path '/media/Music/Most/Three Guys And A Bunch Of Drums/2008 Drum Jelly/cover.jpg' is denied. ---> System.IO.IOException: Permission denied
   --- End of inner exception stack trace ---
   at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at System.IO.FileSystem.CopyFile(String sourceFullPath, String destFullPath, Boolean overwrite)
   at System.IO.File.Copy(String sourceFileName, String destFileName, Boolean overwrite)
   at Emby.Server.Implementations.Images.BaseDynamicImageProvider`1.CreateSingleImage(IEnumerable`1 itemsWithImages, String outputPathWithoutExtension, ImageType imageType)
   at Emby.Server.Implementations.Images.BaseDynamicImageProvider`1.FetchToFileInternal(BaseItem item, IReadOnlyList`1 itemsWithImages, ImageType imageType, CancellationToken cancellationToken)
   at Emby.Server.Implementations.Images.BaseDynamicImageProvider`1.FetchAsync(T item, MetadataRefreshOptions options, CancellationToken cancellationToken)
   at MediaBrowser.Providers.Manager.MetadataService`2.RunCustomProvider(ICustomMetadataProvider`1 provider, TItemType item, String logName, MetadataRefreshOptions options, RefreshResult refreshResult, CancellationToken cancellationToken)
[11:49:03] [INF] Saving system configuration
[11:49:03] [INF] Setting cache path to /cache
Segmentation fault (core dumped)

System (please complete the following information):

  • Ubuntu 18.04.1 LTS
  • Browser: not applicable
  • Jellyfin Version: 10.3.2 (via official docker image)
@101100 commented on GitHub (May 13, 2019): I had a similar issue with a cover art file running under docker: ``` [11:48:24] [ERR] Error in Dynamic Image Provider System.UnauthorizedAccessException: Access to the path '/media/Music/Most/Three Guys And A Bunch Of Drums/2008 Drum Jelly/cover.jpg' is denied. ---> System.IO.IOException: Permission denied --- End of inner exception stack trace --- at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter) at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at System.IO.FileSystem.CopyFile(String sourceFullPath, String destFullPath, Boolean overwrite) at System.IO.File.Copy(String sourceFileName, String destFileName, Boolean overwrite) at Emby.Server.Implementations.Images.BaseDynamicImageProvider`1.CreateSingleImage(IEnumerable`1 itemsWithImages, String outputPathWithoutExtension, ImageType imageType) at Emby.Server.Implementations.Images.BaseDynamicImageProvider`1.FetchToFileInternal(BaseItem item, IReadOnlyList`1 itemsWithImages, ImageType imageType, CancellationToken cancellationToken) at Emby.Server.Implementations.Images.BaseDynamicImageProvider`1.FetchAsync(T item, MetadataRefreshOptions options, CancellationToken cancellationToken) at MediaBrowser.Providers.Manager.MetadataService`2.RunCustomProvider(ICustomMetadataProvider`1 provider, TItemType item, String logName, MetadataRefreshOptions options, RefreshResult refreshResult, CancellationToken cancellationToken) [11:49:03] [INF] Saving system configuration [11:49:03] [INF] Setting cache path to /cache Segmentation fault (core dumped) ``` System (please complete the following information): - Ubuntu 18.04.1 LTS - Browser: not applicable - Jellyfin Version: 10.3.2 (via official docker image)
Author
Owner

@stale[bot] commented on GitHub (Jul 29, 2019):

Issues go stale after 60d of inactivity. Mark the issue as fresh by adding a comment or commit. Stale issues close after an additional 7d of inactivity. If this issue is safe to close now please do so. If you have any questions you can reach us on Matrix or Social Media.

@stale[bot] commented on GitHub (Jul 29, 2019): Issues go stale after 60d of inactivity. Mark the issue as fresh by adding a comment or commit. Stale issues close after an additional 7d of inactivity. If this issue is safe to close now please do so. If you have any questions you can reach us on [Matrix or Social Media](https://jellyfin.readthedocs.io/en/latest/getting-help/).
Author
Owner

@101100 commented on GitHub (Aug 6, 2019):

This is still an issue:

[11:00:18] [ERR] Error processing request
System.UnauthorizedAccessException: Access to the path '/media/Music/Most/Jon Batiste/2018 Hollywood Africans/01 Kenner Boogie.flac' is denied. ---> System.IO.IOException: Permission denied
   --- End of inner exception stack trace ---
   at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at Emby.Server.Implementations.IO.ManagedFileSystem.GetFileStream(String path, FileOpenMode mode, FileAccessMode access, FileShareMode share, FileOpenOptions fileOpenOptions)
   at Emby.Server.Implementations.HttpServer.HttpResultFactory.<>c__DisplayClass25_0.<GetStaticFileResult>b__0()
   at Emby.Server.Implementations.HttpServer.HttpResultFactory.GetStaticResult(IRequest requestContext, StaticResultOptions options)
   at MediaBrowser.Api.Playback.Progressive.BaseProgressiveStreamingService.ProcessRequest(StreamRequest request, Boolean isHeadRequest)
   at MediaBrowser.Api.Playback.UniversalAudioService.GetUniversalStream(GetUniversalAudioStream request, Boolean isHeadRequest)
   at Emby.Server.Implementations.Services.ServiceExecGeneral.GetTaskResult(Task task)
   at Emby.Server.Implementations.Services.ServiceHandler.ProcessRequestAsync(HttpListenerHost appHost, IRequest httpReq, IResponse httpRes, ILogger logger, String operationName, CancellationToken cancellationToken)
   at Emby.Server.Implementations.HttpServer.HttpListenerHost.RequestHandler(IHttpRequest httpReq, String urlString, String host, String localPath, CancellationToken cancellationToken)
[11:00:18] [INF] User policy for 101100. EnableAudioPlaybackTranscoding: True
[11:00:18] [INF] Setting range response values for /media/Music/Most/Jon Batiste/2018 Hollywood Africans/01 Kenner Boogie.flac. RangeRequest: bytes=0- Content-Length: 15225571, Content-Range: bytes 0-15225570/15225571
[11:00:18] [ERR] Error processing request
System.UnauthorizedAccessException: Access to the path '/media/Music/Most/Jon Batiste/2018 Hollywood Africans/01 Kenner Boogie.flac' is denied. ---> System.IO.IOException: Permission denied
   --- End of inner exception stack trace ---
   at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at Emby.Server.Implementations.IO.ManagedFileSystem.GetFileStream(String path, FileOpenMode mode, FileAccessMode access, FileShareMode share, FileOpenOptions fileOpenOptions)
   at Emby.Server.Implementations.SocketSharp.WebSocketSharpResponse.TransmitFile(String path, Int64 offset, Int64 count, FileShareMode fileShareMode, IFileSystem fileSystem, IStreamHelper streamHelper, CancellationToken cancellationToken)
   at Emby.Server.Implementations.HttpServer.FileWriter.WriteToAsync(IResponse response, CancellationToken cancellationToken)
   at Emby.Server.Implementations.Services.ServiceHandler.ProcessRequestAsync(HttpListenerHost appHost, IRequest httpReq, IResponse httpRes, ILogger logger, String operationName, CancellationToken cancellationToken)
   at Emby.Server.Implementations.HttpServer.HttpListenerHost.RequestHandler(IHttpRequest httpReq, String urlString, String host, String localPath, CancellationToken cancellationToken)
[11:00:18] [INF] Playback stopped reported by app Jellyfin Web 10.3.7 playing Kenner Boogie. Stopped at 0 ms
Segmentation fault (core dumped)
[11:00:20] [INF] Jellyfin version: 10.3.7.0
[11:00:20] [INF] Arguments: ["/jellyfin/jellyfin.dll", "--datadir", "/config", "--cachedir", "/cache", "--ffmpeg", "/usr/local/bin/ffmpeg"]
[11:00:20] [INF] Operating system: Linux 4.15.0.47
[11:00:20] [INF] Architecture: X64
[11:00:20] [INF] 64-Bit Process: True
[11:00:20] [INF] User Interactive: True
[11:00:20] [INF] Processor count: 4
[11:00:20] [INF] Program data path: /config
[11:00:20] [INF] Web resources path: /jellyfin/jellyfin-web/src
[11:00:20] [INF] Application directory: /jellyfin/
[11:00:20] [INF] Setting cache path to /cache
[11:00:21] [INF] Loading assemblies
...

System:

Ubuntu 18.04.1 LTS
Browser: not applicable
Jellyfin Version: 10.3.7 (via official docker image)

@101100 commented on GitHub (Aug 6, 2019): This is still an issue: ``` [11:00:18] [ERR] Error processing request System.UnauthorizedAccessException: Access to the path '/media/Music/Most/Jon Batiste/2018 Hollywood Africans/01 Kenner Boogie.flac' is denied. ---> System.IO.IOException: Permission denied --- End of inner exception stack trace --- at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter) at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at Emby.Server.Implementations.IO.ManagedFileSystem.GetFileStream(String path, FileOpenMode mode, FileAccessMode access, FileShareMode share, FileOpenOptions fileOpenOptions) at Emby.Server.Implementations.HttpServer.HttpResultFactory.<>c__DisplayClass25_0.<GetStaticFileResult>b__0() at Emby.Server.Implementations.HttpServer.HttpResultFactory.GetStaticResult(IRequest requestContext, StaticResultOptions options) at MediaBrowser.Api.Playback.Progressive.BaseProgressiveStreamingService.ProcessRequest(StreamRequest request, Boolean isHeadRequest) at MediaBrowser.Api.Playback.UniversalAudioService.GetUniversalStream(GetUniversalAudioStream request, Boolean isHeadRequest) at Emby.Server.Implementations.Services.ServiceExecGeneral.GetTaskResult(Task task) at Emby.Server.Implementations.Services.ServiceHandler.ProcessRequestAsync(HttpListenerHost appHost, IRequest httpReq, IResponse httpRes, ILogger logger, String operationName, CancellationToken cancellationToken) at Emby.Server.Implementations.HttpServer.HttpListenerHost.RequestHandler(IHttpRequest httpReq, String urlString, String host, String localPath, CancellationToken cancellationToken) [11:00:18] [INF] User policy for 101100. EnableAudioPlaybackTranscoding: True [11:00:18] [INF] Setting range response values for /media/Music/Most/Jon Batiste/2018 Hollywood Africans/01 Kenner Boogie.flac. RangeRequest: bytes=0- Content-Length: 15225571, Content-Range: bytes 0-15225570/15225571 [11:00:18] [ERR] Error processing request System.UnauthorizedAccessException: Access to the path '/media/Music/Most/Jon Batiste/2018 Hollywood Africans/01 Kenner Boogie.flac' is denied. ---> System.IO.IOException: Permission denied --- End of inner exception stack trace --- at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter) at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at Emby.Server.Implementations.IO.ManagedFileSystem.GetFileStream(String path, FileOpenMode mode, FileAccessMode access, FileShareMode share, FileOpenOptions fileOpenOptions) at Emby.Server.Implementations.SocketSharp.WebSocketSharpResponse.TransmitFile(String path, Int64 offset, Int64 count, FileShareMode fileShareMode, IFileSystem fileSystem, IStreamHelper streamHelper, CancellationToken cancellationToken) at Emby.Server.Implementations.HttpServer.FileWriter.WriteToAsync(IResponse response, CancellationToken cancellationToken) at Emby.Server.Implementations.Services.ServiceHandler.ProcessRequestAsync(HttpListenerHost appHost, IRequest httpReq, IResponse httpRes, ILogger logger, String operationName, CancellationToken cancellationToken) at Emby.Server.Implementations.HttpServer.HttpListenerHost.RequestHandler(IHttpRequest httpReq, String urlString, String host, String localPath, CancellationToken cancellationToken) [11:00:18] [INF] Playback stopped reported by app Jellyfin Web 10.3.7 playing Kenner Boogie. Stopped at 0 ms Segmentation fault (core dumped) [11:00:20] [INF] Jellyfin version: 10.3.7.0 [11:00:20] [INF] Arguments: ["/jellyfin/jellyfin.dll", "--datadir", "/config", "--cachedir", "/cache", "--ffmpeg", "/usr/local/bin/ffmpeg"] [11:00:20] [INF] Operating system: Linux 4.15.0.47 [11:00:20] [INF] Architecture: X64 [11:00:20] [INF] 64-Bit Process: True [11:00:20] [INF] User Interactive: True [11:00:20] [INF] Processor count: 4 [11:00:20] [INF] Program data path: /config [11:00:20] [INF] Web resources path: /jellyfin/jellyfin-web/src [11:00:20] [INF] Application directory: /jellyfin/ [11:00:20] [INF] Setting cache path to /cache [11:00:21] [INF] Loading assemblies ... ``` System: Ubuntu 18.04.1 LTS Browser: not applicable Jellyfin Version: 10.3.7 (via official docker image)
Author
Owner

@stale[bot] commented on GitHub (Nov 4, 2019):

Issues go stale after 90d of inactivity. Mark the issue as fresh by adding a comment or commit. Stale issues close after an additional 14d of inactivity. If this issue is safe to close now please do so. If you have any questions you can reach us on Matrix or Social Media.

@stale[bot] commented on GitHub (Nov 4, 2019): Issues go stale after 90d of inactivity. Mark the issue as fresh by adding a comment or commit. Stale issues close after an additional 14d of inactivity. If this issue is safe to close now please do so. If you have any questions you can reach us on [Matrix or Social Media](https://docs.jellyfin.org/general/getting-help.html).
Author
Owner

@101100 commented on GitHub (Nov 4, 2019):

@anthonylavado If you'd like, I can test this again on the latest build, but I suspect it isn't fixed yet based on the release notes.

@101100 commented on GitHub (Nov 4, 2019): @anthonylavado If you'd like, I can test this again on the latest build, but I suspect it isn't fixed yet based on the release notes.
Author
Owner

@GeoffreyFrogeye commented on GitHub (Dec 5, 2019):

Can confirm it is still a problem. For me it happens when creating a collage. I can run jellyfin as many times as I want, it will always crash aout 1 minute after launch when re scanning the library.

Adding reading rights fixes the segmentation fault. Inaccessible files seem to cause an issue, however inacessible directories only seem to prevent the directory watcher from working (which is another issue but minor).

I don't have a stack trace as others, so here's a log with file activity information.

$ strace -f -t -e trace=file /usr/bin/dotnet /usr/lib/jellyfin/jellyfin.dll --datadir ${JELLYFIN_DATA_DIRECTORY} --cachedir ${JELLYFIN_CACHE_DIRECTORY} ${JELLYFIN_ADD_OPTS`

[Normal behavior]

[23:43:48] [INF] Creating image collage and saving to /var/cache/jellyfin/temp/6d86d0cad6354fcfaa0ed94f7521d55c.png
[pid 22684] 23:43:48 stat64("/home/user/Music/Artist 1/Album 1/cover.jpg", {st_mode=S_IFREG|0644, st_size=356766, ...}) = 0
[pid 22684] 23:43:48 openat(AT_FDCWD, "/home/user/Music/Artist 1/Album 1/cover.jpg", O_RDONLY) = 263
[pid 22684] 23:43:48 stat64("/home/user/Music/Artist 2/Album 2/cover.jpg", {st_mode=S_IFREG|0740, st_size=265758, ...}) = 0
[pid 22684] 23:43:48 openat(AT_FDCWD, "/home/user/Music/Artist 2/Album 2/cover.jpg", O_RDONLY) = -1 EACCES (Permission denied)
[pid 22684] 23:43:48 stat64("/home/user/Music/Artist 2/Album 2/cover.jpg", {st_mode=S_IFREG|0740, st_size=265758, ...}) = 0
[pid 22684] 23:43:48 openat(AT_FDCWD, "/home/user/Music/Artist 2/Album 2/cover.jpg", O_RDONLY) = -1 EACCES (Permission denied)
[pid 22684] 23:43:48 --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=NULL} ---

[Other subprocesses segfaulting]

$ ls -al '/home/user/Music/Artist 2/Album 2/cover.jpg'
-rwxr----- 1 user user 265758 Jun 19  2016 '/home/user/Music/Artist 2/Album 2/cover.jpg'

Seems like it tries twice before giving up.

  • Arch Linux ARM (Raspberry Pi 4)
  • Browser: not applicable
  • Jellyfin Version: 10.4.2 (from AUR)
@GeoffreyFrogeye commented on GitHub (Dec 5, 2019): Can confirm it is still a problem. For me it happens when creating a collage. I can run jellyfin as many times as I want, it will always crash aout 1 minute after launch when re scanning the library. Adding reading rights fixes the segmentation fault. Inaccessible files seem to cause an issue, however inacessible directories only seem to prevent the directory watcher from working (which is another issue but minor). I don't have a stack trace as others, so here's a log with file activity information. ``` $ strace -f -t -e trace=file /usr/bin/dotnet /usr/lib/jellyfin/jellyfin.dll --datadir ${JELLYFIN_DATA_DIRECTORY} --cachedir ${JELLYFIN_CACHE_DIRECTORY} ${JELLYFIN_ADD_OPTS` [Normal behavior] [23:43:48] [INF] Creating image collage and saving to /var/cache/jellyfin/temp/6d86d0cad6354fcfaa0ed94f7521d55c.png [pid 22684] 23:43:48 stat64("/home/user/Music/Artist 1/Album 1/cover.jpg", {st_mode=S_IFREG|0644, st_size=356766, ...}) = 0 [pid 22684] 23:43:48 openat(AT_FDCWD, "/home/user/Music/Artist 1/Album 1/cover.jpg", O_RDONLY) = 263 [pid 22684] 23:43:48 stat64("/home/user/Music/Artist 2/Album 2/cover.jpg", {st_mode=S_IFREG|0740, st_size=265758, ...}) = 0 [pid 22684] 23:43:48 openat(AT_FDCWD, "/home/user/Music/Artist 2/Album 2/cover.jpg", O_RDONLY) = -1 EACCES (Permission denied) [pid 22684] 23:43:48 stat64("/home/user/Music/Artist 2/Album 2/cover.jpg", {st_mode=S_IFREG|0740, st_size=265758, ...}) = 0 [pid 22684] 23:43:48 openat(AT_FDCWD, "/home/user/Music/Artist 2/Album 2/cover.jpg", O_RDONLY) = -1 EACCES (Permission denied) [pid 22684] 23:43:48 --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=NULL} --- [Other subprocesses segfaulting] $ ls -al '/home/user/Music/Artist 2/Album 2/cover.jpg' -rwxr----- 1 user user 265758 Jun 19 2016 '/home/user/Music/Artist 2/Album 2/cover.jpg' ``` Seems like it tries twice before giving up. - Arch Linux ARM (Raspberry Pi 4) - Browser: not applicable - Jellyfin Version: 10.4.2 (from [AUR](https://aur.archlinux.org/packages/jellyfin/))
Author
Owner

@DarkSkyGhost commented on GitHub (Jan 21, 2020):

I have the same problem:

[2020-01-21 16:51:54.156 +02:00] [ERR] Error in Directory watcher for: "/music" System.UnauthorizedAccessException: Access to the path '/music/Christoph de Babalon/[2018] Exquisite Angst' is denied. ---> System.IO.IOException: Permission denied --- End of inner exception stack trace --- [2020-01-21 16:51:54.161 +02:00] [INF] Stopping directory watching for path "/music"

I can access the folder in question as docker user normally inside the container.
Only the scanner fails.

Happens to a lot of random folders.
No issues with other library types.
Docker user has all the required permissions.

    1. Synology DS918+
    1. Docker
    1. Jellyfin version: 10.4.3
@DarkSkyGhost commented on GitHub (Jan 21, 2020): I have the same problem: `[2020-01-21 16:51:54.156 +02:00] [ERR] Error in Directory watcher for: "/music" System.UnauthorizedAccessException: Access to the path '/music/Christoph de Babalon/[2018] Exquisite Angst' is denied. ---> System.IO.IOException: Permission denied --- End of inner exception stack trace --- [2020-01-21 16:51:54.161 +02:00] [INF] Stopping directory watching for path "/music"` I can access the folder in question as docker user normally inside the container. Only the scanner fails. Happens to a lot of random folders. No issues with other library types. Docker user has all the required permissions. - 1. Synology DS918+ - 2. Docker - 3. Jellyfin version: 10.4.3
Author
Owner

@101100 commented on GitHub (Jan 21, 2020):

@DarkSkyGhost That would be a different issue if the permissions are actually set. This issue is for Jellyfin crashing instead of gracefully handling permission errors.

@101100 commented on GitHub (Jan 21, 2020): @DarkSkyGhost That would be a different issue if the permissions are actually set. This issue is for Jellyfin crashing instead of gracefully handling permission errors.
Author
Owner

@stale[bot] commented on GitHub (May 20, 2020):

This issue has gone 120 days without comment. To avoid abandoned issues, it will be closed in 21 days if there are no new comments.
If you're the original submitter of this issue, please comment confirming if this issue still affects you in the latest release or nightlies, or close the issue if it has been fixed. If you're another user also affected by this bug, please comment confirming so. Either action will remove the stale label.
This bot exists to prevent issues from becoming stale and forgotten. Jellyfin is always moving forward, and bugs are often fixed as side effects of other changes. We therefore ask that bug report authors remain vigilant about their issues to ensure they are closed if fixed, or re-confirmed - perhaps with fresh logs or reproduction examples - regularly. If you have any questions you can reach us on Matrix or Social Media.

@stale[bot] commented on GitHub (May 20, 2020): This issue has gone 120 days without comment. To avoid abandoned issues, it will be closed in 21 days if there are no new comments. If you're the original submitter of this issue, please comment confirming if this issue still affects you in the latest release or nightlies, or close the issue if it has been fixed. If you're another user also affected by this bug, please comment confirming so. Either action will remove the stale label. This bot exists to prevent issues from becoming stale and forgotten. Jellyfin is always moving forward, and bugs are often fixed as side effects of other changes. We therefore ask that bug report authors remain vigilant about their issues to ensure they are closed if fixed, or re-confirmed - perhaps with fresh logs or reproduction examples - regularly. If you have any questions you can reach us on [Matrix or Social Media](https://docs.jellyfin.org/general/getting-help.html).
Author
Owner

@101100 commented on GitHub (May 25, 2020):

I will see if I can reproduce this again.

@101100 commented on GitHub (May 25, 2020): I will see if I can reproduce this again.
Author
Owner

@101100 commented on GitHub (May 25, 2020):

The exception is no longer in the log, but making a cover art image unreadable by Jellyfin causes the server to restart when that artist is viewed in the web UI. Tested with Jellyfin 10.5.5 using the official Docker image.

@dkanada This isn't stale and so it might deserve to get the "To do" label back.

@101100 commented on GitHub (May 25, 2020): The exception is no longer in the log, but making a cover art image unreadable by Jellyfin causes the server to restart when that artist is viewed in the web UI. Tested with Jellyfin 10.5.5 using the official Docker image. @dkanada This isn't stale and so it might deserve to get the "To do" label back.
Author
Owner

@ferferga commented on GitHub (Mar 9, 2021):

@101100 @lbeltrame @GeoffreyFrogeye @DarkSkyGhost Can you gus please check in 10.7. I tried to reproduce and it seems that they're handled gracefully now.

@ferferga commented on GitHub (Mar 9, 2021): @101100 @lbeltrame @GeoffreyFrogeye @DarkSkyGhost Can you gus please check in 10.7. I tried to reproduce and it seems that they're handled gracefully now.
Author
Owner

@101100 commented on GitHub (Mar 9, 2021):

@ferferga I can confirm that removing permissions from a cover art just results in what looks like a very blurry cover art image and restoring permissions and reloading returns the correct cover art. Missing permissions on a song results in an error if you play, but doesn't crash the server and restoring the permission allows the song to play right away. Thanks!

@101100 commented on GitHub (Mar 9, 2021): @ferferga I can confirm that removing permissions from a cover art just results in what looks like a very blurry cover art image and restoring permissions and reloading returns the correct cover art. Missing permissions on a song results in an error if you play, but doesn't crash the server and restoring the permission allows the song to play right away. Thanks!
Author
Owner

@ferferga commented on GitHub (Mar 9, 2021):

@101100 Great, thank you very much for testing!

Closing this

@ferferga commented on GitHub (Mar 9, 2021): @101100 Great, thank you very much for testing! Closing this
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#374