Jump to content

Backup folder required ownership and permissions


Go to solution Solved by wookie_jmc,

Recommended Posts

Posted

I'm running an Emby server 4.9.1.90 on Linux Mint 22.2 and am using the Backup & Restore plugin. The backup fails to '/var/lib/emby/backup'. 

That folder has the same permissions and ownership as other Mint installs of previous versions of Emby, but the '/var/lib/emby' parent folder has different ones than those other install versions. I'm guessing that the emby parent folder permissions are the culprit. 'emby - Emby Server' is the current ownership, but previous installs were 'systemd-network - systemd Network Management'.

The server has no other issues for accessing data or files or operations. 

I have also tried different destinations for backup location on other discs trying different folder ownerships that all failed. I have also uninstalled and re-installed the backup plugin, then restarting emby server with no change in outcome.

What should the proper ownership be for both folders?

Thanks for any assistance!

Posted

Ideally the owner of the backup destination path is the same user that's running the Emby server. By default this is emby:emby. The user needs to be able to navigate the full path and create files and directories in the destination.

 

Posted
24 minutes ago, Q-Droid said:

Ideally the owner of the backup destination path is the same user that's running the Emby server. By default this is emby:emby. The user needs to be able to navigate the full path and create files and directories in the destination.

 

Yes, that is my understanding. That's where my confusion comes in. Given this is a fresh install on a fresh OS, the ownership should be default values. 

Do install sources change those defaults? This was installed from the .deb packages as opposed to a Flatpak install.

Posted

Are you saying the backups folder was originally created with the flatpak version?

Posted
Just now, Luke said:

Are you saying the backups folder was originally created with the flatpak version?

No. I was clarifying Emby came from the .deb package in case sources changed locations. 

I rsynced the contents of the backup folder from a previous install when I migrated to new hardware. The folder itself was created by the new install's backup plugin. I was able to import the backups with no issues and have been running it for a few weeks since. Even though R/W permission existed, I just recently noticed it was not creating backups.

Posted

The default user:group for a fresh install using package (.deb, .rpm, etc.) is emby:emby. But there's no guarantee that UID and GID will be the same between different systems when one is older or a different Linux distribution. If you're moving files between systems as an archive or zip you can end up with unexpected ownership. 

If you're running a default package based installation on Mint then /var/lib/emby and everything under it should have emby:emby ownership unless you've changed it. But then you would  know what you've changed and why.

        System.UnauthorizedAccessException: System.UnauthorizedAccessException: Access to the path '/media/sentey/Rocket-Pro/Emby.Backups' is denied.
         ---> System.IO.IOException: Permission denied

You need to make it so that the emby user can create files and directories in /media/sentey/Rocket-Pro/Emby.Backups. To do this the emby user needs to be able to navigate that path. It doesn't matter if emby owns 'Emby.Backups' if it can't access all of media, sentey and Rocket-Pro along the way. Emby doesn't have to own those and only needs r-x to cd to each.

 

  • Like 1
Posted
13 minutes ago, Q-Droid said:

The default user:group for a fresh install using package (.deb, .rpm, etc.) is emby:emby. But there's no guarantee that UID and GID will be the same between different systems when one is older or a different Linux distribution. If you're moving files between systems as an archive or zip you can end up with unexpected ownership. 

If you're running a default package based installation on Mint then /var/lib/emby and everything under it should have emby:emby ownership unless you've changed it. But then you would  know what you've changed and why.

        System.UnauthorizedAccessException: System.UnauthorizedAccessException: Access to the path '/media/sentey/Rocket-Pro/Emby.Backups' is denied.
         ---> System.IO.IOException: Permission denied

You need to make it so that the emby user can create files and directories in /media/sentey/Rocket-Pro/Emby.Backups. To do this the emby user needs to be able to navigate that path. It doesn't matter if emby owns 'Emby.Backups' if it can't access all of media, sentey and Rocket-Pro along the way. Emby doesn't have to own those and only needs r-x to cd to each.

 

Yes, that is also my understanding. No, I had not changed any ownership or permissions from Emby install defaults.

The external drive was a test with varying folder ownerships to a destination with a different path to rule out the problem you mentioned. However, neither of the ownerships I listed above worked for that folder, either. I also used full rwx permissions to simplify things for the test. This is why I am puzzled.  

Thanks for the assistance, btw. 

Posted

Perhaps try using a different folder?

Posted

Run these commands from a shell and post the output:

namei -l /media/sentey/Rocket-Pro/Emby.Backups

mount | grep media

 

  • Like 1
Posted
f: /media/sentey/Rocket-Pro/Emby.Backups
drwxr-xr-x root            root            /
drwxr-xr-x root            root            media
drwxr-x--- root            root            sentey
drwxrwxr-x root            systemd-network Rocket-Pro
drwxr-xr-x systemd-network systemd-network Emby.Backups
/dev/sdg1 on /media/sentey/Rocket-Pro type ext4 (rw,nosuid,nodev,relatime,errors=remount-ro,uhelper=udisks2)

The results of the first command, I had changed to emby: Emby-server initially, which didn't work. I then tried the settings as you see above, which also failed.

Where have I goofed up? LOL

Posted

Do this:

chmod o+rx /media/sentey

chown -R emby:emby /media/sentey/Rocket-Pro/Emby.Backups

You don't have to restart the Emby server but it would still be a good idea so that you get a fresh full log.

There were other strange errors in the log unrelated to the backups. Did you happen to install a beta release when troubleshooting?

 

  • Thanks 1
  • Solution
Posted

No, I had not used a beta version. 

I had to refresh my knowledge of permissions, so you made me find my access error.  I changed to 

f: /media/sentey/Rocket-Pro/Emby.Backups
drwxr-xr-x root root            /
drwxr-xr-x root root            media
drwxr-xr-x root root            sentey
drwxrwxr-x root systemd-network Rocket-Pro
drwxr-xr-x emby emby            Emby.Backups

The 'sentey' folder needed public changed to access files. So, as usual, user error. LOL

The one difference I see in selecting groups is the display is shown as emby:emby but in selecting groups it is emby:Emby-Server. So, that is a point of slight confusion I suspect is part of Mint. The previous Mint versions used the Emby process under the systemd umbrella as I had used this external drive with it, so that was why I was adding it as a group.

Q-Droid & Luke, thank you for helping me see the error of my ways (HA HA) and getting a working solution. You are very much appreciated!

  • Thanks 1
Posted

Thanks for following up !

  • Thanks 1

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