Epic Fail on Nov4 update

Sonarr version (exact version): Nov 4 Release
Mono version (if Sonarr is not running on Windows):
OS: Windows
((Debug logs)):
(Make sure debug logging is enabled in settings and post the full log to hastebin/pastebin/dropbox/google drive or something similar, do not post them directly here)
Description of issue:

17-11-5 20:34:01.6|Info|Bootstrap|Starting Sonarr - C:\ProgramData\NzbDrone\bin\NzbDrone.exe - Version 2.0.0.5054
17-11-5 20:34:03.6|Info|Router|Application mode: Interactive
17-11-5 20:34:04.4|Info|MigrationLogger|*** Migrating data source=C:\ProgramData\NzbDrone\nzbdrone.db;cache size=-10485760;datetimekind=Utc;journal mode=Wal;pooling=True;version=3 ***
17-11-5 20:34:04.7|Info|MigrationLogger|*** 118: add_history_eventType_index migrating ***
17-11-5 20:34:04.7|Info|add_history_eventType_index|Starting migration to 118
17-11-5 20:34:05.9|Error|MigrationLogger|System.Exception: database disk image is malformed
database disk image is malformed
While Processing:
“CREATE INDEX “IX_History_EventType” ON “History” (“EventType” ASC)” —> System.Data.SQLite.SQLiteException: database disk image is malformed
database disk image is malformed
at System.Data.SQLite.SQLite3.Reset(SQLiteStatement stmt)
at System.Data.SQLite.SQLite3.Step(SQLiteStatement stmt)
at System.Data.SQLite.SQLiteDataReader.NextResult()
at System.Data.SQLite.SQLiteDataReader…ctor(SQLiteCommand cmd, CommandBehavior behave)
at System.Data.SQLite.SQLiteCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.SQLite.SQLiteCommand.ExecuteNonQuery(CommandBehavior behavior)
at System.Data.SQLite.SQLiteCommand.ExecuteNonQuery()
at FluentMigrator.Runner.Processors.SQLite.SQLiteProcessor.ExecuteNonQuery(String sql) in C:\Users\Mark\Source\Repos\fluentmigrator\src\FluentMigrator.Runner\Processors\SQLite\SQLiteProcessor.cs:line 147
— End of inner exception stack trace —
at FluentMigrator.Runner.Processors.SQLite.SQLiteProcessor.ExecuteNonQuery(String sql) in C:\Users\Mark\Source\Repos\fluentmigrator\src\FluentMigrator.Runner\Processors\SQLite\SQLiteProcessor.cs:line 151
at FluentMigrator.Runner.Processors.SQLite.SQLiteProcessor.Process(String sql) in C:\Users\Mark\Source\Repos\fluentmigrator\src\FluentMigrator.Runner\Processors\SQLite\SQLiteProcessor.cs:line 135
at FluentMigrator.Runner.Processors.ProcessorBase.Process(CreateIndexExpression expression) in C:\Users\Mark\Source\Repos\fluentmigrator\src\FluentMigrator.Runner\Processors\ProcessorBase.cs:line 95
at FluentMigrator.Expressions.CreateIndexExpression.ExecuteWith(IMigrationProcessor processor) in C:\Users\Mark\Source\Repos\fluentmigrator\src\FluentMigrator\Expressions\CreateIndexExpression.cs:line 46
at FluentMigrator.Runner.MigrationRunner.<>c__DisplayClass72_0.b__1() in C:\Users\Mark\Source\Repos\fluentmigrator\src\FluentMigrator.Runner\MigrationRunner.cs:line 489
at FluentMigrator.Runner.StopWatch.Time(Action action) in C:\Users\Mark\Source\Repos\fluentmigrator\src\FluentMigrator.Runner\StopWatch.cs:line 57
at FluentMigrator.Runner.MigrationRunner.ExecuteExpressions(ICollection`1 expressions) in C:\Users\Mark\Source\Repos\fluentmigrator\src\FluentMigrator.Runner\MigrationRunner.cs:line 489

As shown above, fail to runs after updating; going back to previous version Sonarr works for 6hrs…then auto-update, which appears if we are using Windows are not able to disable.

1 Like

It looks like your database is corrupt, possibly in such a way that it works normally until the migration runs.

I’d like to take a look at what’s happening here. Could you PM me a link to a copy of your nzbdrone.db?

1 Like

I have exact the same problem. big fail after the update. does not matter which old data base I restore, always fails.

1 Like

PM to be done and thank you!

Sonarr v2.0.0.5054:
Windows10 v1709:

Yesterday, Sonarr was working as expected, today when I start it I get the below error. I searched the forums for the same issue and attempted to do as advised and restore from a backup. I’m getting the same error though on all my backups, dating back months. Reinstalling Sonarr and just starting it without restoring any backup works fine.

"Exception: database disk image is malformed
database disk image is malformed
While Processing: "Create INDEX “IX_History_EventType” ON “History (“EventType” ASC)”

Where can I get old versions of Sonarr for Windows?

1 Like

The issue here is a corrupt DB, it’s only going to repeat the error when it tries to update again. You should be able to repair the DB (that worked for hallmark’s DB).

You’ll need [sqlite3] (https://www.sqlite.org/download.html) (the windows 32-bit binary will work) and then follow the steps here:

Changing the command up a bit: sqlite3 nzbdrone.db ".dump" | sqlite3 new.db then delete/rename nzbdrone.db and finally rename new.db to nzbdrone.db.

1 Like

I get a new.db file, but its 0 bytes in size. I used…

sqlite3 nzbdrone.db “.dump” | sqlite3 new.db

1 Like

You need to be in C:\ProgramData\NzbDrone (or the data folder for Sonarr if different) or use a full path to the file:

sqlite3 C:\ProgramData\nzbdrone.db ".dump" | sqlite3 C:\ProgramData\new.db

1 Like

When I tired the same yesterday (and now) i also ended up with a 0byte file (tried multi times), cause me to create this post. :slight_smile:

yesterday used this post and today your simpler process, but ended with 0bytes.

i placed sqlite3.exe and nzbdrone.db in the same folder, and did the sql command at dos prompt (i’m old skool so i call it a dos prompt) in the folder.

Maybe it’s a windows sqlite3 issue, but works in linux?

I did it under Windows. If the file came out zero bytes I’d expect an error to be shown, you could run sqlite3 C:\ProgramData\nzbdrone.db ".dump" to just perform the dump and check for any errors.

1 Like

I actually placed nzbdrone.db in the same folder as sqlite3.exe and then ran it. Still got a zero byte file.

No errors were reported. I still haven’t managed to get it to work.

Any chance I can send my .db file to one of you to try and do it for me?

1 Like

PM me a link to download it (dropbox, google drive) etc and I’ll take a look.

3 Likes

I tried this fix on OS X and got a zero byte file. I tried it on Linux and it worked perfectly. Go figure!

2 Likes

Hi Markus, are you able to help me out too? Exact same problem, did the sqlite thing you mentioned, all I get is the 0kb new.db file.
(Also, is there something in the new update that does this? Tried uninstalling, reinstalling, putting in an old backup, no matter what, it all comes down to the same crash and the same db problem)

Hope you can help, I have been trying anything the past week :frowning:

Sonarr version (exact version): 2.0.0.5054 Nov 4 Release
Mono version (if Sonarr is not running on Windows): 4.6.2
OS: QNAP QTS 4.2.6 build 20170628

I do not have any issues except I needed to manually restart Sonarr in App Center

Sure, PM me a link to download the DB file and I’ll fix it up.

My untested theory is this is a problem with the version of sqlite being downloaded, i’m running an older version I’ve had for a while on my system, which just seems to work.

Apparently I’m running: SQLite version 3.8.5 2014-06-04 14:06:34

It runs a migration that adds an index, which is a problem if there are inconsistencies with the database. Adding the index touches all the old records and bumps into something unexpected and blows up unfortunately.

2 Likes

Hi, late response due to hospital issues, but thanks a lot! I have been looking for a way to send you a PM, but I do not have a clue how. I just do not see the option? Is that perhabs cause I am a new member? Can you send me a PM so I can reply? Hope you can (of explain to me how I can send you a pm…)
Sorry for being so clueless…

It was hidden given your time on the forums, should be there now when you click on my name.

2 Likes

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