Request Failed: SQL logic error or missing database near

Hi,

i have started getting these errors poping up

if it helps im running it from unRAID

Message
Request Failed: SQL logic error or missing database near “–10485760”: syntax error

Exception
System.Data.SQLite.SQLiteException: SQL logic error or missing database near “–10485760”: syntax error
at System.Data.SQLite.SQLite3.Prepare (System.Data.SQLite.SQLiteConnection cnn, System.String strSql, System.Data.SQLite.SQLiteStatement previous, UInt32 timeoutMS, System.String& strRemain) [0x00000] in :0 at System.Data.SQLite.SQLiteCommand.BuildNextCommand () [0x00000] in :0

Is my DB corrupted?
If so how can i fix it?

thnx.

Popping up where, in the UI? What are you doing when they appear?

I don’t think its a corrupt database, but if it is you should be able to do the same thing repeatedly to reproduce the error.

it was coming up in the logs, i have just turned on debugging and resarted the app
i dont do anything for it to happen

the below comes in lots of 2, but im also getting another one that no numbers in it

14-7-31 14:08:15.9|Fatal|NzbDroneErrorPipeline|Request Failed

System.Data.SQLite.SQLiteException: SQL logic error or missing database
near “–10485760”: syntax error

at System.Data.SQLite.SQLite3.Prepare (System.Data.SQLite.SQLiteConnection cnn, System.String strSql, System.Data.SQLite.SQLiteStatement previous, UInt32 timeoutMS, System.String& strRemain) [0x00000] in :0
at System.Data.SQLite.SQLiteCommand.BuildNextCommand () [0x00000] in :0

14-7-31 14:10:16.5|Fatal|NzbDroneErrorPipeline|Request Failed

System.Data.SQLite.SQLiteException: SQL logic error or missing database
near “=”: syntax error
at System.Data.SQLite.SQLite3.Prepare (System.Data.SQLite.SQLiteConnection cnn, System.String strSql, System.Data.SQLite.SQLiteStatement previous, UInt32 timeoutMS, System.String& strRemain) [0x00000] in :0
at System.Data.SQLite.SQLiteCommand.BuildNextCommand () [0x00000] in :0

it was also putting up a notification box in the GUI but saying

[GET] Internal Server Error:/api/queue

I also found another SQL error

14-7-31 14:09:36.8|Error|Scheduler|Error occurred while executing task NzbDrone.Core.Instrumentation.Commands.TrimLogCommand

System.Data.SQLite.SQLiteException: database disk image is malformed
database disk image is malformed
at System.Data.SQLite.SQLite3.Reset (System.Data.SQLite.SQLiteStatement stmt) [0x00000] in :0
at System.Data.SQLite.SQLite3.Step (System.Data.SQLite.SQLiteStatement stmt) [0x00000] in :0
at System.Data.SQLite.SQLiteDataReader.NextResult () [0x00000] in :0
at System.Data.SQLite.SQLiteDataReader…ctor (System.Data.SQLite.SQLiteCommand cmd, CommandBehavior behave) [0x00000] in :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 (CommandBehavior behavior) [0x00000] in :0
at System.Data.SQLite.SQLiteCommand.ExecuteNonQuery () [0x00000] in :0
at Marr.Data.DataMapper.Delete[Log] (System.String tableName, System.Linq.Expressions.Expression1 filter) [0x00000] in <filename unknown>:0 at Marr.Data.DataMapper.Delete[Log] (System.Linq.Expressions.Expression1 filter) [0x00000] in :0
at NzbDrone.Core.Datastore.BasicRepository1[NzbDrone.Core.Instrumentation.Log].Delete (System.Linq.Expressions.Expression1 filter) [0x00000] in :0
at NzbDrone.Core.Instrumentation.LogRepository.Trim () [0x00000] in :0
at NzbDrone.Core.Instrumentation.LogService.Execute (NzbDrone.Core.Instrumentation.Commands.TrimLogCommand message) [0x00000] in :0
at NzbDrone.Core.Messaging.Commands.CommandExecutor.ExecuteCommand[TrimLogCommand] (NzbDrone.Core.Messaging.Commands.Command command) [0x00000] in :0

