Jump to content

Emby filesystem error with 4.8.5.0


Shoopoo

Recommended Posts

Shoopoo

I'm running Emby on Ubuntu 22.04.4 LTS. During operation I'm getting this error several times:

 

2024-04-23 09:07:45.914 Info Server: http/1.1 POST http://host2:8096/host2/Sessions/Capabilities/Full?X-Emby-Client=Emby Web&X-Emby-Device-Name=Chrome Windows&X-Emby-Device-Id=be58799c-2bc9-42ae-894d-004ab0b338e6&X-Emby-Client-Version=4.8.5.0&X-Emby-Token=x_secret1_x&X-Emby-Language=de&reqformat=json. UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
2024-04-23 09:07:45.915 Info Server: http/1.1 Response 204 to host1. Time: 2ms. POST http://host2:8096/host2/Sessions/Capabilities/Full?X-Emby-Client=Emby Web&X-Emby-Device-Name=Chrome Windows&X-Emby-Device-Id=be58799c-2bc9-42ae-894d-004ab0b338e6&X-Emby-Client-Version=4.8.5.0&X-Emby-Token=x_secret1_x&X-Emby-Language=de&reqformat=json
2024-04-23 09:07:52.669 Error Server: Error processing request
	*** Error Report ***
	Version: 4.8.5.0
	Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffdetect /opt/emby-server/bin/ffdetect -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
	Operating system: Linux version 5.15.0-105-generic (buildd@lcy02-amd64-007) (gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #115-Ubun
	Framework: .NET 6.0.25
	OS/Process: x64/x64
	Runtime: opt/emby-server/system/System.Private.CoreLib.dll
	Processor count: 6
	Data path: /var/lib/emby
	Application path: /opt/emby-server/system
	System.IO.IOException: System.IO.IOException: File Reading Failed.
	   at EzSmb.Streams.ReaderStream.InnerRead(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancelToken)
	   at EzSmb.Streams.ReaderStream.Read(Byte[] buffer, Int32 offset, Int32 count)
	   at System.IO.Stream.<>c.<BeginReadInternal>b__40_0(Object <p0>)
	   at System.Threading.Tasks.Task`1.InnerInvoke()
	   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
	--- End of stack trace from previous location ---
	   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
	--- End of stack trace from previous location ---
	   at Emby.Server.Implementations.IO.StreamHelper.CopyToAsync(Stream source, PipeWriter destination, Int32 bufferSize, CancellationToken cancellationToken)
	   at Emby.Server.Implementations.HttpServer.FileWriter.WriteToAsync(IResponse response, CancellationToken cancellationToken)
	   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: Emby.Server.Implementations
	TargetSite: Int32 InnerRead(Byte[], Int32, Int32, System.Threading.CancellationToken)

I don't know what exactly causes this and how to resolve this. Any advice please?

Edited by Shoopoo
Link to comment
Share on other sites

Hi there, please attach the complete Emby server log file. Thanks.

Link to comment
Share on other sites

Shoopoo
12 hours ago, Luke said:

Hi there, please attach the complete Emby server log file. Thanks.

Already found the error. It's a permission problem of the share to the NAS.
Western Digital grants only read permissions with public shares, no write permissions. Will Emby support NTLM auth for SMB shares in the future? As I see in the code that there is already a NTLM auth variable in the function.

  • Thanks 1
Link to comment
Share on other sites

When you setup your library you can configure username and password to access the folder.

 But I would suggest instead of that to mount it to a local path on the machine and then use the local path with Emby.

  • Like 1
Link to comment
Share on other sites

Shoopoo
21 minutes ago, Luke said:

When you setup your library you can configure username and password to access the folder.

 But I would suggest instead of that to mount it to a local path on the machine and then use the local path with Emby.

Yes, might be better to mount this via CIFS. 
Out of curiosity: where is the option to set the username and password when adding a library? I don't see it (using 4.8.5.0)
I have only this:

image.png.3bb73755a222d056c2737e046335c951.png

Link to comment
Share on other sites

It should be right there. Is that the web app?

Link to comment
Share on other sites

Shoopoo
10 hours ago, Luke said:

It should be right there. Is that the web app?

Yes, it's the webpage of Emby.
Here's the bottom of the dialogue:

image.png.82070163683244fb32df8e489f40fb00.png

Link to comment
Share on other sites

What if you enter the path using unc conventions instead? 

Link to comment
Share on other sites

Shoopoo
59 minutes ago, Luke said:

What if you enter the path using unc conventions instead? 

Then I see the dialogue with username and password.
Maybe it should also be added if the path begins with

smb://

 

  • Thanks 1
Link to comment
Share on other sites

Shoopoo
2024-04-25 10:40:12.796 Info App: Movie Theme Songs - Moving /var/lib/emby/cache/temp/55a8d404-163a-4b8a-a434-977962d1e80a.tmp to smb:/192.168.8.3/Public/Shared Videos/Filme/Life of Brian/theme.mp3
2024-04-25 10:40:12.798 Error App: Movie Theme Songs - Error downloading file from host
	*** Error Report ***
	Version: 4.8.5.0
	Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffdetect /opt/emby-server/bin/ffdetect -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
	Operating system: Linux version 5.15.0-105-generic (buildd@lcy02-amd64-007) (gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #115-Ubun
	Framework: .NET 6.0.25
	OS/Process: x64/x64
	Runtime: opt/emby-server/system/System.Private.CoreLib.dll
	Processor count: 6
	Data path: /var/lib/emby
	Application path: /opt/emby-server/system
	System.UnauthorizedAccessException: System.UnauthorizedAccessException: Access to the path '/opt/emby-server/smb:/192.168.8.3/Public/Shared Videos/Filme/Life of Brian' is denied.
	 ---> System.IO.IOException: Permission denied
	   --- End of inner exception stack trace ---
	   at System.IO.FileSystem.CreateDirectory(String fullPath)
	   at System.IO.Directory.CreateDirectory(String path)
	   at MovieThemeSongs.Search.LocalMovieThemeSongDownloader.DownloadMovieThemeSongForItem(BaseItem item, CancellationToken cancellationToken, String html, String data, String uploadedhtml, ILibraryManager libraryManager)
	Source: System.Private.CoreLib
	TargetSite: Void CreateDirectory(System.String)
	InnerException: System.IO.IOException: Permission denied
	Source: 
	TargetSite: 

To further dig into the topic of SMB shares and resulting permission errors.
The share is restricted to a given user with password, read and write permissions. The credentials are working when reading the library, the share cannot be read without a valid user.
I have the problem now that plugins have permission problems to write to the shared folder.
When I mount it via CIFS with the same user I also set up in emby to login to the share I am able to write files. Could it be that plugins are not using the credentials when writing to a SMB share?
And yes, I know mounting it via CIFS inside linux would be the better solution. But I am also reporting this behaviour of Emby.

Link to comment
Share on other sites

8 hours ago, Shoopoo said:
2024-04-25 10:40:12.796 Info App: Movie Theme Songs - Moving /var/lib/emby/cache/temp/55a8d404-163a-4b8a-a434-977962d1e80a.tmp to smb:/192.168.8.3/Public/Shared Videos/Filme/Life of Brian/theme.mp3
2024-04-25 10:40:12.798 Error App: Movie Theme Songs - Error downloading file from host
	*** Error Report ***
	Version: 4.8.5.0
	Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffdetect /opt/emby-server/bin/ffdetect -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
	Operating system: Linux version 5.15.0-105-generic (buildd@lcy02-amd64-007) (gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #115-Ubun
	Framework: .NET 6.0.25
	OS/Process: x64/x64
	Runtime: opt/emby-server/system/System.Private.CoreLib.dll
	Processor count: 6
	Data path: /var/lib/emby
	Application path: /opt/emby-server/system
	System.UnauthorizedAccessException: System.UnauthorizedAccessException: Access to the path '/opt/emby-server/smb:/192.168.8.3/Public/Shared Videos/Filme/Life of Brian' is denied.
	 ---> System.IO.IOException: Permission denied
	   --- End of inner exception stack trace ---
	   at System.IO.FileSystem.CreateDirectory(String fullPath)
	   at System.IO.Directory.CreateDirectory(String path)
	   at MovieThemeSongs.Search.LocalMovieThemeSongDownloader.DownloadMovieThemeSongForItem(BaseItem item, CancellationToken cancellationToken, String html, String data, String uploadedhtml, ILibraryManager libraryManager)
	Source: System.Private.CoreLib
	TargetSite: Void CreateDirectory(System.String)
	InnerException: System.IO.IOException: Permission denied
	Source: 
	TargetSite: 

To further dig into the topic of SMB shares and resulting permission errors.
The share is restricted to a given user with password, read and write permissions. The credentials are working when reading the library, the share cannot be read without a valid user.
I have the problem now that plugins have permission problems to write to the shared folder.
When I mount it via CIFS with the same user I also set up in emby to login to the share I am able to write files. Could it be that plugins are not using the credentials when writing to a SMB share?
And yes, I know mounting it via CIFS inside linux would be the better solution. But I am also reporting this behaviour of Emby.

Hi, the core server has special file system api's that we've added for plugins to use, however I know that many third party plugins from community members are not using it and are just using the stock .net file api's. So that would explain that. I would report it to the developer of the plugin.

  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...