Help with Backup and Restore on FreeBSD

Sonarr version (exact version): v2.0.0.5085
Mono version (if Sonarr is not running on Windows): 5.2.0.215
OS: FreeNAS 11
Description of issue:
I’ve been running Sonarr for a few years now, but only about 8 months on FreeNAS.

First I ran it using the included FreeNAS plugin, but ran into a lot of crashing. After that I installed it manually using mono. This guide is basically how I installed it into a jail and maintained it. https://www.reddit.com/r/radarr/comments/5qht69/guide_on_how_to_install_radarr_as_a_servicedaemon/

Today after updating the release my merging the new v2.0.0.5085 nzbdrone folder with my old v2.0.0.4949 nzbdrone folder I am unable to get the sonarr to respond. I’m actually pretty tired of using this manual method, so decided to create a new jail using the pkg install sonarr, which I didn’t know existed. https://github.com/Sonarr/Sonarr/wiki/Installation-FreeBSD

On this new jail I am trying to restore my old configuration db. On initial install Sonarr runs, but after restoring my DB using the following commands I run into trouble. These were taken from the synology guide.

rm -r sonarr_3/usr/local/sonarr/nzbdrone.db-*
cp -f sonarr_2/tmp/nzbdrone_backup/* sonarr_3/usr/local/sonarr/
cd sonarr_3/usr/local/sonarr
chown -R nzbdrone:users *
chmod -R 0644 *

sonarr_2 is the old config that has all my settings, sonarr_3 is the new jail that is up and running.

When I run chown I get the following error. “illegal group name”, I know sonarr is the user name that FreeBSD uses, so I changed the line to chown -R sonarr:users * and it runs. However sonarr webui is unavailable after restarting the jail after the restore.

Worst case scenario I can start over with my settings from scratch, but I’d really like to be able to utilize the backups that sonarr generates. Can anyone give me some tips and pointers on backups in FreeBSD/FreeNAS?

What do the logs show?
sonarr_2/tmp/nzbdrone_backup/* Make sure there isn’t an erroneous nzbdrone.db-wal in there, the only two files should be nzbdrone.db and config.xml, though I’ve seen extra DB files that shouldn’t be there in there.

I see these 3 actually:
config.xml
nzbdrone.db
nzbdrone.db-jourmal

nzbdrone.db-journal should be deleted.

I went ahead and removed nzbdrone.db-journal from my old jail’s backup before copying into the new jail. Same result, the webui is not available after starting the jail.

Which logs should I be looking for? The ones in \usr\local\sonarr\logs\sonarr.txt appear to only contain the nzbdrone.exe. It doesn’t have any entries after copying the files over and restarting the jail.

EDIT: Also will note that running service -e shows /usr/local/etc/rc.d/sonarr

Not sure what you mean by only containing nzbdrone.exe.
Enabling trace logging then starting Sonarr will give the most detail on whether Sonarr is starting properly, if nothing is being logged then Sonarr isn’t starting at all and possible an issue with the jail.

I just mean it has information about the nzbdrone and rsssync from before I copied the db and config over. I enabled trace logging in the config.xml, but there is nothing populating in the log file after doing copy of the config/db and restarting the jail.

Sonarr starts and operates fine in the jail, but is unavailable after performing the restore steps. I’m not sure what to troubleshoot, since everything works fine prior to the restore.

Well, I think I figured out the issue. Even thought the commands to copy everything need to run outside the jail, as it cannot access them. I had to run the permission changes from within the jail, so adding a jexec sonarr_3 prior to the permission changes solved. it.

rm -r sonarr_3/usr/local/sonarr/nzbdrone.db-*
cp -f sonarr_2/tmp/nzbdrone_backup/* sonarr_3/usr/local/sonarr/
jexec sonarr_3
cd usr/local/sonarr
chown -R sonarr:wheel *
chmod -R 0644 *

Thanks for all the help. Talking through it helped me try a few things to understand why the jail stopped working after restore.

1 Like

Well, now I am having issues getting Sonarr to run backups, manual or scheduled.

“Error occurred while executing task Backup: Access to the path “/usr/local/sonarr/Backups/manual” is denied.”

I went and tried doing chown on this directory for the Sonarr user that the FreeBSD install uses. Still the same result. ls -l shows read write access and sonarr as the sonarr:wheel as the owner.

ps aux also shows that sonarr user is the one running the service

Fixed: did chmod recursively on the whole backup dir.

The service running as sonarr user seems to be causing issues. Sonarr is unable to import media, as it cannot access the store that is mounted to the jail. It is in the group wheel, same as root, but still causing problems.

I went ahead and edited the rc.d sonarr file to change the user to root. Runs in a jail, so having root is fine. Chown’d the DB folder to root and restarted the service. This resolved the import issues.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.