sftech13 25 Posted April 16, 2025 Posted April 16, 2025 I keep getting a permission issue on nfo files after media is added. I have checked my permissions for the directory, emby user and group and they are all correct. Any suggestions on how to fix this? I have the following commands sudo chown -R user:user /media/ sudo chmod -R 775 /media/ sudo chmod -R ug+rw /media/ sudo find /media/ -type d -exec chmod g+s {} \; Error Logs: 2025-04-15 16:52:33.134 Info MultiImageExtractor: ProcessRun 'extract-multi-image' Process exited with code 0 - Succeeded 2025-04-15 16:52:33.216 Error ProviderManager: Error in metadata saver *** Error Report *** Version: 4.8.11.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.4.0-211-generic (buildd@lcy02-amd64-075) (gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.2)) #231-Ubuntu SMP Tue Mar 11 17:06:58 UTC 2 Framework: .NET 6.0.36 OS/Process: x64/x64 Runtime: opt/emby-server/system/System.Private.CoreLib.dll Processor count: 8 Data path: /var/lib/emby Application path: /opt/emby-server/system System.UnauthorizedAccessException: System.UnauthorizedAccessException: Access to the path '/media/Movies/The Woman in the Yard (2025)/The Woman in the Yard (2025) {imdb-tt31314296} [WEBDL-2160p][DV HDR10Plus][EAC3 Atmos 5.1][h265]-XEBEC.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: 2025-04-15 10:13:28.826 Error ProviderManager: Error in metadata saver *** Error Report *** Version: 4.8.11.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.4.0-211-generic (buildd@lcy02-amd64-075) (gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.2)) #231-Ubuntu SMP Tue Mar 11 17:06:58 UTC 2 Framework: .NET 6.0.36 OS/Process: x64/x64 Runtime: opt/emby-server/system/System.Private.CoreLib.dll Processor count: 8 Data path: /var/lib/emby Application path: /opt/emby-server/system System.UnauthorizedAccessException: System.UnauthorizedAccessException: Access to the path '/media/Movies/Thor The Dark World (2013)/Thor The Dark World (2013) {imdb-tt1981115} [WEBDL-2160p][DV][TrueHD Atmos 7.1][HEVC]-FLUX.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:
Lessaj 467 Posted April 16, 2025 Posted April 16, 2025 Is user:user your user or is it emby:emby? If it's your user, is emby a member of your user group? Not really sure why you're running chmod 3 times, if you're setting it to 775 that is more than sufficient - really you should be setting directories to 775 and files to 664 if your intent is to have both a user and group able to manage them. I set my ownership to emby:emby and added my user to the emby group so I can delete files.
sftech13 25 Posted April 16, 2025 Author Posted April 16, 2025 12 hours ago, Lessaj said: Is user:user your user or is it emby:emby? If it's your user, is emby a member of your user group? Not really sure why you're running chmod 3 times, if you're setting it to 775 that is more than sufficient - really you should be setting directories to 775 and files to 664 if your intent is to have both a user and group able to manage them. I set my ownership to emby:emby and added my user to the emby group so I can delete files. Thanks for the response. user:user has user-emby as part of it. user:user has good permissions. I switched it emby as the owner not user and will see what happens. Thanks
tedfroop21 86 Posted April 16, 2025 Posted April 16, 2025 (edited) Create a shell file like: chown -R owner:group /drive/folder chmod 755 -R /drive/folder I had two copies, a manual one in my user folders and one owned by root in /mnt/subdiectory (all owned by root or this won't work). Then as sudo, edited the /etc/crontab file and added the line "00 7 * * * root /mnt/directory/chown.sh" so that at 7 am root ran the shell script and set the permissions on all my media the same so when the rsync script ran an hour later there were no errors or files with permissions set wrong backed up. The cool thing is you can set the script to run as often as you want from crontab, and run it multiple times a day if you want. Simple and automatic..... Edited April 16, 2025 by tedfroop21
sftech13 25 Posted April 16, 2025 Author Posted April 16, 2025 (edited) 8 minutes ago, tedfroop21 said: Create a shell file like: chown -R owner:group /drive/folder chmod 755 -R /drive/folder I had two copies, a manual one in my user folders and one owned by root in /mnt/subdiectory (all owned by root or this won't work). Then as sudo, edited the /etc/crontab file and added the line 00 7 * * * root /mnt/directory/chown.sh so that at 7 am root ran the shell script and set the permissions on all my media the same so when the rsync script ran an hour later there were no errors or files with permissions set wrong backed up. The cool thing is you can set the script to run as often as you want from crontab, and run it multiple times a day if you want. Simple and automatic..... I did this already and still see issues. I think its because emby wasn't the owner and the nfo is created by emby. I made the switch to have emby:user for /media and will see if this helps. here is my shell that I ran: #!/bin/bash # --- CONFIG --- MEDIA_DIR="/media" LOG_FILE="/var/log/media_permissions.log" TIMESTAMP=$(date +"%Y-%m-%d %H:%M:%S") # --- LOG HEADER --- echo -e "\n[${TIMESTAMP}] Starting permission check on $MEDIA_DIR" >> "$LOG_FILE" # --- Apply ownership and permissions --- echo "[INFO] Fixing ownership and permissions..." >> "$LOG_FILE" chown -R user:user "$MEDIA_DIR" chmod -R ug+rw "$MEDIA_DIR" find "$MEDIA_DIR" -type d -exec chmod g+s {} \; # --- Find files Emby can't write (common types: .nfo, clearlogo.png) --- echo "[INFO] Checking for non-writable metadata files (.nfo, clearlogo.png)..." >> "$LOG_FILE" find "$MEDIA_DIR" \( -iname "*.nfo" -o -iname "clearlogo.png" \) ! -perm -g=w -print >> "$LOG_FILE" # --- Summary Output --- FOUND=$(find "$MEDIA_DIR" \( -iname "*.nfo" -o -iname "clearlogo.png" \) ! -perm -g=w | wc -l) if [ "$FOUND" -gt 0 ]; then echo "[WARN] $FOUND metadata files without group write permission found." >> "$LOG_FILE" else echo "[OK] All .nfo and clearlogo.png files are group writable." >> "$LOG_FILE" fi Edited April 16, 2025 by sftech13 1
TMCsw 248 Posted April 16, 2025 Posted April 16, 2025 (edited) Emby creates directories/files based the user, group and umask that it is set to use: By default it will create them with the user ‘emby’ the group 'emby' using a umask of '0022' (umasks subtract from 0777 (dir's) 0666 (files)) So a new directory it creates will look ‘like’ this: drwxr-xr-x 2 emby emby 4.0K Apr 15 19:03 'Global National' and files like this: -rw-r--r-- 1 emby emby 4.4G Apr 15 19:01 'Global National 2025_04_15_18_30_00.ts' You can change all 3 of these (and more) with the following command: sudo systemctl edit emby-server.service READ the Instructions CARFULLY And add the following lines where it tells you to put them (with these or your own choices) It Is Case Sensitive! and the [Service] part is required. [Service] User=emby Group=user UMask=0002 Save/exit the file and restart emby from now on any NEW directories/files emby creates should look like this: drwxrwxr-x 2 emby user 4.0K Apr 15 19:03 'Global National' -rw-rw-r-- 1 emby user 4.4G Apr 15 19:01 'Global National 2025_04_15_18_30_00.ts' This will allow any one in the group user to delete files and will stick after upgrades/reboots... Edited April 16, 2025 by TMCsw added dir's/files 1
Grimmer 15 Posted April 16, 2025 Posted April 16, 2025 I once had permission issues after a restore (onto a larger HDD). All of the media folders and files had the correct permissions; however, the parent folder was owned by root (due to the restore). Once I fixed the parent folder's ownership and permissions, all was well. 1
tedfroop21 86 Posted April 17, 2025 Posted April 17, 2025 18 hours ago, sftech13 said: I did this already and still see issues. I think its because emby wasn't the owner and the nfo is created by emby. I made the switch to have emby:user for /media and will see if this helps. Is it possible the NFO is being written later than you think it is, or while it is locked for editing when the script runs?
Q-Droid 989 Posted April 17, 2025 Posted April 17, 2025 (edited) Your problem isn't Emby, it's "the thing that's adding media" when it creates files and directories with its ownership and permissions. And you haven't shared what type of filesystem your media is on. Is it a native *nix (POSIX) filesystem or other, like NTFS over SMB/CIFS? The post from @TMCsw shows how make Emby create files and dirs that others can access. You still need to make sure "others" are creating files and dirs that Emby can access. The Linux permissions thread has multiple ways of handling this but that thread is way too long by now for it to be helpful. If on a POSIX filesystem you have the option of using ACLs to permanently set the ownership and permissions needed for mult-user access to the media. If on SMB/CIFS then mount and SMB options can do the same. This is one of the ways: https://emby.media/support/articles/Linux-Unix-Permissions.html Edited April 17, 2025 by Q-Droid 1
sftech13 25 Posted April 18, 2025 Author Posted April 18, 2025 14 hours ago, tedfroop21 said: Is it possible the NFO is being written later than you think it is, or while it is locked for editing when the script runs? Yes I believe it's in lock when it happens. Still happened again but later the permissions were fine. I'm good with it.
sftech13 25 Posted April 18, 2025 Author Posted April 18, 2025 12 hours ago, Q-Droid said: Your problem isn't Emby, it's "the thing that's adding media" when it creates files and directories with its ownership and permissions. And you haven't shared what type of filesystem your media is on. Is it a native *nix (POSIX) filesystem or other, like NTFS over SMB/CIFS? The post from @TMCsw shows how make Emby create files and dirs that others can access. You still need to make sure "others" are creating files and dirs that Emby can access. The Linux permissions thread has multiple ways of handling this but that thread is way too long by now for it to be helpful. If on a POSIX filesystem you have the option of using ACLs to permanently set the ownership and permissions needed for mult-user access to the media. If on SMB/CIFS then mount and SMB options can do the same. This is one of the ways: https://emby.media/support/articles/Linux-Unix-Permissions.html I'm running Ubuntu with Swizzin. Only 1 user for the machine. Raid 5 for media SSD for root/home dir No ACLs for now all on ext4 I think it's a lock file issue since the NFO isn't part of the media being added but added by EMBY and only appears 1 time.
Q-Droid 989 Posted April 18, 2025 Posted April 18, 2025 Users also includes service accounts running applications, like emby for example. Are the new media directories created with the permissions Emby needs to create the nfo files? If not then it will have problems. What lock file? Emby creates/updates the nfo files and as you posted they're not included with the media.
sftech13 25 Posted April 18, 2025 Author Posted April 18, 2025 18 hours ago, Q-Droid said: Users also includes service accounts running applications, like emby for example. Are the new media directories created with the permissions Emby needs to create the nfo files? If not then it will have problems. What lock file? Emby creates/updates the nfo files and as you posted they're not included with the media. Yes, the directory permissions look correct and don’t appear to be the issue. What might be happening instead is a timing conflict the .nfo file is likely being created at the same time Emby is trying to scan the library. That overlap could cause a temporary file lock or access issue, which would throw a "permission denied" error even though the actual permissions are fine. sftech13@sftech13:~$ ls -l '/mnt/Media' drwxrwsr-x 3192 emby emby 192512 Apr 18 03:34 Movies drwxrwsr-x 136 emby emby 20480 Apr 12 11:13 'TV Shows' drwxrwsr-x 7 emby emby 4096 Apr 1 09:36 Animation drwxrwsr-x 2 emby emby 4096 Apr 1 08:34 CinemaSounds drwxrwsr-x 4 emby emby 4096 Apr 1 08:54 Documentary drwxrwsr-x 2 emby emby 4096 Apr 1 08:34 Kodi drwxrwsr-x 2 emby emby 4096 Apr 1 08:34 Recordings drwxrwsr-x 2 emby emby 4096 Apr 1 08:34 Replays drwxrwsr-x 2 emby emby 4096 Apr 1 08:38 repo drwxrwsr-x 2 emby emby 4096 Apr 1 08:34 Software drwxrwsr-x 252 emby emby 36864 Apr 18 05:04 StandUp
Lessaj 467 Posted April 18, 2025 Posted April 18, 2025 Linux doesn't lock files the way that Windows does, but if you backing data store was being provided from a Windows system then maybe, but you said it's local so no it doesn't really work that way. You could always double check permissions are set correctly on a directory by switching to the emby user as root with su -s /bin/bash emby and try to touch afile. 1
sftech13 25 Posted April 18, 2025 Author Posted April 18, 2025 29 minutes ago, Lessaj said: Linux doesn't lock files the way that Windows does, but if you backing data store was being provided from a Windows system then maybe, but you said it's local so no it doesn't really work that way. You could always double check permissions are set correctly on a directory by switching to the emby user as root with su -s /bin/bash emby and try to touch afile. Yes emby user can touch and make files.
sftech13 25 Posted April 18, 2025 Author Posted April 18, 2025 It happened again when media is added last night. Just snippets of the log. 2025-04-18 02:13:32.438 Error ProviderManager: Error in metadata saver *** Error Report *** Version: 4.8.11.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.4.0-214-generic (buildd@lcy02-amd64-062) (gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.2)) #234-Ubuntu SMP Fri Mar 14 23:50:27 UTC 2 Framework: .NET 6.0.36 OS/Process: x64/x64 Runtime: opt/emby-server/system/System.Private.CoreLib.dll Processor count: 8 Data path: /var/lib/emby Application path: /opt/emby-server/system System.UnauthorizedAccessException: System.UnauthorizedAccessException: Access to the path '/media/Movies/Raiders of the Lost Ark (1981)/Raiders of the Lost Ark (1981) {imdb-tt0082971} [PMTP][WEBDL-2160p][DV HDR10Plus][EAC3 Atmos 5.1][HEVC]-HONE.nfo' 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, 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 ThrowExceptionForIoErrno(ErrorInfo, System.String, Boolean, System.Func`2[Interop+ErrorInfo,Interop+ErrorInfo]) InnerException: System.IO.IOException: Permission denied Source: TargetSite: 2025-04-18 02:13:34.245 Info Server: http/1.1 GET http://host2:8096/emby/videos/16832941/hls1/main/144.ts?PlaySessionId=12550670dfec4e4bb722cb7d818ab61e. Source Ip: host16, Accept=*/*, Connection=keep-alive, Host=host4, User-Agent=Lavf/59.27.100, Range=bytes=0-, Icy-MetaData=1 2025-04-18 02:48:45.282 Error ProviderManager: Error in metadata saver *** Error Report *** Version: 4.8.11.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.4.0-214-generic (buildd@lcy02-amd64-062) (gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.2)) #234-Ubuntu SMP Fri Mar 14 23:50:27 UTC 2 Framework: .NET 6.0.36 OS/Process: x64/x64 Runtime: opt/emby-server/system/System.Private.CoreLib.dll Processor count: 8 Data path: /var/lib/emby Application path: /opt/emby-server/system System.UnauthorizedAccessException: System.UnauthorizedAccessException: Access to the path '/media/Movies/Indiana Jones and the Last Crusade (1989)/Indiana Jones and the Last Crusade (1989) {imdb-tt0097576} [PMTP][WEBDL-2160p][DV HDR10Plus][EAC3 Atmos 5.1][HEVC]-HONE.nfo' 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, 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 ThrowExceptionForIoErrno(ErrorInfo, System.String, Boolean, System.Func`2[Interop+ErrorInfo,Interop+ErrorInfo]) InnerException: System.IO.IOException: Permission denied Source: TargetSite: 2025-04-18 02:54:51.056 Error ProviderManager: Error in metadata saver *** Error Report *** Version: 4.8.11.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.4.0-214-generic (buildd@lcy02-amd64-062) (gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.2)) #234-Ubuntu SMP Fri Mar 14 23:50:27 UTC 2 Framework: .NET 6.0.36 OS/Process: x64/x64 Runtime: opt/emby-server/system/System.Private.CoreLib.dll Processor count: 8 Data path: /var/lib/emby Application path: /opt/emby-server/system System.UnauthorizedAccessException: System.UnauthorizedAccessException: Access to the path '/media/Movies/Reminiscence (2021)/Reminiscence (2021) {imdb-tt3272066} [Bluray-1080p][TrueHD Atmos 7.1][x265]-MrTentsaw.nfo' 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, 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 ThrowExceptionForIoErrno(ErrorInfo, System.String, Boolean, System.Func`2[Interop+ErrorInfo,Interop+ErrorInfo]) InnerException: System.IO.IOException: Permission denied Source: TargetSite: embyserver (1).txt
Luke 42077 Posted April 18, 2025 Posted April 18, 2025 11 minutes ago, sftech13 said: It happened again when media is added last night. Just snippets of the log. 2025-04-18 02:13:32.438 Error ProviderManager: Error in metadata saver *** Error Report *** Version: 4.8.11.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.4.0-214-generic (buildd@lcy02-amd64-062) (gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.2)) #234-Ubuntu SMP Fri Mar 14 23:50:27 UTC 2 Framework: .NET 6.0.36 OS/Process: x64/x64 Runtime: opt/emby-server/system/System.Private.CoreLib.dll Processor count: 8 Data path: /var/lib/emby Application path: /opt/emby-server/system System.UnauthorizedAccessException: System.UnauthorizedAccessException: Access to the path '/media/Movies/Raiders of the Lost Ark (1981)/Raiders of the Lost Ark (1981) {imdb-tt0082971} [PMTP][WEBDL-2160p][DV HDR10Plus][EAC3 Atmos 5.1][HEVC]-HONE.nfo' 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, 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 ThrowExceptionForIoErrno(ErrorInfo, System.String, Boolean, System.Func`2[Interop+ErrorInfo,Interop+ErrorInfo]) InnerException: System.IO.IOException: Permission denied Source: TargetSite: 2025-04-18 02:13:34.245 Info Server: http/1.1 GET http://host2:8096/emby/videos/16832941/hls1/main/144.ts?PlaySessionId=12550670dfec4e4bb722cb7d818ab61e. Source Ip: host16, Accept=*/*, Connection=keep-alive, Host=host4, User-Agent=Lavf/59.27.100, Range=bytes=0-, Icy-MetaData=1 2025-04-18 02:48:45.282 Error ProviderManager: Error in metadata saver *** Error Report *** Version: 4.8.11.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.4.0-214-generic (buildd@lcy02-amd64-062) (gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.2)) #234-Ubuntu SMP Fri Mar 14 23:50:27 UTC 2 Framework: .NET 6.0.36 OS/Process: x64/x64 Runtime: opt/emby-server/system/System.Private.CoreLib.dll Processor count: 8 Data path: /var/lib/emby Application path: /opt/emby-server/system System.UnauthorizedAccessException: System.UnauthorizedAccessException: Access to the path '/media/Movies/Indiana Jones and the Last Crusade (1989)/Indiana Jones and the Last Crusade (1989) {imdb-tt0097576} [PMTP][WEBDL-2160p][DV HDR10Plus][EAC3 Atmos 5.1][HEVC]-HONE.nfo' 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, 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 ThrowExceptionForIoErrno(ErrorInfo, System.String, Boolean, System.Func`2[Interop+ErrorInfo,Interop+ErrorInfo]) InnerException: System.IO.IOException: Permission denied Source: TargetSite: 2025-04-18 02:54:51.056 Error ProviderManager: Error in metadata saver *** Error Report *** Version: 4.8.11.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.4.0-214-generic (buildd@lcy02-amd64-062) (gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.2)) #234-Ubuntu SMP Fri Mar 14 23:50:27 UTC 2 Framework: .NET 6.0.36 OS/Process: x64/x64 Runtime: opt/emby-server/system/System.Private.CoreLib.dll Processor count: 8 Data path: /var/lib/emby Application path: /opt/emby-server/system System.UnauthorizedAccessException: System.UnauthorizedAccessException: Access to the path '/media/Movies/Reminiscence (2021)/Reminiscence (2021) {imdb-tt3272066} [Bluray-1080p][TrueHD Atmos 7.1][x265]-MrTentsaw.nfo' 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, 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 ThrowExceptionForIoErrno(ErrorInfo, System.String, Boolean, System.Func`2[Interop+ErrorInfo,Interop+ErrorInfo]) InnerException: System.IO.IOException: Permission denied Source: TargetSite: embyserver (1).txt 11.57 MB · 0 downloads Hi, looks like the server is being denied write access. Have you taken a look at this?
Lessaj 467 Posted April 18, 2025 Posted April 18, 2025 How are you adding the folders/files to your library folder? Directly creating it in the folder, and then adjusting the permissions, or creating it outside, setting the permissions, and then moving it? There is a crazy number of mentions in your log that /media/Movies will be refreshed along with a lot of other folders/files, which makes me think you're setting permissions over the entire folder every time which is completely unnecessary.
Q-Droid 989 Posted April 19, 2025 Posted April 19, 2025 2 hours ago, Lessaj said: Linux doesn't lock files the way that Windows does, but if you backing data store was being provided from a Windows system then maybe, but you said it's local so no it doesn't really work that way. You could always double check permissions are set correctly on a directory by switching to the emby user as root with su -s /bin/bash emby and try to touch afile. I was going to post the same. Linux is very different from Windows in this regard. @sftech13 What are the actual permissions for that path when the directories are created for media? Your listings are not going deep enough and only showing "base" directories . The permissions that matter are the ones for the directory created for the new media. Pick a newly added one before you make any alterations. $ namei -l <full path to mkv or mp4 file>
sftech13 25 Posted April 19, 2025 Author Posted April 19, 2025 19 hours ago, Q-Droid said: I was going to post the same. Linux is very different from Windows in this regard. @sftech13 What are the actual permissions for that path when the directories are created for media? Your listings are not going deep enough and only showing "base" directories . The permissions that matter are the ones for the directory created for the new media. Pick a newly added one before you make any alterations. $ namei -l <full path to mkv or mp4 file> Here you go. Error: 2025-04-19 00:02:58.964 Error ProviderManager: Error in metadata saver *** Error Report *** Version: 4.8.11.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.4.0-214-generic (buildd@lcy02-amd64-062) (gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.2)) #234-Ubuntu SMP Fri Mar 14 23:50:27 UTC 2 Framework: .NET 6.0.36 OS/Process: x64/x64 Runtime: opt/emby-server/system/System.Private.CoreLib.dll Processor count: 8 Data path: /var/lib/emby Application path: /opt/emby-server/system System.UnauthorizedAccessException: System.UnauthorizedAccessException: Access to the path '/media/Movies/Star Wars The Last Jedi (2017)/Star Wars The Last Jedi (2017) {imdb-tt2527336} [DSNP][WEBDL-2160p][DV][EAC3 Atmos 5.1][h265]-UPD.nfo' 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, 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 ThrowExceptionForIoErrno(ErrorInfo, System.String, Boolean, System.Func`2[Interop+ErrorInfo,Interop+ErrorInfo]) InnerException: System.IO.IOException: Permission denied Source: TargetSite: Permissions sftech13@sftech13:~$ namei -l "/media/Movies/Star Wars The Last Jedi (2017)/Star Wars The Last Jedi (2017) {imdb-tt2527336} [DSNP][WEBDL-2160p][DV][EAC3 Atmos 5.1][h265]-UPD.nfo" f: /media/Movies/Star Wars The Last Jedi (2017)/Star Wars The Last Jedi (2017) {imdb-tt2527336} [DSNP][WEBDL-2160p][DV][EAC3 Atmos 5.1][h265]-UPD.nfo drwxr-xr-x root root / drwxrwsr-x emby emby media lrwxrwxrwx emby emby Movies -> /mnt/Media/Movies drwxr-xr-x root root / drwxrwxr-x sftech13 sftech13 mnt drwxrwsr-x sftech13 emby Media drwxrwsr-x emby emby Movies drwxrwsr-x emby emby Star Wars The Last Jedi (2017) -rw-rw-r-- emby emby Star Wars The Last Jedi (2017) {imdb-tt2527336} [DSNP][WEBDL-2160p][DV][EAC3 Atmos 5.1][h265]-UPD.nfo sftech13@sftech13:~$ ls -ld "/media/Movies/Star Wars The Last Jedi (2017)" drwxrwsr-x 2 emby emby 4096 Apr 18 19:27 '/media/Movies/Star Wars The Last Jedi (2017)' sftech13@sftech13:~$ ls -l "/media/Movies/Star Wars The Last Jedi (2017)" total 19352228 -rw-rw-r-- 1 emby emby 303024 Apr 18 19:27 clearlogo.png -rwxrwxr-x 1 emby emby 766286 Dec 21 17:36 poster.jpg -rw-rw-r-- 1 emby emby 19815591849 Apr 18 15:46 'Star Wars The Last Jedi (2017) {imdb-tt2527336} [DSNP][WEBDL-2160p][DV][EAC3 Atmos 5.1][h265]-UPD.mkv' -rw-rw-r-- 1 emby emby 10336 Apr 18 19:27 'Star Wars The Last Jedi (2017) {imdb-tt2527336} [DSNP][WEBDL-2160p][DV][EAC3 Atmos 5.1][h265]-UPD.nfo' sftech13@sftech13:~$
Q-Droid 989 Posted April 19, 2025 Posted April 19, 2025 20 minutes ago, sftech13 said: lrwxrwxrwx emby emby Movies -> /mnt/Media/Movies Not that it should or that I would expect it but I wonder if Emby has problems with the symbolic link in the path.
sftech13 25 Posted April 19, 2025 Author Posted April 19, 2025 6 minutes ago, Q-Droid said: Not that it should or that I would expect it but I wonder if Emby has problems with the symbolic link in the path. You're correct, it shouldn't matter what I did notice is the owner of the drive That mnt directory is owned by sftech13:sftech13 So I changed that and will see what happens sudo chown root:emby /mnt sudo chmod 775 /mnt Sftech13 is part of EMBY and EMBY is part of sftech13 with the same level of access/permission
Q-Droid 989 Posted April 19, 2025 Posted April 19, 2025 (edited) That doesn't matter because all of the dirs leading to the media have global rx, meaning all users/procs can navigate that path. The ones under Movies are the important directories because that's where the new media is added and Emby needs full access to be able to index, create and delete files. Actually Movies itself is the first important one as the base so that Emby can delete the movie directories created under it. Edited April 19, 2025 by Q-Droid 1
sftech13 25 Posted April 19, 2025 Author Posted April 19, 2025 I'll take a look tonight as new media will be added and take a look tomorrow morning I want to thank everyone for their input and suggestions while we try and figure this out 1
Lessaj 467 Posted April 20, 2025 Posted April 20, 2025 I'm not really familiar with the "rws" that is showing up in your permissions and I think that's very strange. I've read a little bit about it and it doesn't seem necessary here, I'm wondering if it's the cause of your permission issues.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now