Sonarr version (exact version): 3.0.5.1144 Mono version (if Sonarr is not running on Windows): 6.12.0.122 OS: Ubuntu 20.04.2 LTS Description of issue:
After rebooting, all the permissions of the files inside /opt/Sonarr “reset”. This resulted in sonarr not starting up on boot. See the screenshot below.
Right after rebooting:
After doing sudo chmod 777 /opt/Sonarr/Sonarr.exe, and sudo systemctl restart sonarr.service it worked. So everytime my server (re)boots, I have to set the permissions for sonarr again.
Before chmod (after rebooting):
After chmod (after rebooting):
I discovered a tool called pathlld which shows the permissions of a file and everything (folders) before it. This is the output after rebooting but before chmod-ing:
This is the output after rebooting and chmod-ing:
So I chmod Sonarr.exe to make it executable and sonarr works fine. But after rebooting, Sonarr.exe returns to being un-executable (as seen in the output of pathlld before chmod-ing).
I’ve had this problem for quite a while now. Hopefully someone can help!
Nothing significant changed for the debian package for the better part of 2 years. In fact, a deb package update in december 2018 changed the v3 alpha path from /opt/sonarr to /usr/lib/sonarr. So yeah, you’re on an ancient package version.
Fix that, update first. Just follow the regular v3 install instructions on the site. It should upgrade properly (might wanna make a backup though).
I made a backup
I did sudo apt purge sonarr.
After that sudo apt autoremove
And then followed this.
But after that it’s still installed on /opt/Sonarr.
How do completly uninstall sonarr (like it has never been on my server) and after that how to correctly install it?
Sonarr v3 alpha was never installed in /opt/Sonarr only /opt/sonarr based on the code. So my guess is that was done manually somehow, definitely not our package.
You can confirm that with dpkg -S /opt/Sonarr/Sonarr.exe. It’ll show which package is owner of a particular file.
Check if sonarr is running properly in /usr/lib/sonarr, if so then you can probably manually remove the /opt/Sonarr stuff (if dpkg shows nothing owned it). It really depends on how it was installed.
You might have to manually check if the startup logic is correct too.
dpkg -S /opt/Sonarr/Sonarr.exe
returned dpkg-query: no path found matching pattern /opt/Sonarr/Sonarr.exe
I indeed have the /usr/lib/sonarr folder and I see everything in it.
I removed the complete /opt/Sonarr/ folder using sudo rm -R /opt/Sonarr.
Then I edited the .service file of sonarr and changed it to run /usr/lib/sonarr/bin/Sonarr.exe instead of /opt/Sonarr/Sonarr.exe. I reloaded the systemctl daemon and restarted sonarr.service.
After that (I didn’t even need to upload the backup) sonarr ran and showed (via the webinterface) that the startupdir is the new one so that’s good. It’s working now.
Okey, I’m currently at step 7 (Copy the config to /var/lib/sonarr). What config? Do you mean the backup of sonarr.service? Probably not but what do you mean with config and where can I find it?
cd-ing to root was not allowed but when using sudo it says cd; command not found. But doing sudo -s and then cd-ing did work. So I did (after doing sudo -s) cd /root/.config/Sonarr and it worked. But when I do ls, it looks exactly like /home/cas/.config/Sonarr. Is this correct? I don’t want to accidentally copy the wrong config.xml. P.S. thanks for helping me so quickly!
This is what it looks like after copying /root/.config/Sonarr/config.xml to /var/lib/sonarr:
The systemd unit and everything else looks fine. Nicely done.
One note, since sonarr is now running as sonarr:sonarr, you may have to check the permissions of your media library. And how your download client downloads files.
Personally I run sonarr as sonarr:mediahost… where mediahost is a group shared between the download client, sonarr and plex so all have read and write permissions.
You can also just add the sonarr user to the appropriate groups as secondary groups. There are some options there.
One last question (not really related but I don’t want to make a complete sepperate thread for it)
Now that Sonarr is officially on v3, how do I access the api? I always used http://localhost:8989/api as the root. Is it now http://localhost:8989/api/v3? Are there any benefits of adding the v3 at the end? Because I can still access the api without the v3 at the end…
For the most part the v2 api will remain intact insofar it’s possible. v3 api exposes some of the new features, like release profiles. But it also removed some nested resources that v2 had.
I want to do a more comprehensive api documentation for v3 (if I ever find the time).
If we decide to remove the v2 api when we go to sonarr v4 (or earlier) then we’ll certainly throw up a health check warning for months prior.