After restart Sonarr is empty

Hey, I ran into a issue this morning. When I got up and tried to check sonarr it was not running. after a restart it is missing everything. Its almost like a fresh install. setting, history, activity, shows. all gone. any thoughts? Its still running in the correct directory and using the correct config dir.

Obvious trouble shooting steps - is the data still there in the directories? Is the DB still there?

What has changed? Did you do ANYTHING yesterday to the machine? Automagic updates?

Are file permissions ok?

This is just general stuff.

I forgot to hit reply this morning. I had some permission errors but nothing helped. Until I changed the upstart config to run as root.I am going to try changing it from the opt directory to inside the users home dir.

I would like to also suggest you guys consolidate the files to the users home directory. While the opt dir. can be used it default permissions only allow root access. so if theres an error writing to a file or folder those permissions reset. Alst, updating uses the system temp folder which again is only root accessable by default. If you consolidate everything to home/$USER/.sonarr/ it is less likely to cause permission issues

Any writing done is to the home directory already: /home/user/.config/nzbdrone

Updating via the built in updater after installing to /opt does require the permissions to be changed, but /opt is a perfectly acceptable location for installing when using apt-get, since its system installed it makes more sense than in a particular users home folder.

If you prefer it in another location you could remove the apt-get installed package and download the tar.gz and run it from there.

On what OS? Looking at Ubuntu 14.04 it is owned by root:root but has 0777 permissions on it, so anyone can read/write to it:

drwxrwxrwt   3 root root       4096 Nov 13 16:11 tmp

Sorry, this actually has to do with the opt dir being unwritable. Not the temp.

Having it in the home directory is more personal preference an alternative might be if sonarr could ask the user for the root password when updating or needing to modify core files.

Moved this from the torrents thread for obvious reasons.

To pitch in, it’s actually not that common to put binaries in the home dir. If anything, we should put the data in /var/opt/NzbDrone and the config in /etc/*, if you want to follow standards.
But that doesn’t change that permissions must be set correctly.

Is that something worth changing in v3 or when we are going through the rename?

The location where it is now in Windows is okay, I suppose.
For debian/ubuntu we should be making packages specific to the OS version, so we can include stuff like upstart, init or systemd startup scripts and setup the whole thing including user and group.
That’s something we should definitely look into before we create a ‘sonarr’ package in the repo.

Debian standards I found suggest /usr/local/share for third party applications where /opt is for optional system applications. I guess the idea being the /opt is for OS level add-ons. But it is never really used in Ubuntu. Looking at my system /usr/share seems to be the most used including, xbmc/kodi, python, and mono. Keeping the config in the users home dir just makes it easier for users although your settings stuff seems really stable so that might not be overly important. /etc is more system wide config. It would be okay on a server like mine but not so much for desktop Ubuntu to Linux in general.

I changed sonarr back to running as my regular user and is has done this again. It ran for about two days. I checked the upstart log and found this:

[Sonarr Log][1]
[1]: http://pastebin.com/ABWKHh4h

Im not sure at all whats causing this or why sonarr stopped in the first place. That includes one sucessfull start followed by the messed up startup.

Config is stored per user in the home directory, if you want to switch the user it runs under you will need to move the config and update the permissions.

In the second start it doesn’t see the database so it creates a new one, looks like the path is the same, so maybe permissions?

So, all the sabnzbd.db were read only -r-xr–r--. Only the config DB though. Everything else is 775 as it was. Might it make sense for sonarr to check the permissions and reset them as necessary. I can add it to my upstart too.