Jump to content

File Permissions Guide for New Linux Users


Go to solution Solved by Richard Branches,

Recommended Posts

Posted

Which change? Basically any changes to the setup require that you recreate the container so yes, you run it through again.

If you've gotten as far as adding users, libraries and scanning then you might want to preserve that info unless it was quick and small in the first place. In that case starting over could be just as quick.

On the container side the paths can remain the same so it's a matter of copying/moving to change the location on the host side if you want to save your progress so far.

  • 3 weeks later...
Posted (edited)

Okay went back at it after messing around with debian without proxmox...

 

docker run -d \
  --name=emby \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Etc/UTC \
  -p 8096:8096 \
  -p 8920:8920 `#optional` \
  -v /var/lib/emby:/config \
  -v /media/share/series:/data/tvshows \
  -v /media/share/movies:/data/movies \
  -v /opt/vc/lib:/opt/vc/lib `#optional` \
  --device /dev/dri:/dev/dri `#optional` \
  --restart unless-stopped \
  lscr.io/linuxserver/emby:latest

/media/share/series (and movies) are SMB shares mounted in fstab, I can see the content when LS'ing the directory.

 

But emby still won't show me anything below /media/

Both media (that I can see in emby interface) and share (right under media) look the same though...

drwxr-xr-x   4 root root  4096 13 oct.  01:18 media

drwxr-xr-x   4 root root 4096 13 oct.  01:19 share


What am I doing wrong ? I tried adding the uid thing mentioned in earlier comments in fstab, might have done it wrong (but debian reported no error) :

 

//192.168.1.25/movies /media/share/movies cifs rw,uid=1000,gid=1000,username=batuu,password=PASSWORD 0 0
//192.168.1.25/series /media/share/series cifs username=batuu,password=PASSWORD 0 0

 

Edited by Hairlock
Posted

Read through the thread below to see if the mount options in the fstab entries are helpful. If you can see the contents of movies and series from the shell then it should also work in Docker. The trick is to make sure the given UID/GID has access. There are options in this thread that could be relevant.

 

 

 

Posted (edited)

Doesn't seem to be working, am I doing it wrong ?

image.png.002716e7d980cdc5b69af5c353357ad2.png

I can see the data in the terminal with an LS, so that must be an emby permission issue of some sort...

Edited by Hairlock
Posted

Okay I figured it out : in docker you set this like that (in my case at least).

  -v /media/share/series:/data/tvshows \
  -v /media/share/movies:/data/movies \

That means emby will find the relevant data not in "media/share" but in "data/tvshows".

100% next time I install I get this wrong again. Thanks for your support guys, and sorry for my noobiness :P

  • Like 1
Posted

You were trying to find the files using the host path instead of the container path? I didn't catch on to that from your posts. 

  • 4 months later...
Nitro_Zeus
Posted

@thefirstofthe300 I have spinned up a PC with Ubuntu 22.04 and when I want to upload my certificate, i can only see some /snap, etc. storage locations. i cant even see documents, downloads etc. how do I give emby the right to look at my documents and second hard drive 

image.png.3952e2bc4b5236552e5079c590558b45.png

Posted
11 minutes ago, Nitro_Zeus said:

@thefirstofthe300 I have spinned up a PC with Ubuntu 22.04 and when I want to upload my certificate, i can only see some /snap, etc. storage locations. i cant even see documents, downloads etc. how do I give emby the right to look at my documents and second hard drive 

image.png.3952e2bc4b5236552e5079c590558b45.png

Hi, try you try typing in the path manually?

Nitro_Zeus
Posted

i could gain access to /home/ and find documents from there. 

How do i give emby permission to look at my external drive? 
Sorry for bad picture quality

 

image.thumb.png.e5f064b5046966a4cfecddc8845d9dfc.png

Posted
24 minutes ago, Nitro_Zeus said:

i could gain access to /home/ and find documents from there. 

How do i give emby permission to look at my external drive? 
Sorry for bad picture quality

 

image.thumb.png.e5f064b5046966a4cfecddc8845d9dfc.png

Did you go through the advice in the first post of this topic?

Nitro_Zeus
Posted