Thanks

I’m seeing this same issue after upgrading to 2.0.0.1690. Running on Freenas 9.2.1.6 in a jail with mono version 3.4.0 and sqlite3 version 3.8.5.

Request Failed: SQL logic error or missing database near "--10485760": syntax error

System.Data.SQLite.SQLiteException: SQL logic error or missing database
near "--10485760": syntax error
  at System.Data.SQLite.SQLite3.Prepare (System.Data.SQLite.SQLiteConnection cnn, System.String strSql, System.Data.SQLite.SQLiteStatement previous, UInt32 timeoutMS, System.String& strRemain) [0x00000] in <filename unknown>:0 
  at System.Data.SQLite.SQLiteCommand.BuildNextCommand () [0x00000] in <filename unknown>:0 

Could you guys zip up your nzbdrone.db and PM me a link to download it (dropbox, mega, etc)? I don’t think its corruption, but I want to take a look.

@rippernz looks like your log DB is corrupt, not a big deal, just shutdown drone, delete logs.db and drone will recreate it when you start it back up.

Hi markus101
i have sent you a link to the db.

Ill sort out he other log file.

thanks

Haven’t been able to find anything irregular with either DB yet. Still poking at it a bit though.

i found another one that is showing up

Message
Request Failed: SQL logic error or missing database
near “–1048576010485760”: syntax error

Exception
System.Data.SQLite.SQLiteException: SQL logic error or missing database
near “–1048576010485760”: syntax error
at System.Data.SQLite.SQLite3.Prepare (System.Data.SQLite.SQLiteConnection cnn, System.String strSql, System.Data.SQLite.SQLiteStatement previous, UInt32 timeoutMS, System.String& strRemain) [0x00000] in :0
at System.Data.SQLite.SQLiteCommand.BuildNextCommand () [0x00000] in :0

@rippernz is there anything else logged around the same time?

I’m getting the same thing (running the synology packages if it matters):

Message
Error occurred while executing task NzbDrone.Core.Download.CheckForFinishedDownloadCommand: SQL logic error or missing database
near “–10485760”: syntax error

Exception
System.Data.SQLite.SQLiteException: SQL logic error or missing database
near “–10485760”: syntax error
at System.Data.SQLite.SQLite3.Prepare (System.Data.SQLite.SQLiteConnection cnn, System.String strSql, System.Data.SQLite.SQLiteStatement previous, UInt32 timeoutMS, System.String& strRemain) [0x00000] in :0
at System.Data.SQLite.SQLiteCommand.BuildNextCommand () [0x00000] in :0

It comes when a download finishes and Scheduler runs

i have uploaded a copy of a debug logfile to dropbox if your intrested

I added a bit more logging around it if it happens during an API call, trying to narrow in on what is causing it.

It is available in develop build: 2.0.0.1742 available here: http://update.nzbdrone.com/v2/develop/mono/NzbDrone.develop.2.0.0.1742.mono.tar.gz or through drone’s updater here: https://github.com/NzbDrone/NzbDrone/wiki/Release-Branches

Could you all upgrade to that and and pastebin your logs if you get the same exception?

logfile is here

pastebin is here http://pastebin.com/XjARBGjk

http://pastebin.com/SuZwEzWS

and more:

http://pastebin.com/wegjSnHU

I enabled additional logging of the SQL queries available in this download: http://update.nzbdrone.com/v2/sql-logging/mono/NzbDrone.sql-logging.2.0.0.1743.mono.tar.gz

You will need to enable trace logging to log the queries, which will log a lot more data than debug, but it should give the information.

Same as before, if you could extract this one and run it and make the logs available.

Thanks for helping track this one down!

I did it this way because I don’t want it in develop. Just switch the branch in drone to sql-logging and update.

i change changed branches and updated but im not see the errors come up at the moment, will keep you posted

OK here is my log, it starts at
14-8-4 15:40:47.7

there are a couple of them.

i had one earlier but the logging over wrote its self

uploaded to dropbox using the same link above

@rippernz I don’t see this error happening at all in this log file, it probably rolled to another file before you copied it.

@markus101 looks like it was the case, ill post anther one when i see he error pop up.