Jump to content

Emby Recordings not working (permission denied)


Recommended Posts

Posted

I enabled recording and setup a library and path but for some reason having permissions issues.

I've attached a log included screenshots.  The error from the log is below.  Also attached a screenshot from inside the Emby container showing that i have permission to create a file and a directory in this path.  I even chmod 777 this directory just for testing with no luck.

image.png.557a37d10a0a919c1265ec2c8513ceec.png

2024-07-23 22:36:42.662 Error LiveTV: Error recording to /media/oplink/drive1/EmbyRecordings/Dr. Jeff Rocky Mountain Vet/Dr. Jeff Rocky Mountain Vet 2024_07_23_22_00_00.ts
    *** Error Report ***
    Version: 4.8.8.0
    Command line: /app/emby/system/EmbyServer.dll -programdata /config -ffdetect /app/emby/bin/ffdetect -ffmpeg /app/emby/bin/ffmpeg -ffprobe /app/emby/bin/ffprobe -restartexitcode 3
    Operating system: Linux version 5.15.0-113-generic (buildd@lcy02-amd64-072) (gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #123-Ubun
    Framework: .NET 6.0.25
    OS/Process: x64/x64
    Runtime: app/emby/system/System.Private.CoreLib.dll
    Processor count: 4
    Data path: /config
    Application path: /app/emby/system
    System.UnauthorizedAccessException: System.UnauthorizedAccessException: Access to the path '/media/oplink/drive1/EmbyRecordings/Dr. Jeff Rocky Mountain Vet' 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 Emby.Server.Implementations.IO.ManagedFileSystem.CreateDirectory(String path)
       at Emby.LiveTV.DirectRecorder.RecordUsingCopyTo(ILiveStream liveStream, Nullable`1 wallClockStartTime, String targetFile, Action onStarted, CancellationToken cancellationToken)
       at Emby.LiveTV.EmbyTV.RecordStream(TimerInfo timer, DateTimeOffset recordingEndDate, InternalActiveRecordingInfo activeRecordingInfo)
    Source: System.Private.CoreLib
    TargetSite: Void CreateDirectory(System.String)
    InnerException: System.IO.IOException: Permission denied
    Source:
    TargetSite:


   

embyserver(32).txt

Posted
5 hours ago, sa2000 said:

I am not a linux expert but is that user write permission not set just for root ?

See if this helps https://emby.media/support/articles/Linux-Unix-Permissions.html?q=linux

 

Thanks for your reply.  I'm pretty bad with linux stuff and docker throws in extra confusion for me.  On the host machine, the directory is not owned by root, it is owned by "media" which is the same user that the docker container uses.  The screenshot above is from within the docker container, I assume thats why it shows as root.  If I try to chown it, nothing happens.

This may be the root of the problem, but I'm not clear on how to fix it if I cant change the permissions or ownership within the container.

What user does Emby run as inside of the docker container?

Posted
18 hours ago, EmYaj said:

On the host machine, the directory is not owned by root, it is owned by "media" which is the same user that the docker container uses. 

See if this support page helps https://emby.media/support/articles/Linux.html

I don't know if it is different for docker

 

Posted

I found this post - may help?

 

Q-Droid
Posted
21 hours ago, EmYaj said:

Thanks for your reply.  I'm pretty bad with linux stuff and docker throws in extra confusion for me.  On the host machine, the directory is not owned by root, it is owned by "media" which is the same user that the docker container uses.  The screenshot above is from within the docker container, I assume thats why it shows as root.  If I try to chown it, nothing happens.

This may be the root of the problem, but I'm not clear on how to fix it if I cant change the permissions or ownership within the container.

What user does Emby run as inside of the docker container?

It shows as root because it is root. When you exec into a container shell your session will run as root unless you specify a different user:group.

The user running the application inside the container is the same as on the host. At least the UID:GID will be the same. It is possible to have the name look different in the container if there are /etc/passwd and /etc/group entries for the user. Either way it's the UID/GID that matter and dictate what ownership and permissions you need on the filesystem.

Make sure the user running the container app has access to all of the directories which make up /media/oplink/drive1/EmbyRecordings/ and write permissions on EmbyRecordings. Then make the permissions on any other media paths used by Emby match this one.

The path /media/oplink/drive1/EmbyRecordings/ seems pretty long. Is this the internal container side of the bind mapping?

 

 

  • Thanks 2
Posted

Thansk for the help all. After trying all of this with no luck I eventually stumbled in to the solution.  As always, this was a misunderstanding of Linux stuff on my part.

I had thought that authenticating my SMB mount with user "media" that I use for all of my media related apps and containers would mount it as user media but that was not the case, I also needed to specify the UID and GID for that user in fstab.

  • Thanks 2
Posted

For future reference in case anyone finds themselves in this thread looking for the solution, here is what my /etc/fstab entry looks like now that this is fixed:

//xx.xx.xx.xx/share /local/mountpoint/ cifs uid=1337,gid=1337,credentials=/root/.smbcredentials-file

  • Thanks 2

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