Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misleading error if file has wrong permissions #3880

Open
MightyPork opened this issue Jan 28, 2025 · 2 comments
Open

Misleading error if file has wrong permissions #3880

MightyPork opened this issue Jan 28, 2025 · 2 comments

Comments

@MightyPork
Copy link

MightyPork commented Jan 28, 2025

I had some music files that had permissions 660, so Emby couldn't read them by its user.

This error does not help:

Image

I thought it isn't able to stream Flac, so I converted it to mp3 but that still didn't play. Then I checked permissions and found the issue. Would be great if this (probably somewhat common?) problem was better reported

Running Emby 4.8.10.0 in docker on Linux

@LukePulverenti
Copy link
Member

Hi there, please attach the emby server log from when this happened. Thanks.

@MightyPork
Copy link
Author

This one?

It is super easy to reproduce, just chmod some file so emby can't read it. The same error message shows with video files.

*** Error Report ***
Version: 4.8.10.0
Command line: /system/EmbyServer.dll -programdata /config -ffdetect /bin/ffdetect -ffmpeg /bin/ffmpeg -ffprobe /bin/ffprobe -restartexitcode 3
Operating system: Linux version 6.6.44-production+truenas ([email protected]) (gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1
Framework: .NET 6.0.31
OS/Process: x64/x64
Runtime: system/System.Private.CoreLib.dll
Processor count: 3
Data path: /config
Application path: /system
System.UnauthorizedAccessException: System.UnauthorizedAccessException: Access to the path '/mnt/Music/Artists/Alternative/Beta Radio/Colony of Bees/01 Take My Photograph.mp3' 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 Interop.CheckIo(Error error, String path, Boolean isDirectory, Func`2 errorRewriter)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
at System.IO.Strategies.FileStreamHelpers.ChooseStrategy(FileStream fileStream, String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, Int64 preallocationSize)
at System.IO.FileStream..ctor(String path, FileStreamOptions options)
at Emby.Server.Implementations.IO.ManagedFileSystem.GetFileStream(String path, FileOpenMode mode, FileAccessMode access, FileShareMode share, Int32 bufferSize, FileOpenOptions fileOpenOptions, Int64 preAllocationSize)
at Emby.Server.Implementations.IO.ManagedFileSystem.GetFileStream(String path, FileOpenMode mode, FileAccessMode access, FileShareMode share, Int32 bufferSize, FileOpenOptions fileOpenOptions)
at Emby.Server.Implementations.IO.IOManager.GetResponse(HttpRequestOptions options, MediaProtocol protocol)
at Emby.Server.Implementations.IO.IOManager.GetResponse(HttpRequestOptions options)
at Emby.Server.Implementations.HttpServer.HttpResultFactory.GetContent(StaticFileResultOptions options, Int64 offset, Int64 length, CancellationToken cancellationToken)
at Emby.Server.Implementations.HttpServer.FileWriter.SetContentResponseHeaders(Nullable`1 reportedTotalContentLength, CancellationToken cancellationToken)
at Emby.Server.Implementations.HttpServer.HttpResultFactory.GetStaticResult(IRequest requestContext, StaticResultOptions options)
at Emby.Server.MediaEncoding.Api.Progressive.BaseProgressiveStreamingService.ProcessRequest(StreamRequest request, Boolean isHeadRequest)
at Emby.Server.MediaEncoding.Api.UniversalAudioService.GetUniversalStream(GetUniversalAudioStream request, Boolean isHeadRequest, CancellationToken cancellationToken)
at Emby.Server.Implementations.Services.ServiceController.GetTaskResult(Task task)
at Emby.Server.Implementations.Services.ServiceHandler.ProcessRequestAsync(HttpListenerHost httpHost, IServerApplicationHost appHost, IRequest httpReq, IResponse httpRes, IStreamHelper streamHelper, RestPath restPath, String responseContentType, CancellationToken cancellationToken)
at Emby.Server.Implementations.HttpServer.HttpListenerHost.RequestHandler(IRequest httpReq, ReadOnlyMemory`1 urlString, ReadOnlyMemory`1 localPath, CancellationToken cancellationToken)
Source: System.Private.CoreLib
TargetSite: Void ThrowExceptionForIoErrno(ErrorInfo, System.String, Boolean, System.Func`2[Interop+ErrorInfo,Interop+ErrorInfo])
InnerException: System.IO.IOException: Permission denied
Source:
TargetSite:
2025-02-01 13:13:29.467 Info Server: http/1.1 Response 500 to host2. Time: 26ms. HEAD http://host1:9096/emby/Audio/4600/universal?UserId=101b09916ac84b65bbc165cea4a5ccc2&DeviceId=853c3bf4-da7f-49ee-911f-cf6ce9982ce4&MaxStreamingBitrate=200000000&Container=opus,mp3|mp3,mp2,mp3|mp2,aac|aac,m4a|aac,mp4|aac,flac,webma,webm,wav|PCM_S16LE,wav|PCM_S24LE,ogg&TranscodingContainer=aac&TranscodingProtocol=hls&AudioCodec=aac&api_key=x_secret1_x&PlaySessionId=1738411913267&StartTimeTicks=0&EnableRedirection=true&EnableRemoteMedia=false
2025-02-01 13:13:29.480 Info Server: http/1.1 GET http://host1:9096/emby/Audio/4600/universal?UserId=101b09916ac84b65bbc165cea4a5ccc2&DeviceId=853c3bf4-da7f-49ee-911f-cf6ce9982ce4&MaxStreamingBitrate=200000000&Container=opus,mp3|mp3,mp2,mp3|mp2,aac|aac,m4a|aac,mp4|aac,flac,webma,webm,wav|PCM_S16LE,wav|PCM_S24LE,ogg&TranscodingContainer=aac&TranscodingProtocol=hls&AudioCodec=aac&api_key=x_secret1_x&PlaySessionId=1738411913267&StartTimeTicks=0&EnableRedirection=true&EnableRemoteMedia=false. Source Ip: host2, Accept=*/*, Connection=keep-alive, Host=host3, User-Agent=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36, Accept-Encoding=identity;q=1, *;q=0, Accept-Language=en-US,en;q=0.9,cs;q=0.8,sk;q=0.7,hy;q=0.6,pl;q=0.5,es;q=0.4, Range=bytes=0-, Referer=host4
2025-02-01 13:13:29.481 Info App: User policy for Ondra. EnableAudioPlaybackTranscoding: True
2025-02-01 13:13:29.481 Info SessionManager: Adding playSession 1738411913267 to session 308af7ff93f31de5dd4fd318cc964635
2025-02-01 13:13:29.483 Error Server: Error processing request
*** Error Report ***
Version: 4.8.10.0
Command line: /system/EmbyServer.dll -programdata /config -ffdetect /bin/ffdetect -ffmpeg /bin/ffmpeg -ffprobe /bin/ffprobe -restartexitcode 3
Operating system: Linux version 6.6.44-production+truenas ([email protected]) (gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1
Framework: .NET 6.0.31
OS/Process: x64/x64
Runtime: system/System.Private.CoreLib.dll
Processor count: 3
Data path: /config
Application path: /system
System.UnauthorizedAccessException: System.UnauthorizedAccessException: Access to the path '/mnt/Music/Artists/Alternative/Beta Radio/Colony of Bees/01 Take My Photograph.mp3' 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 Interop.CheckIo(Error error, String path, Boolean isDirectory, Func`2 errorRewriter)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
at System.IO.Strategies.FileStreamHelpers.ChooseStrategy(FileStream fileStream, String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, Int64 preallocationSize)
at System.IO.FileStream..ctor(String path, FileStreamOptions options)
at Emby.Server.Implementations.IO.ManagedFileSystem.GetFileStream(String path, FileOpenMode mode, FileAccessMode access, FileShareMode share, Int32 bufferSize, FileOpenOptions fileOpenOptions, Int64 preAllocationSize)
at Emby.Server.Implementations.IO.ManagedFileSystem.GetFileStream(String path, FileOpenMode mode, FileAccessMode access, FileShareMode share, Int32 bufferSize, FileOpenOptions fileOpenOptions)
at Emby.Server.Implementations.IO.IOManager.GetResponse(HttpRequestOptions options, MediaProtocol protocol)
at Emby.Server.Implementations.IO.IOManager.GetResponse(HttpRequestOptions options)
at Emby.Server.Implementations.HttpServer.HttpResultFactory.GetContent(StaticFileResultOptions options, Int64 offset, Int64 length, CancellationToken cancellationToken)
at Emby.Server.Implementations.HttpServer.FileWriter.SetContentResponseHeaders(Nullable`1 reportedTotalContentLength, CancellationToken cancellationToken)
at Emby.Server.Implementations.HttpServer.HttpResultFactory.GetStaticResult(IRequest requestContext, StaticResultOptions options)
at Emby.Server.MediaEncoding.Api.Progressive.BaseProgressiveStreamingService.ProcessRequest(StreamRequest request, Boolean isHeadRequest)
at Emby.Server.MediaEncoding.Api.UniversalAudioService.GetUniversalStream(GetUniversalAudioStream request, Boolean isHeadRequest, CancellationToken cancellationToken)
at Emby.Server.Implementations.Services.ServiceController.GetTaskResult(Task task)
at Emby.Server.Implementations.Services.ServiceHandler.ProcessRequestAsync(HttpListenerHost httpHost, IServerApplicationHost appHost, IRequest httpReq, IResponse httpRes, IStreamHelper streamHelper, RestPath restPath, String responseContentType, CancellationToken cancellationToken)
at Emby.Server.Implementations.HttpServer.HttpListenerHost.RequestHandler(IRequest httpReq, ReadOnlyMemory`1 urlString, ReadOnlyMemory`1 localPath, CancellationToken cancellationToken)
Source: System.Private.CoreLib
TargetSite: Void ThrowExceptionForIoErrno(ErrorInfo, System.String, Boolean, System.Func`2[Interop+ErrorInfo,Interop+ErrorInfo])
InnerException: System.IO.IOException: Permission denied
Source:
TargetSite:


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants