Jump to content

DSM 7 New permissions issues?


JamesTX10
Go to solution Solved by Carlo,

Recommended Posts

JamesTX10

I am trying to get to the bottom of this issue and think I am on the right track.

I use Emby on my NAS and am using the Server Configuration Backup plug-in to back up the config to a shared folder on my NAS. I then have a Rsync job running from a ReadyNas to back up some of the shared folders from my Syno. This has been working fine for years. Now that DSM 7.1 is out I figured it was time to make the jump from DSM 6. I am currently running DSM 7.1-42661 Update 2.

Now I get permissions errors for only this backup folder when trying to do the Rsync backup:
Failed to run rsync, return rc 23 rsync: send_files failed to open "Emby/ConfigBackup/Emby Backup - 2022-07-05 11.23.49 - Auto/ScheduledTasks/055748bc-3993-6036-040f-204aeacca405.js" (in Backup): Permission denied (13)

Emby is running as a System internal user and that shows as the owner of the files in File Station. I also see they greyed (meaning inherited) permissions as expected including my Rsync user. If I click the Apply to this folder, sub-folder, and files on the Emby backup folder in File Station I can then run the Rsync job without errors.

I found this thread that seems to be talking about the same type of issue: Another DSM package permissions issue. That links to Github Issue where they talk about it being an ACL issue in DSM 7.

Am I on the right path here? Is there a scheduled task I could run to re-apply the permissions to this folder after the Emby backup job and before the Rsync job?

Link to comment
Share on other sites

Hello @JamesTX10

Before trying to tackle the problem you described let me ask if Emby is currently running fine in general on your NAS?
I just want to very you're running DSM 7.x and the newly released Emby Server 4.7.x version from our site or 4.6.7 from the package store.

I'm asking because it kind of sounded like you didn't do the migration steps in the article Luke linked to which is needed to update your current system. The alternative is installing DSM 7.x and installing Emby without the migration starting clean as a new system.

If you're still running a server that pre-dates DSM 7 but didn't migrate it over then you could have other issues besides those mentioned. One of the steps of the migration is changing ownership and rights of files as well as granting the system internal emby user access to media, backup and dvr locations, etc...

What you describe in post one is a permission issue. I'd suggest not using File Manager as you can't easily match default permissions easily as folder and files are slightly different. I'd use either use Control Panel at the share level setting ownership and permissions or of course from a command line session using SSH.

Link to comment
Share on other sites

JamesTX10

I am currently running DSM 7.1-42661 Update 2 & Emby 4.7.5.0. I had first started with a clean install as I was not aware of needed migration steps. After seeing that my configuration was not applying I came here and then followed the guide to get my old configuration restored. Emby has been working fine.

Can you provide the SSH commands for checking the permissions?

Link to comment
Share on other sites

OK so at present Emby itself is working fine.
The issue is trying to Rsync the backed up data.

19 hours ago, JamesTX10 said:

Failed to run rsync, return rc 23 rsync: send_files failed to open "Emby/ConfigBackup/Emby Backup - 2022-07-05 11.23.49 - Auto/ScheduledTasks/055748bc-3993-6036-040f-204aeacca405.js" (in Backup): Permission denied (13)

Rsync error code 23 normally means an error occurred during a partial transfer.  So you should see some files transferred correctly and some not. If you could verify this that would be helpful.  If some files transfer and some not it's doubtful to be a permission problem on the receiving server. If no files are getting resynced then it could certainly be permissions on the receiving computer.

