I’ve been using Sonarr for a few months on my 1815+ NAS and it has been working great until the other day when the package just stopped running and won’t start again.
I’ve uninstalled the package and re-installed it which works, but gives me a blank install, and I don’t really want to have to start my configuration all over again as I have a couple hundred shows and a lot of time/effort into it. I did take a copy of the nzbdrone folder before I uninstalled it, even though the backup/restore guide doesn’t say to do so. Anyway, I ran the commands in the guide
but it failed as that /tmp directory did not exist. So I copied the contents of that folder from the backup I made earlier, edited the start-stop script to run as Auto, Chown’d the nzbdrone folder and restarted Sonarr… Now Sonarr won’t run again…
There is only 1 file in the logs directory; here is the tail of it
Only thing changed in the script is to get it to run as user Auto instead of nzbdrone. Running as the default user is problematic due to permissions issues. Anyway, the working package was running as user Auto from day one so I’m pretty confident that’s not the issue.
I titled the thread as a corrupt database as when I tried the web ui shortly after the package stopped, I got an sql error, and copying the Db files back into a working package gives the same result.
I’m not sure bc I don’t know where to find any other log files. There is only 1 file (nzbdrone.txt) in the logs folder and I already shared the tail… I can upload the whole file somewhere I guess if that would help?
Where would I find the backup file to restore from if I needed to do that? I know I had taken several backups in the past so going back to the latest one would be better than where I am now. I wasn’t able to take one when the crash happened as I couldn’t get into the UI.
Tried some more troubleshooting… So with a clean install running, I took a manual backup. It seems all that does is zip up a copy of config.xml and nzbdrone.db. So from there, I stopped the package, deleted nzbdrone.db, copied in my old nzbdrone.db file, chown’d it to match the default nzbdrone user, and restarted the package. It seems that the db file was rejected as when I went into the UI, it was still just a blank database.
After that, I ran through the same procedure but with all the db files, nzbdrone.db and nzbdrone.db-* but it seems that the same thing happens.
I really just want to get back to a working copy of Sonarr… I put in a lot of time to get all of my shows listed etc. and don’t want to have to go through that all again.
The old DB file was 62KB, after copying it into the working folder and restarting Sonarr, it increased to 201KB.
I just tried deleting the nzbdrone.db file, the nzbdrone.db-shm & wal files, and all the logs.db files. I also deleted the nzbdrone.txt file in the logs folder to get a clean log file. I copied in only the old nzbdrone.db file, chown’d it to be owned by user nzbdrone and restarted Sonarr… This time it only increased to 71KB but I still have an empty database when I go into the Sonarr UI.
71KB would be an empty DB. I’d expect it in the megabytes if it had all the series loaded. It sounds like the file you have isn’t a backup of a full database, but of an empty one.
Well I appreciate you helping my try to troubleshoot this but it basically looks like I’m screwed…
Like I said, I just logged in one day to find Sonarr not running, and wouldn’t restart and now it looks like it wiped itself and my backups out whenever it crashed - which is pretty disconcerting. I guess this gives me a reason to go evaluate SickRage since I will have to manually rebuild the database either way.
Unfortunately Synology removes all the app data for a package when it is uninstalled, which looks like was one of the first things that was done to try to resolve it.
I’ve uninstalled the package and re-installed it which works
No, it seems like the whole thing was erroneously wiped, which explains why I couldn’t even find the location of the backups (both manual and automatic), that I knew I had taken in the past. I see now, on the clean install, that the Backups folder exists in the same location as the logs folder but there was no Backups folder in the copy I took before uninstalling.
Are there plans to implement a custom ‘backups’ location? I think that would have saved me, and it would also allow me to more easily write out a copy to another system or offsite the files.
It would also be good to allow for a custom schedule for taking backups. I know there is the option to take a manual backup, but I would rather be able to tell the system to just take an automatic backup every day, especially during the bulk of the setup. Weekly backups would be more appropriate once you are mostly finished with your setup.