Sonarr version (exact version): 20150731-8
Mono version (if Sonarr is not running on Windows):
OS: 4.6.2.7-8
Description of issue: So I could not launch Synology and nothing tried worked, so I nuked it and mono. Before doing so, I made a backup of complete Sonarr directory, including the backup zips that were done weekly. After reinstalling Sonarr and mono, Sonarr launches, but now when I try to copy the 2 files from the backup zips to /usr/local/nzbdrone/var/.config/NzbDrone it crashes again and now gives this error. Do I need to do something else after copying the files?
System.Data.SQLite.SQLiteException (0x80004005): database disk image is malformed database disk image is malformed at System.Data.SQLite.SQLite3.Prepare (System.Data.SQLite.SQLiteConnection cnn, System.String strSql, System.Data.SQLite.SQLiteStatement previous, System.UInt32 timeoutMS, System.String& strRemain) [0x0033c] in <61a20cde294d4a3eb43b9d9f6284613b>:0 at System.Data.SQLite.SQLiteCommand.BuildNextCommand () [0x00068] in <61a20cde294d4a3eb43b9d9f6284613b>:0
16-12-19 16:45:11.4|Info|Bootstrap|Starting Sonarr - /volume1/@appstore/nzbdrone/share/NzbDrone/NzbDrone.exe - Version 2.0.0.3357 16-12-19 16:45:15.5|Debug|ProcessProvider|Found 0 processes with the name: NzbDrone.Console 16-12-19 16:45:15.9|Debug|ProcessProvider|Found 1 processes with the name: NzbDrone 16-12-19 16:45:15.9|Debug|ProcessProvider| - [20329] NzbDrone 16-12-19 16:45:17.4|Info|MigrationLogger|*** Migrating data source=/usr/local/nzbdrone/var/.config/NzbDrone/nzbdrone.db;cache size=-10485760;datetimekind=Utc;journal mode=Wal;pooling=True;version=3 *** 16-12-19 16:45:18.5|Fatal|ConsoleApp|EPIC FAIL!
It looks like the database is corrupt, you’d either need to try another backup of it or you may be able to repair the database (It’s a SQLite database and there are probably plenty of guides to do so, but a quick google search turns up:
http://wiki.team-mediaportal.com/1_MEDIAPORTAL_1/16_Support/Troubleshooting/Repair_SQLite_Database).
and
http://stackoverflow.com/a/18260642/882971
I tried numerous backups. Hard to believe they were all corrupt. Will try to repair the database and report back. Thank you.
Tried rebuilding and still same error. So just to make sure I have the steps correct. Uninstalled sonarr, uninstalled mono, reinstalled sonar, which installed mono, launch Sonarr once, stop it after starting, delete config.xml and nzbdrone.db from /usr/local/nzbdrone/var/.config/NzbDrone/, extract the 2 files from a backup, copy back over to /usr/local/nzbdrone/var/.config/NzbDrone/ and then start Sonarr? There isn’t anything I need to do to the files after copying them over? Or is there a place in Sonarr once launched I can restore them from?
No, nothing else to do in the UI (as long as that’s the correct data folder for it since it differs on different platforms).
Did you follow the steps on: https://github.com/Sonarr/Sonarr/wiki/Backup-and-Restore ?
There are a couple other files to delete that are tied to the database and could cause issues if they aren’t deleted.
So for craps n giggles, nuked only Sonarr, re-installed, launched once, let it load for about 5mins, then stopped it, copied over latest backup files, deleted the other files as stated and restarted. So far has been running for 5mins. Not sure why all of a sudden it wanted to work, but only difference was, I didnt reinstall mono with it this time. It still shows an update for Sonarr too, but will try that later. Fingers crossed it runs through the night.
Looking in logs, seeing a bunch of different errors similar to File /usr/local/nzbdrone/var/.config/NzbDrone/MediaCover/4/poster.jpg not found
Seeing this error about every minute now:
System.Data.SQLite.SQLiteException (0x80004005): attempt to write a readonly database
attempt to write a readonly database
at System.Data.SQLite.SQLite3.Reset (System.Data.SQLite.SQLiteStatement stmt) [0x00083] in <61a20cde294d4a3eb43b9d9f6284613b>:0
at System.Data.SQLite.SQLite3.Step (System.Data.SQLite.SQLiteStatement stmt) [0x0003c] in <61a20cde294d4a3eb43b9d9f6284613b>:0
at System.Data.SQLite.SQLiteDataReader.NextResult () [0x0016b] in <61a20cde294d4a3eb43b9d9f6284613b>:0
at System.Data.SQLite.SQLiteDataReader…ctor (System.Data.SQLite.SQLiteCommand cmd, System.Data.CommandBehavior behave) [0x00090] in <61a20cde294d4a3eb43b9d9f6284613b>:0
at (wrapper remoting-invoke-with-check) System.Data.SQLite.SQLiteDataReader:.ctor (System.Data.SQLite.SQLiteCommand,System.Data.CommandBehavior)
at System.Data.SQLite.SQLiteCommand.ExecuteReader (System.Data.CommandBehavior behavior) [0x0000c] in <61a20cde294d4a3eb43b9d9f6284613b>:0
at System.Data.SQLite.SQLiteCommand.ExecuteScalar (System.Data.CommandBehavior behavior) [0x00006] in <61a20cde294d4a3eb43b9d9f6284613b>:0
at System.Data.SQLite.SQLiteCommand.ExecuteScalar () [0x00006] in <61a20cde294d4a3eb43b9d9f6284613b>:0
at Marr.Data.QGen.InsertQueryBuilder1[T].Execute () [0x00046] in m:\BuildAgent\work\6c3239faf2b92630\src\Marr.Data\QGen\InsertQueryBuilder.cs:140 at Marr.Data.DataMapper.Insert[T] (T entity) [0x0004c] in m:\BuildAgent\work\6c3239faf2b92630\src\Marr.Data\DataMapper.cs:728 at NzbDrone.Core.Datastore.BasicRepository
1[TModel].Insert (TModel model) [0x00031] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Datastore\BasicRepository.cs:117
at NzbDrone.Core.Messaging.Commands.CommandQueueManager.Push[TCommand] (TCommand command, NzbDrone.Core.Messaging.Commands.CommandPriority priority, NzbDrone.Core.Messaging.Commands.CommandTrigger trigger) [0x00147] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Messaging\Commands\CommandQueueManager.cs:82
at (wrapper dynamic-method) System.Object:CallSite.Target (System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,NzbDrone.Core.Messaging.Commands.CommandQueueManager,object,NzbDrone.Core.Messaging.Commands.CommandPriority,NzbDrone.Core.Messaging.Commands.CommandTrigger)
at NzbDrone.Core.Messaging.Commands.CommandQueueManager.Push (System.String commandName, System.Nullable`1[T] lastExecutionTime, NzbDrone.Core.Messaging.Commands.CommandPriority priority, NzbDrone.Core.Messaging.Commands.CommandTrigger trigger) [0x000bb] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Messaging\Commands\CommandQueueManager.cs:95
at NzbDrone.Core.Jobs.Scheduler.ExecuteCommands () [0x00043] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Jobs\Scheduler.cs:43
at System.Threading.Tasks.Task.InnerInvoke () [0x00012] in /spksrc/native/mono/work-native/mono-4.6.2/mcs/class/referencesource/mscorlib/system/threading/Tasks/Task.cs:2879
at System.Threading.Tasks.Task.Execute () [0x00016] in /spksrc/native/mono/work-native/mono-4.6.2/mcs/class/referencesource/mscorlib/system/threading/Tasks/Task.cs:2502
Close
Does this mean its still not restored correctly?
Refresh all your series to re-download those image files.
Looks like either something wasn’t restored properly or the permissions on the file don’t give the user running write access.
What permissions need to be applied to the files and the folder? When I changed to nzbdrone:users, it seemed to create some folders, then crashed again. When changed back to root:root, it ran, but same errors. I only made the changes for the files, not folder as Im not sure what to do.
Here is original permissions:
admin@PIMPology:/usr/local/nzbdrone/var/.config/NzbDrone$ ls -l
total 7116
drwxr-xr-x 3 nzbdrone users 4096 Dec 19 16:20 Backups
-rw-r–r-- 1 root root 421 Dec 19 18:51 config.xml
drwxr-xr-x 2 nzbdrone users 4096 Dec 19 16:18 logs
-rw-r–r-- 1 nzbdrone users 540672 Dec 19 19:26 logs.db
-rw-r–r-- 1 nzbdrone users 32768 Dec 19 19:34 logs.db-shm
-rw-r–r-- 1 nzbdrone users 1052224 Dec 19 19:34 logs.db-wal
-rw-r–r-- 1 root root 5601280 Dec 19 18:51 nzbdrone.db
-rw-r–r-- 1 nzbdrone users 32768 Dec 19 19:29 nzbdrone.db-shm
-rw-r–r-- 1 nzbdrone users 0 Dec 19 18:51 nzbdrone.db-wal
-rw-r–r-- 1 nzbdrone users 5 Dec 19 18:51 nzbdrone.pid
When I changed them, it created the MediaCover folder, but crashed again. Here is permissions being shown after, but switching back to root:root for the two files. Again, did not change any folder permissions since not sure what to do.
admin@PIMPology:/usr/local/nzbdrone/var/.config/NzbDrone$ ls -l
total 10840
drwxr-xr-x 4 nzbdrone users 4096 Dec 19 19:40 Backups
-rw-r–r-- 1 nzbdrone users 421 Dec 19 19:43 config.xml
drwxr-xr-x 2 nzbdrone users 4096 Dec 19 16:18 logs
-rw-r–r-- 1 nzbdrone users 648192 Dec 19 19:43 logs.db
-rw-r–r-- 1 nzbdrone users 32768 Dec 19 19:44 logs.db-shm
-rw-r–r-- 1 nzbdrone users 768216 Dec 19 19:44 logs.db-wal
drwxr-xr-x 4 nzbdrone users 4096 Dec 19 19:40 MediaCover
-rw-r–r-- 1 nzbdrone users 4326400 Dec 19 19:43 nzbdrone.db
-rw-r–r-- 1 nzbdrone users 65536 Dec 19 19:43 nzbdrone.db-shm
-rw-r–r-- 1 nzbdrone users 5223264 Dec 19 19:44 nzbdrone.db-wal
-rw-r–r-- 1 nzbdrone users 5 Dec 19 19:43 nzbdrone.pid
The same permissions that Sonarr set’s by default (when installing the package), I don’t know what they are though.
OK, changed permissions as you said, and this is new error that causes it to crash now.
Version 2.0.0.3357
that’s a really old version, from before 2160p qualities were added so it’s not compatible with the database.
I never used that quality. I will try wiping it again, update, then import the database and backup files, change ownership and see what happens. To be continued.
Regardless of it being used it’s stored in the database (as part of every profile so the correct order is maintained).
Thank you. So it seems to be working now. Installed latest, ran once, copied backup files, chown’d them, restarted, now seems to be working. Thanks for everything.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.