The error above happens to at least one file: "Emby/ConfigBackup/Emby Backup - 2022-07-05 11.23.49 - Auto/ScheduledTasks/055748bc-3993-6036-040f-204aeacca405.js" so the first thing I would do from SSH is look at the permissions of this file to others in the same directory to see if anything obvious is seen (ie different user/group owner or different permissions at the file level. Also don't forget to look at the parent folder permissions as well.

How are you granting permissions for rsync? Did you add it to a group that already has access or did you manually adjust ACLs for rsync? The group method is much cleaner and easier as well as work universally on the whole NAS.

Carlo

Link to comment
Share on other sites

JamesTX10

The shared folder is called Backup and I have the permissions set there. I then have a sub folder for where this data is stored:

image.png.83a15aafdbc0d50fd5d62dafcddd50bc.png

With these inherited permissions:

image.png.6e3cfe070c24027c904a763b1f1f00fb.png

 

Everything else copies with Rsync except for the the folders created under ConfigBackup by the Server Configuration Backup plug-in. It seems like when the plug-in creates the time stamped folder for that backup that the inherited permissions are not applied until I go back into File Station and select:

image.png.05423022d275c8402928f3d619ae796c.png

at the bottom of the permissions window on the ConfigBackup folder. I can then run the Rsync job again and it works. What is the SSH commands to check on the folder permissions manually? @FrostByte I can then run a new backup and see if they look different then the other folders.

Link to comment
Share on other sites

FrostByte

That's a picture of the shared folder permissions.  Have you checked the folder/file level permissions?

Also, just so you're aware that Emby user in your pic is not being used by Emby anymore and can be disabled.  The only account Emby server uses now is the system internal user Emby.

Link to comment
Share on other sites

JamesTX10

@FrostByte Can I get the SSH commands to check the permissions? From the GUI they all look the same as my screen shot above. I also do not have an emby user in the user section. Notice the different icon in the screen shot for the system internal user emby.

Link to comment
Share on other sites

FrostByte
  • enable ssh in Synology settings (Terminal & SSH menu)
  • connect with Putty or Terminal to Synology, login with admin user and
  • sudo -i to get root access
  • chown -R emby:emby /volume1/@appdata/EmbyServer
  • close putty/terminal

Just change the user and folder name in the fourth line to what you need.  I would also delete the old emby user first so we make sure we are working with the correct emby

Link to comment
Share on other sites

JamesTX10

@FrostByte I am already seeing those permissions:

/volume1/Backup/Emby/ConfigBackup# ls -l
total 0
drwx------+ 1 emby emby 296 Jul  4 00:10 'Emby Backup - 2022-07-04 00.10.0 - Auto'
drwx------+ 1 emby emby 296 Jul  5 00:10 'Emby Backup - 2022-07-05 00.9.59 - Auto'
drwx------+ 1 emby emby 296 Jul  5 11:23 'Emby Backup - 2022-07-05 11.23.49 - Auto'
drwx------+ 1 emby emby 296 Jul  6 00:10 'Emby Backup - 2022-07-06 00.10.0 - Auto'
drwx------+ 1 emby emby 296 Jul  7 00:10 'Emby Backup - 2022-07-07 00.10.0 - Auto'

When I look at the files in one of those folders that I have re-applied the inherited permissions to I see:

/volume1/Backup/Emby/ConfigBackup/Emby Backup - 2022-07-04 00.10.0 - Auto# ls -l
total 36
-rwx------+ 1 emby emby  195 Jun 25 10:28 branding.xml
drwx------+ 1 emby emby    0 Jul  4 00:10 dlna
-rwx------+ 1 emby emby  520 Jun 25 10:28 dlna.xml
-rwx------+ 1 emby emby  884 Jun 25 09:04 encoding.xml
drwx------+ 1 emby emby   52 Jul  4 00:10 library
-rwx------+ 1 emby emby  627 Jun 25 10:30 livetv.xml
-rwx------+ 1 emby emby  184 Jun 25 10:28 mb.lic
-rwx------+ 1 emby emby  243 Jun 19 12:49 metadata.xml
drwx------+ 1 emby emby    0 Jul  4 00:10 playlists
drwx------+ 1 emby emby  652 Jul  4 00:10 plugins
-rwx------+ 1 emby emby   12 Jul  4 00:10 profile.txt
drwx------+ 1 emby emby 2184 Jul  4 00:10 ScheduledTasks
-rwx------+ 1 emby emby 2153 Jun 25 08:32 subtitles.xml
-rwx------+ 1 emby emby 2904 Jun 25 10:30 system.xml
drwx------+ 1 emby emby   14 Jul  4 00:10 userdata
drwx------+ 1 emby emby   14 Jul  4 00:10 users

If I look at today's backup that I have not re-applied the permissions I see:

:/volume1/Backup/Emby/ConfigBackup/Emby Backup - 2022-07-07 00.10.0 - Auto# ls -l    total 36
-rw-r--r--  1 emby emby  195 Jun 25 10:28 branding.xml
drwx------+ 1 emby emby    0 Jul  7 00:10 dlna
-rw-r--r--  1 emby emby  520 Jun 25 10:28 dlna.xml
-rw-r--r--  1 emby emby  884 Jun 25 09:04 encoding.xml
drwx------+ 1 emby emby   52 Jul  7 00:10 library
-rw-r--r--  1 emby emby  627 Jun 25 10:30 livetv.xml
-rw-r--r--  1 emby emby  184 Jun 25 10:28 mb.lic
-rw-r--r--  1 emby emby  243 Jun 19 12:49 metadata.xml
drwx------+ 1 emby emby    0 Jul  7 00:10 playlists
drwx------+ 1 emby emby  652 Jul  7 00:10 plugins
-rwx------+ 1 emby emby   12 Jul  7 00:10 profile.txt
drwx------+ 1 emby emby 2184 Jul  7 00:10 ScheduledTasks
-rw-r--r--  1 emby emby 2153 Jun 25 08:32 subtitles.xml
-rw-r--r--  1 emby emby 2904 Jun 25 10:30 system.xml
drwx------+ 1 emby emby   14 Jul  7 00:10 userdata
drwx------+ 1 emby emby   14 Jul  7 00:10 users

My Rsync account can access the 07-04 folder but not the 07-07 folder.

Link to comment
Share on other sites

FrostByte
5 hours ago, JamesTX10 said:

@FrostByte Any other ideas?

What account are you using with your rsync job?  That's the account that I think needs permissions. 

The permissions you're showing in the picture are for the system internal user 'emby' under DSM 7.  If you're using the old Emby user from DSM 6 in your rsync job that's not the same account.  That's why I mentioned deleting the old account to eliminate any confusion.

Link to comment
Share on other sites

FrostByte

So, this is only a guess.  You're using Emby with your rsync job.  It has access to the old backup folders from when you were under DSM 6.  Then you upgraded and now Emby is using the system internal user emby and now your old Emby account can't access the new folders because they are actually two different accounts.

Link to comment
Share on other sites

JamesTX10
2 hours ago, Luke said:

Did you make sure the permissions are set recursively?

This is where I think the issue is. The entire share and the folder where the server config backups are stored have the permissions set recursively. However, when the plugin creates a new folder for that backup the recursive permissions are not set on that folder. This can be seen in the SSH screen shots above.

After a new server backup task I can go into File Station, right click the new folder, select properties, go to the permissions tab, check the box for apply to this folder, sub-folders and files, hit save and then my Rsync job can run fine. So I need a script/task that can do that after the new backup and before the rsync job or I need to know what else to change to allow those permissions to automatically propagate.

 

1 hour ago, FrostByte said:

What account are you using with your rsync job?  That's the account that I think needs permissions. 

The permissions you're showing in the picture are for the system internal user 'emby' under DSM 7.  If you're using the old Emby user from DSM 6 in your rsync job that's not the same account.  That's why I mentioned deleting the old account to eliminate any confusion.

I am using another user named "rsync". The old Emby user has been deleted.

 

1 hour ago, FrostByte said:

So, this is only a guess.  You're using Emby with your rsync job.  It has access to the old backup folders from when you were under DSM 6.  Then you upgraded and now Emby is using the system internal user emby and now your old Emby account can't access the new folders because they are actually two different accounts.

When the new system internal user, emby, creates a new folder for the backup it is not getting the permissions applied to that new folder recursively.

  • Like 1
Link to comment
Share on other sites

FrostByte

Your Backup shared folder has permissions like mine below? 

 image.jpeg.a5aae3b9fedcae268c7111aaf733d2da.jpeg

Would you be interested in having @cayars logon to your NAS and taking a look?  He's very knowledgeable on Synology.  I can't think of why emby isn't creating new folders with the correct permissions if it's setup like mine.

Link to comment
Share on other sites

On 7/7/2022 at 3:11 PM, JamesTX10 said:

@FrostByte I am already seeing those permissions:

/volume1/Backup/Emby/ConfigBackup# ls -l
total 0
drwx------+ 1 emby emby 296 Jul  4 00:10 'Emby Backup - 2022-07-04 00.10.0 - Auto'
drwx------+ 1 emby emby 296 Jul  5 00:10 'Emby Backup - 2022-07-05 00.9.59 - Auto'
drwx------+ 1 emby emby 296 Jul  5 11:23 'Emby Backup - 2022-07-05 11.23.49 - Auto'
drwx------+ 1 emby emby 296 Jul  6 00:10 'Emby Backup - 2022-07-06 00.10.0 - Auto'
drwx------+ 1 emby emby 296 Jul  7 00:10 'Emby Backup - 2022-07-07 00.10.0 - Auto'

When I look at the files in one of those folders that I have re-applied the inherited permissions to I see:

/volume1/Backup/Emby/ConfigBackup/Emby Backup - 2022-07-04 00.10.0 - Auto# ls -l
total 36
-rwx------+ 1 emby emby  195 Jun 25 10:28 branding.xml
drwx------+ 1 emby emby    0 Jul  4 00:10 dlna
-rwx------+ 1 emby emby  520 Jun 25 10:28 dlna.xml
-rwx------+ 1 emby emby  884 Jun 25 09:04 encoding.xml
drwx------+ 1 emby emby   52 Jul  4 00:10 library
-rwx------+ 1 emby emby  627 Jun 25 10:30 livetv.xml
-rwx------+ 1 emby emby  184 Jun 25 10:28 mb.lic
-rwx------+ 1 emby emby  243 Jun 19 12:49 metadata.xml
drwx------+ 1 emby emby    0 Jul  4 00:10 playlists
drwx------+ 1 emby emby  652 Jul  4 00:10 plugins
-rwx------+ 1 emby emby   12 Jul  4 00:10 profile.txt
drwx------+ 1 emby emby 2184 Jul  4 00:10 ScheduledTasks
-rwx------+ 1 emby emby 2153 Jun 25 08:32 subtitles.xml
-rwx------+ 1 emby emby 2904 Jun 25 10:30 system.xml
drwx------+ 1 emby emby   14 Jul  4 00:10 userdata
drwx------+ 1 emby emby   14 Jul  4 00:10 users

 

Looking at the permissions only the user has rwx permissions.  Nothing is there for group or other. So any other account won't have permissions to do anything with these files. That includes the account you're running rsync under.

If you compare these to the originals do they match or does your originals look more like this?

-rw-r--r-- 1 emby emby 1649 Oct 10  2021 autoorganize.xml
-rw-r--r-- 1 emby emby  195 Jul  2 09:55 branding.xml
-rwxrwxrwx 1 emby emby  203 Dec 16  2017 channels.xml
-rw-r--r-- 1 emby emby  892 Oct 11  2021 cinemamode.xml
drwxr-xr-x 1 emby emby    8 Oct 13  2021 dlna
-rw-r--r-- 1 emby emby  509 Oct 13  2021 dlna.xml
-rw-r--r-- 1 emby emby 3661 Jul  2 09:53 encoding.xml
-rw-r--r-- 1 emby emby 1955 Sep 18  2021 ffmpeg.xml
-rw-r--r-- 1 emby emby 3129 Jul 11 15:53 livetv.xml
-rw-r--r-- 1 emby emby   34 Nov 17  2021 mb.lic
-rw-r--r-- 1 emby emby  243 Jul  2 09:56 metadata.xml
-rw-r--r-- 1 emby emby 2873 Nov 27  2021 notifications.xml
-rw-r--r-- 1 emby emby  312 Jul 25  2021 opensubtitles.xml
-rw-r--r-- 1 emby emby 1563 Nov 20  2021 playback_reporting.xml
drwxr-xr-x 1 emby emby   80 Jul  1 10:45 ScheduledTasks
-rw-r--r-- 1 emby emby 2153 Jul  2 09:53 subtitles.xml
-rw-r--r-- 1 emby emby 4213 Jul 11 15:54 system.xml
-rw-r--r-- 1 emby emby 1125 Jul 29  2021 tonemapping.xml
drwxr-xr-x 1 emby emby  576 Jul  5 13:41 users
-rw-r--r-- 1 emby emby  323 Sep 23  2021 xbmcmetadata.xml

Check the source file permissions.  After doing a sudo -i to special privs for yourself try doing a copy command for a couple files to the location holding your backup. Did the permissions change again? If so it's a parent permission issue on the backup side that will need to be fixed.

If you can't figure it out or if the permissions on the original files in the appdata\EmbyServer directory have changed I can help you out remotely pretty quickly.

Carlo

Link to comment
Share on other sites

JamesTX10
22 hours ago, cayars said:

If you can't figure it out or if the permissions on the original files in the appdata\EmbyServer directory have changed I can help you out remotely pretty quickly.

Carlo

What do I need to do to setup a remote session with you?

Link to comment
Share on other sites

2 hours ago, JamesTX10 said:

What do I need to do to setup a remote session with you?

Hi, @cayarscan do that with you. Thanks.

Link to comment
Share on other sites

JamesTX10

@cayarslogged in and we ended up with a script to update permissions before my backup job runs. Cayars is going to check with Synology if they have any pointers on a better way with DSM7.

 

THANKS CAYARS!

  • Like 1
Link to comment
Share on other sites

  • Solution

Tried a few things that you think would work or had potential but didn't work such as adding rsync to a group that was given permission and made the group owner. Direct ACL permission. Tried creating an emby user since that's the default  group owner but synology says it's reserved. Can't add the user to the reserved group... etc

But I think the problem is what I mentioned right away that rsync is started on the other system. So permissions needs to be set for the machine/user but Synology doesn't support the standard linux command of getfacl and setfacl but instead use synoacltool that doesn't have the same options. :(

So we have something that definitely works and didn't need anything drastic or change to standard permissions in Emby directories.  But I'm going to run it by a couple people at Synology to see if permissions need to be set for machine/user (nas2/rsync) when we're on nas1 and if that is the problem how to set those permissions properly with synoacltool or other.

Should be a simple command and for something like this Id rather ask first then start changing permissions.

 

Link to comment
Share on other sites

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