i did, but its hard to usnerstand what I need to do based on what he's writing, I'm not that good to file permissions on linux :(

Posted
8 hours ago, Nitro_Zeus said:

i did, but its hard to usnerstand what I need to do based on what he's writing, I'm not that good to file permissions on linux :(

Hi, where are you stuck?

  • 3 weeks later...
Posted

Hi all,

I am having a permission problem setting up emby on a rasberry pi running. Emby is running fine and it can read my media library, but what it can't do is write properly.
I have my media library running on an old Windows box, so I am using fstab to mount the shared folder to the emby server. My fstab looks like this 

//192.168.0.104/Shared\040Folders /mnt/homeserver cifs vers=3.0,gid=users,dir_mode=0775,auto,credentials=/home/ryan/.credfile 0 0

I have added the emby user to my users group by running this command

sudo usermod -a -G users emby

so now my /etc/group file has this line 

users:x:100:ryan,emby

and when I run `ls -l` on the directory that has all my movie folders I see results like this

drwxrwxr-x 2 ryan users 0 Mar 27 00:51  TOP_GUN
drwxrwxr-x 2 ryan users 0 Mar 26 14:49  TOP_GUN_MAVERICK

When I run `ls -l` on a specific directory I get

-rwxr-xr-x 1 ryan users 37786506317 Dec 26 04:15 TOP_GUN__MAVERICK.mp4

After running a refresh of the metadata an nfo file is created, but it is empty

-rwxr-xr-x 1 ryan users 37786506317 Dec 26 04:15 TOP_GUN__MAVERICK.mp4
-rwxr-xr-x 1 ryan users           0 Mar 27 02:06 TOP_GUN__MAVERICK.nfo


When I check the logs this is what I see

2024-03-27 02:05:53.841 Info MediaProbeManager: ProcessRun 'ffprobe' Execute: /opt/emby-server/bin/ffprobe -i file:"/mnt/homeserver/Movies/TOP_GUN/TOP_GUN.mp4" -threads 0 -v info -print_format json -show_streams -show_chapters -show_format -show_data
2024-03-27 02:05:54.502 Info MediaProbeManager: ProcessRun 'ffprobe' Process exited with code 0 - Succeeded
2024-03-27 02:05:56.316 Error ProviderManager: Error in metadata saver
	*** Error Report ***
	Version: 4.8.3.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}_armhf.deb
	Operating system: Linux version 6.1.21-v7+ (dom@buildbot) (arm-linux-gnueabihf-gcc-8 (Ubuntu/Linaro 8.4.0-3ubuntu1) 8.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #1642
	Framework: .NET 6.0.25
	OS/Process: arm/arm
	Runtime: opt/emby-server/system/System.Private.CoreLib.dll
	Processor count: 4
	Data path: /var/lib/emby
	Application path: /opt/emby-server/system
	System.UnauthorizedAccessException: System.UnauthorizedAccessException: Access to the path '/mnt/homeserver/Movies/TOP_GUN/TOP_GUN.nfo' is denied.
	 ---> System.IO.IOException: Permission denied
	   --- End of inner exception stack trace ---
	   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, Boolean isAsync)
	   at NfoMetadata.Savers.BaseNfoSaver.SaveToFile(Stream stream, String path, LibraryOptions libraryOptions, CancellationToken cancellationToken)
	   at NfoMetadata.Savers.BaseNfoSaver.Save(BaseItem item, LibraryOptions libraryOptions, CancellationToken cancellationToken)
	   at Emby.Providers.Manager.ProviderManager.SaveMetadata(BaseItem item, LibraryOptions libraryOptions, ItemUpdateType updateType, IMetadataSaver[] savers, CancellationToken cancellationToken)
	Source: System.Private.CoreLib
	TargetSite: Void CheckIo(Error, System.String, Boolean, System.Func`2[Interop+ErrorInfo,Interop+ErrorInfo])
	InnerException: System.IO.IOException: Permission denied
	Source: 
	TargetSite: 
	
2024-03-27 02:05:56.323 Info MediaProbeManager: ProcessRun 'ffprobe' Execute: /opt/emby-server/bin/ffprobe -i file:"/mnt/homeserver/Movies/TOP_GUN_MAVERICK/TOP_GUN__MAVERICK.mp4" -threads 0 -v info -print_format json -show_streams -show_chapters -show_format -show_data
2024-03-27 02:05:57.802 Info MediaProbeManager: ProcessRun 'ffprobe' Process exited with code 0 - Succeeded
2024-03-27 02:06:00.659 Error ProviderManager: Error in metadata saver
	*** Error Report ***
	Version: 4.8.3.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}_armhf.deb
	Operating system: Linux version 6.1.21-v7+ (dom@buildbot) (arm-linux-gnueabihf-gcc-8 (Ubuntu/Linaro 8.4.0-3ubuntu1) 8.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #1642
	Framework: .NET 6.0.25
	OS/Process: arm/arm
	Runtime: opt/emby-server/system/System.Private.CoreLib.dll
	Processor count: 4
	Data path: /var/lib/emby
	Application path: /opt/emby-server/system
	System.UnauthorizedAccessException: System.UnauthorizedAccessException: Access to the path '/mnt/homeserver/Movies/TOP_GUN_MAVERICK/TOP_GUN__MAVERICK.nfo' is denied.
	 ---> System.IO.IOException: Permission denied
	   --- End of inner exception stack trace ---
	   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, Boolean isAsync)
	   at NfoMetadata.Savers.BaseNfoSaver.SaveToFile(Stream stream, String path, LibraryOptions libraryOptions, CancellationToken cancellationToken)
	   at NfoMetadata.Savers.BaseNfoSaver.Save(BaseItem item, LibraryOptions libraryOptions, CancellationToken cancellationToken)
	   at Emby.Providers.Manager.ProviderManager.SaveMetadata(BaseItem item, LibraryOptions libraryOptions, ItemUpdateType updateType, IMetadataSaver[] savers, CancellationToken cancellationToken)
	Source: System.Private.CoreLib
	TargetSite: Void CheckIo(Error, System.String, Boolean, System.Func`2[Interop+ErrorInfo,Interop+ErrorInfo])
	InnerException: System.IO.IOException: Permission denied
	Source: 
	TargetSite: 

I thought it might be file level permissions so I updated the fstab to be this

//192.168.0.104/Shared\040Folders /mnt/homeserver cifs vers=3.0,gid=users,dir_mode=0775,file_mode=0775,auto,credentials=/home/ryan/.credfile 0 0

After a reboot the permissions look like this 

-rwxrwxr-x 1 ryan users 37786506317 Dec 26 04:15 TOP_GUN__MAVERICK.mp4
-rwxrwxr-x 1 ryan users           0 Mar 27 02:06 TOP_GUN__MAVERICK.nfo

But after refreshing the metadata the nfo file is deleted.

-rwxrwxr-x 1 ryan users 37786506317 Dec 26 04:15 TOP_GUN__MAVERICK.mp4

Here is the log

2024-03-27 02:31:13.811 Info App: Refresh metadata requested on 129710
2024-03-27 02:31:13.835 Info Server: http/1.1 Response 204 to host1. Time: 73ms. POST http://192.168.0.34:8096/emby/Items/129710/Refresh?Recursive=true&ImageRefreshMode=FullRefresh&MetadataRefreshMode=FullRefresh&ReplaceAllImages=false&ReplaceAllMetadata=true&X-Emby-Client=Emby Web&X-Emby-Device-Name=Chrome Windows&X-Emby-Device-Id=25991608-2881-4877-8dd7-a96780c3b131&X-Emby-Client-Version=4.8.3.0&X-Emby-Token=x_secret1_x&X-Emby-Language=en-us
2024-03-27 02:31:14.312 Info MediaProbeManager: ProcessRun 'ffprobe' Execute: /opt/emby-server/bin/ffprobe -i file:"/mnt/homeserver/Movies/TOP_GUN/TOP_GUN.mp4" -threads 0 -v info -print_format json -show_streams -show_chapters -show_format -show_data
2024-03-27 02:31:15.532 Info MediaProbeManager: ProcessRun 'ffprobe' Process exited with code 0 - Succeeded
2024-03-27 02:31:16.578 Info HttpClient: GET https://api.themoviedb.org/3/configuration?api_key=x_secret2_x
2024-03-27 02:31:16.723 Info TheMovieDb: MovieDb settings: {"images":{"base_url":"http://image.tmdb.org/t/p/","secure_base_url":"https://image.tmdb.org/t/p/","backdrop_sizes":["w300","w780","w1280","original"],"logo_sizes":["w45","w92","w154","w185","w300","w500","original"],"poster_sizes":["w92","w154","w185","w342","w500","w780","original"],"profile_sizes":["w45","w185","h632","original"],"still_sizes":["w92","w185","w300","original"]},"change_keys":["adult","air_date","also_known_as","alternative_titles","biography","birthday","budget","cast","certifications","character_names","created_by","crew","deathday","episode","episode_number","episode_run_time","freebase_id","freebase_mid","general","genres","guest_stars","homepage","images","imdb_id","languages","name","network","origin_country","original_name","original_title","overview","parts","place_of_birth","plot_keywords","production_code","production_companies","production_countries","releases","revenue","runtime","season","season_number","season_regular","spoken_languages","status","tagline","title","translations","tvdb_id","tvrage_id","type","video","videos"]}
2024-03-27 02:31:20.130 Error ProviderManager: Error in metadata saver
	*** Error Report ***
	Version: 4.8.3.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}_armhf.deb
	Operating system: Linux version 6.1.21-v7+ (dom@buildbot) (arm-linux-gnueabihf-gcc-8 (Ubuntu/Linaro 8.4.0-3ubuntu1) 8.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #1642
	Framework: .NET 6.0.25
	OS/Process: arm/arm
	Runtime: opt/emby-server/system/System.Private.CoreLib.dll
	Processor count: 4
	Data path: /var/lib/emby
	Application path: /opt/emby-server/system
	System.UnauthorizedAccessException: System.UnauthorizedAccessException: Access to the path '/mnt/homeserver/Movies/TOP_GUN/TOP_GUN.nfo' is denied.
	 ---> System.IO.IOException: Permission denied
	   --- End of inner exception stack trace ---
	   at System.IO.RandomAccess.WriteAtOffset(SafeFileHandle handle, ReadOnlySpan`1 buffer, Int64 fileOffset)
	   at Microsoft.Win32.SafeHandles.SafeFileHandle.ThreadPoolValueTaskSource.ExecuteInternal()
	--- End of stack trace from previous location ---
	   at Microsoft.Win32.SafeHandles.SafeFileHandle.ThreadPoolValueTaskSource.GetResult(Int16 token)
	   at Microsoft.Win32.SafeHandles.SafeFileHandle.ThreadPoolValueTaskSource.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
	   at System.Threading.Tasks.ValueTask.ValueTaskSourceAsTask.<>c.<.cctor>b__4_0(Object state)
	--- End of stack trace from previous location ---
	   at NfoMetadata.Savers.BaseNfoSaver.SaveToFile(Stream stream, String path, LibraryOptions libraryOptions, CancellationToken cancellationToken)
	   at NfoMetadata.Savers.BaseNfoSaver.Save(BaseItem item, LibraryOptions libraryOptions, CancellationToken cancellationToken)
	   at Emby.Providers.Manager.ProviderManager.SaveMetadata(BaseItem item, LibraryOptions libraryOptions, ItemUpdateType updateType, IMetadataSaver[] savers, CancellationToken cancellationToken)
	Source: System.Private.CoreLib
	TargetSite: Void WriteAtOffset(Microsoft.Win32.SafeHandles.SafeFileHandle, System.ReadOnlySpan`1[System.Byte], Int64)
	InnerException: System.IO.IOException: Permission denied
	Source: 
	TargetSite: 
	
2024-03-27 02:31:26.585 Info Server: http/1.1 POST http://192.168.0.34:8096/emby/Items/164319/Refresh?Recursive=true&ImageRefreshMode=FullRefresh&MetadataRefreshMode=FullRefresh&ReplaceAllImages=false&ReplaceAllMetadata=true&X-Emby-Client=Emby Web&X-Emby-Device-Name=Chrome Windows&X-Emby-Device-Id=25991608-2881-4877-8dd7-a96780c3b131&X-Emby-Client-Version=4.8.3.0&X-Emby-Token=x_secret1_x&X-Emby-Language=en-us. UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36
2024-03-27 02:31:26.589 Info App: Refresh metadata requested on 164319
2024-03-27 02:31:26.589 Info Server: http/1.1 Response 204 to host1. Time: 5ms. POST http://192.168.0.34:8096/emby/Items/164319/Refresh?Recursive=true&ImageRefreshMode=FullRefresh&MetadataRefreshMode=FullRefresh&ReplaceAllImages=false&ReplaceAllMetadata=true&X-Emby-Client=Emby Web&X-Emby-Device-Name=Chrome Windows&X-Emby-Device-Id=25991608-2881-4877-8dd7-a96780c3b131&X-Emby-Client-Version=4.8.3.0&X-Emby-Token=x_secret1_x&X-Emby-Language=en-us
2024-03-27 02:31:26.693 Info MediaProbeManager: ProcessRun 'ffprobe' Execute: /opt/emby-server/bin/ffprobe -i file:"/mnt/homeserver/Movies/TOP_GUN_MAVERICK/TOP_GUN__MAVERICK.mp4" -threads 0 -v info -print_format json -show_streams -show_chapters -show_format -show_data
2024-03-27 02:31:28.244 Info MediaProbeManager: ProcessRun 'ffprobe' Process exited with code 0 - Succeeded
2024-03-27 02:31:31.378 Error ProviderManager: Error in metadata saver
	*** Error Report ***
	Version: 4.8.3.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}_armhf.deb
	Operating system: Linux version 6.1.21-v7+ (dom@buildbot) (arm-linux-gnueabihf-gcc-8 (Ubuntu/Linaro 8.4.0-3ubuntu1) 8.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #1642
	Framework: .NET 6.0.25
	OS/Process: arm/arm
	Runtime: opt/emby-server/system/System.Private.CoreLib.dll
	Processor count: 4
	Data path: /var/lib/emby
	Application path: /opt/emby-server/system
	System.UnauthorizedAccessException: System.UnauthorizedAccessException: Access to the path '/mnt/homeserver/Movies/TOP_GUN_MAVERICK/TOP_GUN__MAVERICK.nfo' is denied.
	 ---> System.IO.IOException: Permission denied
	   --- End of inner exception stack trace ---
	   at System.IO.RandomAccess.WriteAtOffset(SafeFileHandle handle, ReadOnlySpan`1 buffer, Int64 fileOffset)
	   at Microsoft.Win32.SafeHandles.SafeFileHandle.ThreadPoolValueTaskSource.ExecuteInternal()
	--- End of stack trace from previous location ---
	   at Microsoft.Win32.SafeHandles.SafeFileHandle.ThreadPoolValueTaskSource.GetResult(Int16 token)
	   at Microsoft.Win32.SafeHandles.SafeFileHandle.ThreadPoolValueTaskSource.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
	   at System.Threading.Tasks.ValueTask.ValueTaskSourceAsTask.<>c.<.cctor>b__4_0(Object state)
	--- End of stack trace from previous location ---
	   at NfoMetadata.Savers.BaseNfoSaver.SaveToFile(Stream stream, String path, LibraryOptions libraryOptions, CancellationToken cancellationToken)
	   at NfoMetadata.Savers.BaseNfoSaver.Save(BaseItem item, LibraryOptions libraryOptions, CancellationToken cancellationToken)
	   at Emby.Providers.Manager.ProviderManager.SaveMetadata(BaseItem item, LibraryOptions libraryOptions, ItemUpdateType updateType, IMetadataSaver[] savers, CancellationToken cancellationToken)
	Source: System.Private.CoreLib
	TargetSite: Void WriteAtOffset(Microsoft.Win32.SafeHandles.SafeFileHandle, System.ReadOnlySpan`1[System.Byte], Int64)
	InnerException: System.IO.IOException: Permission denied
	Source: 
	TargetSite: 

Finally I tried making the emby user the owner of the directorys and files in the mount

//192.168.0.104/Shared\040Folders /mnt/homeserver cifs vers=3.0,uid=emby,gid=users,dir_mode=0775,file_mode=0775,auto,credentials=/home/ryan/.credfile 0 0

directory listing

drwxrwxr-x 2 emby users 0 Mar 27 02:31  TOP_GUN
drwxrwxr-x 2 emby users 0 Mar 27 02:31  TOP_GUN_MAVERICK

files

-rwxrwxr-x 1 emby users 37786506317 Dec 26 04:15 TOP_GUN__MAVERICK.mp4

after running a metadata refresh there is no NFO file and the following is in the logs

2024-03-27 02:46:44.655 Info App: Refresh metadata requested on 129710
2024-03-27 02:46:44.673 Info Server: http/1.1 Response 204 to host1. Time: 66ms. POST http://192.168.0.34:8096/emby/Items/129710/Refresh?Recursive=true&ImageRefreshMode=FullRefresh&MetadataRefreshMode=FullRefresh&ReplaceAllImages=false&ReplaceAllMetadata=true&X-Emby-Client=Emby Web&X-Emby-Device-Name=Chrome Windows&X-Emby-Device-Id=25991608-2881-4877-8dd7-a96780c3b131&X-Emby-Client-Version=4.8.3.0&X-Emby-Token=x_secret1_x&X-Emby-Language=en-us
2024-03-27 02:46:45.198 Info MediaProbeManager: ProcessRun 'ffprobe' Execute: /opt/emby-server/bin/ffprobe -i file:"/mnt/homeserver/Movies/TOP_GUN/TOP_GUN.mp4" -threads 0 -v info -print_format json -show_streams -show_chapters -show_format -show_data
2024-03-27 02:46:46.441 Info MediaProbeManager: ProcessRun 'ffprobe' Process exited with code 0 - Succeeded
2024-03-27 02:46:47.520 Info HttpClient: GET https://api.themoviedb.org/3/configuration?api_key=x_secret2_x
2024-03-27 02:46:47.658 Info TheMovieDb: MovieDb settings: {"images":{"base_url":"http://image.tmdb.org/t/p/","secure_base_url":"https://image.tmdb.org/t/p/","backdrop_sizes":["w300","w780","w1280","original"],"logo_sizes":["w45","w92","w154","w185","w300","w500","original"],"poster_sizes":["w92","w154","w185","w342","w500","w780","original"],"profile_sizes":["w45","w185","h632","original"],"still_sizes":["w92","w185","w300","original"]},"change_keys":["adult","air_date","also_known_as","alternative_titles","biography","birthday","budget","cast","certifications","character_names","created_by","crew","deathday","episode","episode_number","episode_run_time","freebase_id","freebase_mid","general","genres","guest_stars","homepage","images","imdb_id","languages","name","network","origin_country","original_name","original_title","overview","parts","place_of_birth","plot_keywords","production_code","production_companies","production_countries","releases","revenue","runtime","season","season_number","season_regular","spoken_languages","status","tagline","title","translations","tvdb_id","tvrage_id","type","video","videos"]}
2024-03-27 02:46:50.903 Error ProviderManager: Error in metadata saver
	*** Error Report ***
	Version: 4.8.3.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}_armhf.deb
	Operating system: Linux version 6.1.21-v7+ (dom@buildbot) (arm-linux-gnueabihf-gcc-8 (Ubuntu/Linaro 8.4.0-3ubuntu1) 8.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #1642
	Framework: .NET 6.0.25
	OS/Process: arm/arm
	Runtime: opt/emby-server/system/System.Private.CoreLib.dll
	Processor count: 4
	Data path: /var/lib/emby
	Application path: /opt/emby-server/system
	System.UnauthorizedAccessException: System.UnauthorizedAccessException: Access to the path '/mnt/homeserver/Movies/TOP_GUN/TOP_GUN.nfo' is denied.
	 ---> System.IO.IOException: Permission denied
	   --- End of inner exception stack trace ---
	   at System.IO.RandomAccess.WriteAtOffset(SafeFileHandle handle, ReadOnlySpan`1 buffer, Int64 fileOffset)
	   at Microsoft.Win32.SafeHandles.SafeFileHandle.ThreadPoolValueTaskSource.ExecuteInternal()
	--- End of stack trace from previous location ---
	   at Microsoft.Win32.SafeHandles.SafeFileHandle.ThreadPoolValueTaskSource.GetResult(Int16 token)
	   at Microsoft.Win32.SafeHandles.SafeFileHandle.ThreadPoolValueTaskSource.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
	   at System.Threading.Tasks.ValueTask.ValueTaskSourceAsTask.<>c.<.cctor>b__4_0(Object state)
	--- End of stack trace from previous location ---
	   at NfoMetadata.Savers.BaseNfoSaver.SaveToFile(Stream stream, String path, LibraryOptions libraryOptions, CancellationToken cancellationToken)
	   at NfoMetadata.Savers.BaseNfoSaver.Save(BaseItem item, LibraryOptions libraryOptions, CancellationToken cancellationToken)
	   at Emby.Providers.Manager.ProviderManager.SaveMetadata(BaseItem item, LibraryOptions libraryOptions, ItemUpdateType updateType, IMetadataSaver[] savers, CancellationToken cancellationToken)
	Source: System.Private.CoreLib
	TargetSite: Void WriteAtOffset(Microsoft.Win32.SafeHandles.SafeFileHandle, System.ReadOnlySpan`1[System.Byte], Int64)
	InnerException: System.IO.IOException: Permission denied
	Source: 
	TargetSite: 
	
2024-03-27 02:47:03.463 Info Server: http/1.1 POST http://192.168.0.34:8096/emby/Items/164319/Refresh?Recursive=true&ImageRefreshMode=FullRefresh&MetadataRefreshMode=FullRefresh&ReplaceAllImages=false&ReplaceAllMetadata=true&X-Emby-Client=Emby Web&X-Emby-Device-Name=Chrome Windows&X-Emby-Device-Id=25991608-2881-4877-8dd7-a96780c3b131&X-Emby-Client-Version=4.8.3.0&X-Emby-Token=x_secret1_x&X-Emby-Language=en-us. UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36
2024-03-27 02:47:03.471 Info App: Refresh metadata requested on 164319
2024-03-27 02:47:03.474 Info Server: http/1.1 Response 204 to host1. Time: 12ms. POST http://192.168.0.34:8096/emby/Items/164319/Refresh?Recursive=true&ImageRefreshMode=FullRefresh&MetadataRefreshMode=FullRefresh&ReplaceAllImages=false&ReplaceAllMetadata=true&X-Emby-Client=Emby Web&X-Emby-Device-Name=Chrome Windows&X-Emby-Device-Id=25991608-2881-4877-8dd7-a96780c3b131&X-Emby-Client-Version=4.8.3.0&X-Emby-Token=x_secret1_x&X-Emby-Language=en-us
2024-03-27 02:47:03.606 Info MediaProbeManager: ProcessRun 'ffprobe' Execute: /opt/emby-server/bin/ffprobe -i file:"/mnt/homeserver/Movies/TOP_GUN_MAVERICK/TOP_GUN__MAVERICK.mp4" -threads 0 -v info -print_format json -show_streams -show_chapters -show_format -show_data
2024-03-27 02:47:05.111 Info MediaProbeManager: ProcessRun 'ffprobe' Process exited with code 0 - Succeeded
2024-03-27 02:47:08.089 Error ProviderManager: Error in metadata saver
	*** Error Report ***
	Version: 4.8.3.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}_armhf.deb
	Operating system: Linux version 6.1.21-v7+ (dom@buildbot) (arm-linux-gnueabihf-gcc-8 (Ubuntu/Linaro 8.4.0-3ubuntu1) 8.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #1642
	Framework: .NET 6.0.25
	OS/Process: arm/arm
	Runtime: opt/emby-server/system/System.Private.CoreLib.dll
	Processor count: 4
	Data path: /var/lib/emby
	Application path: /opt/emby-server/system
	System.UnauthorizedAccessException: System.UnauthorizedAccessException: Access to the path '/mnt/homeserver/Movies/TOP_GUN_MAVERICK/TOP_GUN__MAVERICK.nfo' is denied.
	 ---> System.IO.IOException: Permission denied
	   --- End of inner exception stack trace ---
	   at System.IO.RandomAccess.WriteAtOffset(SafeFileHandle handle, ReadOnlySpan`1 buffer, Int64 fileOffset)
	   at Microsoft.Win32.SafeHandles.SafeFileHandle.ThreadPoolValueTaskSource.ExecuteInternal()
	--- End of stack trace from previous location ---
	   at Microsoft.Win32.SafeHandles.SafeFileHandle.ThreadPoolValueTaskSource.GetResult(Int16 token)
	   at Microsoft.Win32.SafeHandles.SafeFileHandle.ThreadPoolValueTaskSource.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
	   at System.Threading.Tasks.ValueTask.ValueTaskSourceAsTask.<>c.<.cctor>b__4_0(Object state)
	--- End of stack trace from previous location ---
	   at NfoMetadata.Savers.BaseNfoSaver.SaveToFile(Stream stream, String path, LibraryOptions libraryOptions, CancellationToken cancellationToken)
	   at NfoMetadata.Savers.BaseNfoSaver.Save(BaseItem item, LibraryOptions libraryOptions, CancellationToken cancellationToken)
	   at Emby.Providers.Manager.ProviderManager.SaveMetadata(BaseItem item, LibraryOptions libraryOptions, ItemUpdateType updateType, IMetadataSaver[] savers, CancellationToken cancellationToken)
	Source: System.Private.CoreLib
	TargetSite: Void WriteAtOffset(Microsoft.Win32.SafeHandles.SafeFileHandle, System.ReadOnlySpan`1[System.Byte], Int64)
	InnerException: System.IO.IOException: Permission denied
	Source: 
	TargetSite: 

The log makes it seem like a permission issue, but even after making the emby user the owner of the mount I am still able to write files and edit those files via the command line. 

I am at a loss for what it might be. Any ideas?

Q-Droid
Posted

You could try a couple of things. Add the nobrl option to see if that's still a problem with CIFS and exclude the version to let it negotiate which one to use.

Posted
On 3/27/2024 at 5:22 AM, Q-Droid said:

You could try a couple of things. Add the nobrl option to see if that's still a problem with CIFS and exclude the version to let it negotiate which one to use.

Thanks, the nobrl option worked.

  • Thanks 1
  • 2 months later...
dean6965
Posted

a free app to manage permissions instead of using the multipule comand solutions that dont work for everybody not terminal savy, the App is Eiciel and is so simple to use just click and add emby user to my media folder,

https://rofi.roger-ferrer.org/eiciel/

 

  • 2 months later...
abescalamis
Posted
sudo mount -t cifs -o credentials=/var/credentials,uid=emby,gid=emby  //192.168.1.2/path/to/my/folder /mnt 

Hello

I have a simple question, wanted to know what would be the correct way to mount.

currently I mounted the same share twice, one with permission for Emby and another with permission for pc user.

is that the correct way? 
 

can I have only one mount point with permission for both.

 

Posted
10 hours ago, abescalamis said:

is that the correct way? 
 

can I have only one mount point with permission for both.

What do you mean with permission for both? Do you mean both emby and the pc user(s) have full access and control of the files on the mounted filesystem?

It gets more complicated if you want fewer restrictions for access and at the same time maintain some control and security. If the share you're mounting is not a POSIX filesystem (like NTFS or FAT) you lose features. Aligning access is key. Things like common groups (gid), permission masks, setgid, etc. can help you get there.

But, if you're the only person using this storage/share and restricting access is not that important you could try a couple of things:

- Keep your current mount command and add the 'noperm' option.

- Or mount with uid=0, gid=0 (or without uid,gid) and add the 'noperm' option.

Either might work for you though I haven't used it so don't know how new file/directory ownership looks doing it one way or the other. Ideally this entry should be in the /etc/fstab so you don't have to mount it manually after every reboot or logout.

https://www.samba.org/~ab/output/htmldocs/manpages-3/mount.cifs.8.html

 

 

  • Like 1
abescalamis
Posted
8 hours ago, Q-Droid said:

What do you mean with permission for both? Do you mean both emby and the pc user(s) have full access and control of the files on the mounted filesystem?

It gets more complicated if you want fewer restrictions for access and at the same time maintain some control and security. If the share you're mounting is not a POSIX filesystem (like NTFS or FAT) you lose features. Aligning access is key. Things like common groups (gid), permission masks, setgid, etc. can help you get there.

But, if you're the only person using this storage/share and restricting access is not that important you could try a couple of things:

- Keep your current mount command and add the 'noperm' option.

- Or mount with uid=0, gid=0 (or without uid,gid) and add the 'noperm' option.

Either might work for you though I haven't used it so don't know how new file/directory ownership looks doing it one way or the other. Ideally this entry should be in the /etc/fstab so you don't have to mount it manually after every reboot or logout.

https://www.samba.org/~ab/output/htmldocs/manpages-3/mount.cifs.8.html

 

 

I tried to say that mounted the same SMB share twice (NAS), one with permission for Emby (uid=emby,gid=emby) mount point /mnt/Emby, and the other one with permission for the PC user (uid=pcuser,gid=pcuser) mount point /media/NAS

The mount point /mnt/Emby is used only for emby to use.

Based on your response, I did the correct way, unless security is not an issue and I'm the only user I can try your suggestion.

Thank you Q-droid you are awesome, I'm new to using ubuntu and getting to understand and learning how linux handles things.

I'm the only user, but seems based on your response it looks like it is better to leave it the way I have it.

 

 

 

 

  • Like 1
Posted

The way you have it now might seem a bit clunky though it's the easiest way to still restrict access to just those two users. The 'noperm' option as documented could open it up to anyone on the system.

There are different ways to make it work for a single mount but with more hoops to jump through. I don't use CIFS mounts so don't know all the tricks.

 

  • 3 weeks later...
Posted

I got some weird problem with emby server on ubuntu server 24.04

I run emby with portainer and traefic and everything work ok, only have problems with adding folders...

If i have 

    volumes:
      - /media/emby/config:/config
      - /media/emby/:/media/Movies:rw

it works...

But if i change to other directory, it wont load files...Permisions are 777..

    volumes:
      - /media/emby/config:/config
      - /emby/media/:/media/Movies:rw

 

 

version: "3.7"
services:

## Emby Media Server
  emby:
    container_name: emby
    image: emby/embyserver:latest
    restart: always
    networks:
      - traefik-network
    ports:
      - "8096:8096"
      - "8920:8920"
    volumes:
      - /media/emby/config:/config
      - /filmi/test/:/media/Movies:rw

    environment:
      - UID=0
      - GID=0
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.emby-frontend.rule=Host(`blabla.org`)"
      - "traefik.http.routers.emby-frontend.service=emby-frontend"
      - "traefik.http.routers.emby-frontend.entrypoints=websecure"
      - "traefik.http.services.emby-frontend.loadbalancer.server.port=8096"
      - "traefik.http.routers.emby-frontend.tls=true"
      - "traefik.http.routers.emby-frontend.tls.certresolver=letsencrypt"
      - "traefik.http.routers.emby-frontend.middlewares=compresstraefik"
      - "traefik.http.middlewares.compresstraefik.compress=true"
      - "traefik.docker.network=traefik-network"

networks:
  traefik-network:
    external:
      name: traefik-network

 

  • Thanks 1
Posted

AAA its snap issue!!!! I remove docker installed with snap and installed normal way and now its working..

  • Thanks 1
  • 4 weeks later...
Posted

In case it helps anyone, I had the same problem, Emby on my raspberry pi didn't appear in the "/media/USER" library scanner, and I solved it with the command:

sudo chmod -R o+rx /media

  • Like 1
  • Thanks 1
Posted

I have Emby server running on a windows server machine and up until recently all my media was stored locally and I had no issues.

I added a TrueNAS server on my network and created a user and share that I have mounted on the server running Emby.

It shows up just fine on my windows server machine and I was able to change one of my libraries to point to the new location:

brama_truenas_share.thumb.jpg.11d8e8ffa1261746ce487883719cde6e.jpg

Problem is that Emby does not appear to be able to write anything to the share.  So what user does Emby use when accessing a SMB share?

Right now I just have the 'peter' created on the TrueNAS box:

brama_truenas_share_2.thumb.jpg.47c2a9a6b1fa594858f3683d4b2bb4bd.jpg

I'm guessing emby is not trying to use the 'peter' user when attempting to write to the SMB share?

Posted (edited)

Actually, it doesn't look like its not able to read the contents either:

brama_truenas_share_3.thumb.jpg.1a0616be6e79a9d8008e5ba95f577e7a.jpg

Eventually I'll install Emby as a plug-in on my TrueNAS box, but I want to get it working like this first before making that change.

Thanks!

Edited by pclausen

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...