UNIQUE constraint failed with SIA (Support Request)


#1

Hello,

I’m now seeing the following error when I try to run my system backup. This started after installing version 2.0.3.6_canary_2018-04-23. I’ve tried deleting and recreating the database, but it has not helped. Any help would be appreciated.

Thanks!log.zip (9.7 KB)

Edit:
Here’s the contents of log.zip. :slight_smile:

System.AggregateException: One or more errors occurred. ---> System.AggregateException: constraint failed UNIQUE constraint failed: FilesetEntry.FilesetID, FilesetEntry.FileID ---> System.Data.SQLite.SQLiteException: constraint failed UNIQUE constraint failed: FilesetEntry.FilesetID, FilesetEntry.FileID
 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 Duplicati.Library.Main.Database.LocalBackupDatabase.AddUnmodifiedFile(Int64 fileid, DateTime lastmodified, IDbTransaction transaction)
 at Duplicati.Library.Main.Operation.Common.SingleRunner.<>c__DisplayClass6_0.<RunOnMain>b__0()
 at Duplicati.Library.Main.Operation.Common.SingleRunner.<>c__DisplayClass5_0`1.<<DoRunOnMain>b__1>d.MoveNext()

 --- End of stack trace from previous location where exception was thrown ---
 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
 at Duplicati.Library.Main.Operation.Backup.FilePreFilterProcess.<>c__DisplayClass1_0.<<Run>b__0>d.MoveNext()

 --- End of stack trace from previous location where exception was thrown ---
 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
 at CoCoL.AutomationExtensions.<RunTask>d__10`1.MoveNext()

 --- End of stack trace from previous location where exception was thrown ---
 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
 at Duplicati.Library.Main.Operation.BackupHandler.<RunMainOperation>d__11.MoveNext()

 --- End of stack trace from previous location where exception was thrown ---
 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
 at Duplicati.Library.Main.Operation.BackupHandler.<RunAsync>d__18.MoveNext()

 --- End of inner exception stack trace ---
 at Duplicati.Library.Main.Operation.BackupHandler.<RunAsync>d__18.MoveNext()

 --- End of inner exception stack trace ---
 at CoCoL.ChannelExtensions.WaitForTaskOrThrow(Task task)
 at Duplicati.Library.Main.Controller.<>c__DisplayClass15_0.<Backup>b__0(BackupResults result)
 at Duplicati.Library.Main.Controller.RunAction[T](T result, String[]& paths, IFilter& filter, Action`1 method)
 at Duplicati.Library.Main.Controller.Backup(String[] inputsources, IFilter filter)
 at Duplicati.Server.Runner.Run(IRunnerData data, Boolean fromQueue) ---> (Inner Exception #0) System.AggregateException: constraint failed UNIQUE constraint failed: FilesetEntry.FilesetID, FilesetEntry.FileID ---> System.Data.SQLite.SQLiteException: constraint failed UNIQUE constraint failed: FilesetEntry.FilesetID, FilesetEntry.FileID
 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 Duplicati.Library.Main.Database.LocalBackupDatabase.AddUnmodifiedFile(Int64 fileid, DateTime lastmodified, IDbTransaction transaction)
 at Duplicati.Library.Main.Operation.Common.SingleRunner.<>c__DisplayClass6_0.<RunOnMain>b__0()
 at Duplicati.Library.Main.Operation.Common.SingleRunner.<>c__DisplayClass5_0`1.<<DoRunOnMain>b__1>d.MoveNext()

 --- End of stack trace from previous location where exception was thrown ---
 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
 at Duplicati.Library.Main.Operation.Backup.FilePreFilterProcess.<>c__DisplayClass1_0.<<Run>b__0>d.MoveNext()

 --- End of stack trace from previous location where exception was thrown ---
 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
 at CoCoL.AutomationExtensions.<RunTask>d__10`1.MoveNext()

 --- End of stack trace from previous location where exception was thrown ---
 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
 at Duplicati.Library.Main.Operation.BackupHandler.<RunMainOperation>d__11.MoveNext()

 --- End of stack trace from previous location where exception was thrown ---
 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
 at Duplicati.Library.Main.Operation.BackupHandler.<RunAsync>d__18.MoveNext()

 --- End of inner exception stack trace ---
 at Duplicati.Library.Main.Operation.BackupHandler.<RunAsync>d__18.MoveNext() ---> (Inner Exception #0) System.Data.SQLite.SQLiteException (0x80004005): constraint failed UNIQUE constraint failed: FilesetEntry.FilesetID, FilesetEntry.FileID
 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 Duplicati.Library.Main.Database.LocalBackupDatabase.AddUnmodifiedFile(Int64 fileid, DateTime lastmodified, IDbTransaction transaction)
 at Duplicati.Library.Main.Operation.Common.SingleRunner.<>c__DisplayClass6_0.<RunOnMain>b__0()
 at Duplicati.Library.Main.Operation.Common.SingleRunner.<>c__DisplayClass5_0`1.<<DoRunOnMain>b__1>d.MoveNext()

 --- End of stack trace from previous location where exception was thrown ---
 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
 at Duplicati.Library.Main.Operation.Backup.FilePreFilterProcess.<>c__DisplayClass1_0.<<Run>b__0>d.MoveNext()

 --- End of stack trace from previous location where exception was thrown ---
 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
 at CoCoL.AutomationExtensions.<RunTask>d__10`1.MoveNext()

 --- End of stack trace from previous location where exception was thrown ---
 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
 at Duplicati.Library.Main.Operation.BackupHandler.<RunMainOperation>d__11.MoveNext()

 --- End of stack trace from previous location where exception was thrown ---
 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
 at Duplicati.Library.Main.Operation.BackupHandler.<RunAsync>d__18.MoveNext()<--- ---> (Inner Exception #1) System.AggregateException: One or more errors occurred. ---> System.Exception: Unable to find log in lookup table, this may be caused by attempting to transport call contexts between AppDomains (eg. with remoting calls)
 at Duplicati.Library.Logging.Log.get_CurrentScope()
 at Duplicati.Library.Logging.Log.WriteMessage(LogMessageType type, String tag, String id, Exception ex, String message, Object[] arguments)
 at Duplicati.Library.Main.Operation.Backup.FileEnumerationProcess.<>c.<Run>b__1_3(String rootpath, String path, Exception ex)
 at Duplicati.Library.Utility.Utility.<EnumerateFileSystemEntries>d__23.MoveNext()
 at System.Linq.Enumerable.<SelectManyIterator>d__17`2.MoveNext()
 at Duplicati.Library.Main.Operation.Backup.FileEnumerationProcess.<>c__DisplayClass1_0.<<Run>b__0>d.MoveNext()

 --- End of stack trace from previous location where exception was thrown ---
 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
 at CoCoL.AutomationExtensions.<RunTask>d__10`1.MoveNext()

 --- End of inner exception stack trace --- ---> (Inner Exception #0) System.Exception: Unable to find log in lookup table, this may be caused by attempting to transport call contexts between AppDomains (eg. with remoting calls)
 at Duplicati.Library.Logging.Log.get_CurrentScope()
 at Duplicati.Library.Logging.Log.WriteMessage(LogMessageType type, String tag, String id, Exception ex, String message, Object[] arguments)
 at Duplicati.Library.Main.Operation.Backup.FileEnumerationProcess.<>c.<Run>b__1_3(String rootpath, String path, Exception ex)
 at Duplicati.Library.Utility.Utility.<EnumerateFileSystemEntries>d__23.MoveNext()
 at System.Linq.Enumerable.<SelectManyIterator>d__17`2.MoveNext()
 at Duplicati.Library.Main.Operation.Backup.FileEnumerationProcess.<>c__DisplayClass1_0.<<Run>b__0>d.MoveNext()

 --- End of stack trace from previous location where exception was thrown ---
 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
 at CoCoL.AutomationExtensions.<RunTask>d__10`1.MoveNext()<--- <--- <--- 

#2

Hello @backupti, welcome to the forum!

I haven’t seen that particular error before so I’m going to try an pull in @Pectojin who has a bit more insight into the database side of things.

(Oh, and I edited your post to include the raw txt of your log.zip file to make it easier for people searching for similar issues to find.)


#3

Thanks for the reply, i was trying to keep the post de-cluttered. Please let me know if you find anything or have recommendations on how to recover :frowning:


#4

Hey team, I was able to downgrade Duplicati, (including manually removing the latest version from C:\ProgramData\Duplicati\updates which is not removed by the uninstaller!). Deleted and recreated the database, and the backup is working again.


#5

Glad to hear you got it working!

I know 2.0.3.6 has had some issues reported, but I hadn’t heard this one might be related. Do you recall what you downgraded to? Was it an older canary or all the way back to 2.0.3.3 beta?


#6

I’ve downgraded to 2.0.3.5_canary_2018-04-13.


#7

Thanks for clarifying. Do you want that (downgrade + database recreate) marked as the solution or should we wait and see if the issue comes back while using 2.0.3.5?