Jump to content

Permissions look right, but Emby says it can't write to directory


Go to solution Solved by JoeAverage,

Recommended Posts

JoeAverage
Posted (edited)

The permissions look right for the temp directory below, but when I tell Emby to use it as its server cache path it says, "Emby Server requires write access to this folder. Please ensure write access and try again."

drwxrwsr-x   2 emby media  4096 Jun 11 07:48 temp

The Emby service runs with user emby and group media, so I'm puzzled as to why Emby can't write to the temp directory.

emby-server.service:

[Unit]
Description=Emby brings together your videos, music, photos, and live television
.
After=network.target

[Service]
User=emby
Group=media
SupplementaryGroups=render
SupplementaryGroups=video
DynamicUser=true
StateDirectory=emby
ReadWritePaths=-/dev/dri

EnvironmentFile=/etc/conf.d/emby-server
ExecStart=/usr/bin/emby-server
RestartForceExitStatus=3

AmbientCapabilities=
CapabilityBoundingSet=
LockPersonality=true
ProtectControlGroups=true
ProtectKernelModules=true
ProtectKernelTunables=true

[Install]
WantedBy=multi-user.target



 

Edited by JoeAverage
JoeAverage
Posted

Solved:

The problem stemmed from the systemd emby-server.service process specifying a dynamic 'emby' user and the media_files directory being under /home, since dynamic users have read-only access to anything under /home.

The solution is to either switch to a regular (non-dynamic) user, or move the files to a directory that isn't read-only for dynamic users.

 

 

  • Solution
JoeAverage
Posted (edited)

Further to the solution, should anyone have the same issue:

I ended up moving away from the dynamic user to get rid of the read-only issue.

I shut down emby-server and used sudo systemctl edit emby-server.service to add the following in the space provided, which will override the default settings:

[Service]
DynamicUser=false

I then used the normal process for adding a user account named 'emby' that is in the 'media' group.

Next I made everything under my media directory chown emby:media and also chmod 775.

Finally I used sudo systemctl start emby-server.service to restart the service.

It came up, and was able to write to the media directory and everything under it (for .bif files and the like).

Edited by JoeAverage
  • Like 1
  • Thanks 1
Posted

Thanks for following up !

  • Like 1
  • 1 year later...
Posted

Anyone be able to help me that`d be great : I tried to install jellyfin in a docker container, but i didnt know they shared the same port number 

long story short it didnt work so i removed Jellyfin and tried to fire back up Emby, it kept trying to load Jellyfin, I foolishy decided to uninstall Emby and try and reinstall it after I found a link just saying to remove the cache files in the browser, anyway now I reinstalled Emby but when I try and add the folders back in i keep getting "There was an error adding the media path. Please ensure the path is valid and the Emby Server process has access to that location." someone suggested removing the @appdata/EmbyServer from the file system but when I tried to do that it says "I Dont have permission" Can someone help me please ?.

Posted
10 hours ago, Smeghain said:

Anyone be able to help me that`d be great : I tried to install jellyfin in a docker container, but i didnt know they shared the same port number 

long story short it didnt work so i removed Jellyfin and tried to fire back up Emby, it kept trying to load Jellyfin, I foolishy decided to uninstall Emby and try and reinstall it after I found a link just saying to remove the cache files in the browser, anyway now I reinstalled Emby but when I try and add the folders back in i keep getting "There was an error adding the media path. Please ensure the path is valid and the Emby Server process has access to that location." someone suggested removing the @appdata/EmbyServer from the file system but when I tried to do that it says "I Dont have permission" Can someone help me please ?.

Hi, can you reboot the nas and try again?

Posted
8 hours ago, Luke said:

Hi, can you reboot the nas and try again?

I tried to shut down and the in re-installed Emby but im still getting the error, When I load up Emby its still showing the catagories of Tv Shows Movies and so on (that ive added) but there is no content inside the catagories. There was an error adding the media path. Please ensure the path is valid and the Emby Server process has access to that location.

Posted

Dev's will need logs.

But this sounds like permissions issues.

Posted
1 hour ago, Smeghain said:

I tried to shut down and the in re-installed Emby but im still getting the error, When I load up Emby its still showing the catagories of Tv Shows Movies and so on (that ive added) but there is no content inside the catagories. There was an error adding the media path. Please ensure the path is valid and the Emby Server process has access to that location.

Im pretty sure the permissions are all ok (Im probably wrong though since the error) im starting to wonder if the only solution is to either delete @appdata/EmbyServer if theres another way around this i`d be really greatful if you could work it out for me.

 

 

 

image.png.123b5734ce2af4d71ed3dde6b7a8ccf9.png

Posted
15 hours ago, Luke said:

Hi, can you reboot the nas and try again?

Hey, Just an update on the situation, I removed emby server from the NAS, I then re-installed it and then updated it to the latest beta version and the issue I had seems to have been fixed. Not sure how or why....but I'll take it...just in case anyone else runs in to this issue. Thanks for the help and suggests folks.... :)

  • Like 1
  • Thanks 1
Posted

Hey Luke,

                 Just wondering...is there anyway of redoing a content type without removing it and putting it back in again under a new or different content type in the libraries ? im using emby Version 4.9.0.30 beta

Posted
On 9/29/2024 at 9:20 AM, Smeghain said:

Hey Luke,

                 Just wondering...is there anyway of redoing a content type without removing it and putting it back in again under a new or different content type in the libraries ? im using emby Version 4.9.0.30 beta

Hi, no, you will need to remove the library and then add it back again. Thanks.

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