-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Permission issue while updating Sonarr #3185
Comments
The problem here is more Sonarr/Radarr related because it doesn't clear out the On my virtual-DSM I also experienced this problem as my |
ah okay, that definitely makes it less of a priority, as you could just ask users to reboot their system as a fix for this problem. However, this problem is related to the new package version ofcourse, because of the user/group which come along. Are you guys detecting an upgrade from old-style to new-style package? If so, you might as well purge these 2 directories at that point (or fix the user/group) |
@ymartin59 what do you think? |
I have to look in detail. From my point of view, as installer script run as root, |
No no this is different, it's about Sonarr's internal update that creates a backup some random time before the update, not the SynoCommunity package's update. |
You already know that I prefer to control package content and so disable application autoupdate process... If application expects to read back its content, probably |
@Safihre May you please submit a PR with your fix proposal - either folder removal or owner change - so that I can publish Sonarr/Radarr again. |
I've had the same issue as @jelmerj after updating Sonarr from the Package Center in DSM. I went into Sonarr, it said it had an update, tried to install it, only to find that it failed because access was denied to that folder. I simply used chown to change the owner of the folder and files in the folder, and that worked. But now, I'm getting the following warnings in the log:
That was never an issue before.... but now it is, since the last package update from SynoCommunity. |
DS916+ running DSM 6.1.5-15254 Update 1 @Safihre If I go under System (in Sonarr), under Health, it says "No issues with your configuration" I think the trigger to my permissions problem was that the new Sonarr package uses a different user and group name for permissions? Am I correct? |
@SX86 You are right. Today there was a new version of Transmission SynoCommunity package that now also uses the same group as Sonarr/Radarr, so maybe check if you are getting that update yet? This should bring things back in sync. |
@Safihre I just installed the update to Transmission, and I got rid of one of the warnings, the one for mediainfo. I still have those 2:
From what I can see, new downloads are now using, for folders: It used to use, for folders: Since the update, I was expecting Transmission to now use/apply the group Also, it doesn't look like the umask 0 setting isn't being applied to newly downloaded files, but that's probably a seperate issue. |
@SX86 This is the way its supposed to be, because |
I think the issue is that the application do not set the permissions of files and folders they create. So you have to grant sc-download read/write privs to the folder /volume1/video/TV with FileStation (or chown on the commandline) before the application can write to folders or files there. |
@ymartin59 or @BenjV could you maybe explain to me again why we use for example |
@Safihre Synology DSM SDK "Lower privilege" support does it for "us". I let you read corresponding section: https://developer.synology.com/developer-guide/privilege/preface.html |
By the way I wonder if it is possible to change |
A process (and so also a script) does not have a group. And the start-stop-status script is run as root as defined in the privilege file. |
@BenjV In fact |
@BenjV About process GID, I mistaken with shell behavior when using |
start-stop-status script cannot be run as package user account because it uses kill -0 to view the status of a running pid. I think that all the ctrl-scripts are run as root unless you specify it as something else in the "privilege" file. |
@BenjV I confirm |
A kill -0 command needs root privilege otherwise you get an permission error. I tested it and all cntrl scripts (perinstall, postinstall etc.) are running default with root privileges. |
@BenjV I have here a small "working" package set with Here is
|
Your missing the point.
it will change. The defaults on top of the conf/privilege don't effect them, only if you specific give them other privs. And they should run as root, because they spawn the actual application with a run-as and to be able to do so they have to be root. Also in the preupgrade for example you should want to save some configuratie and or database files which you can restore in the postupgrade script. I can give lots of more examples, but believe me the scripts has to be root. The whole discussion about not be able to access file between different apps is just because most people don't have clue on how privs settings work and on top of that, Synology has created a little management layer on top of the linux privs system to confuse things. If I have some time left the coming days I shall write a small text about how it works on DSM. |
I do not object all "installer" scripts runs as root in As an example, "mosquitto" process runs with package user "sc-mosquitto":
Whereas script uses no "su" or "sudo": https://github.com/SynoCommunity/spksrc/blob/master/mk/spksrc.service.start-stop-status#L49 And I confirm again, there is no need for |
Hey guys, Updating the post. I've also got a permission issue on my Sonarr. uninstall / reinstall with backup restore I'm desperate for a solution ... Thx for any help |
What's the point in asking the same question on multiple places in this forum? |
Closing, see https://github.com/SynoCommunity/spksrc/wiki/Permission-Management |
For new Package Requests, see the guidelines
Setup
Package Name: Sonarr
Package Version: 201802280-12
NAS Model: DS214play
NAS Architecture:
DSM version: 6.1
Expected behavior
Sonarr advertised an update. I expected it to update without problems.
Actual behavior
The update failed with this error: Error occurred while executing task ApplicationUpdate: Access to the path "/tmp/nzbdrone_backup/config.xml" is denied.
Output of ls -la /tmp at the time:
drwxr-xr-x 2 100 users 100 Feb 27 19:58 nzbdrone_backup
drwxr-xr-x 3 sc-nzbdrone nzbdrone 80 Feb 28 21:00 nzbdrone_update
As you can see the user/group of nzbdrone_backup are incorrect. I decided to just remove the dir and have sonarr recreate it itself. That worked like a charm and the update was succesful afterwards.
I'm not sure if the package handles the permissions on this directory?
The same appears to be true for radarr:
drwxr-xr-x 2 radarr users 80 Feb 27 20:10 radarr_backup
drwxr-xr-x 5 radarr users 480 Feb 27 20:11 radarr_update
As you can the the dirs are owned by radarr/users instead of sc-radarr/radarr
The text was updated successfully, but these errors were encountered: