Error: constraint failed UNIQUE constraint failed: Remotevolume.Name, Remotevolume.State

I’m getting the following error every time I try to run my backup:

constraint failed
 UNIQUE constraint failed: Remotevolume.Name, Remotevolume.State

I have tried stopping/re-starting the duplicati service (I have it installed as a service).
I should note that if I go to the Backup Config’s Database page, and click “Repair” I get the exact same message, so it appears to be a backend database issue.

Thanks for any help. If I figure it out, I’ll post my results here.

– Andrew.

My log file has this in it

{"errorCode":"Constraint","ClassName":"System.Data.SQLite.SQLiteException","Message":"constraint failed\r\nUNIQUE constraint failed: Remotevolume.Name, Remotevolume.State","Data":null,"InnerException":null,"HelpURL":null,"StackTraceString":"   at System.Data.SQLite.SQLite3.Reset(SQLiteStatement stmt)\r\n   at System.Data.SQLite.SQLite3.Step(SQLiteStatement stmt)\r\n   at System.Data.SQLite.SQLiteDataReader.NextResult()\r\n   at System.Data.SQLite.SQLiteDataReader..ctor(SQLiteCommand cmd, CommandBehavior behave)\r\n   at System.Data.SQLite.SQLiteCommand.ExecuteReader(CommandBehavior behavior)\r\n   at System.Data.SQLite.SQLiteCommand.ExecuteNonQuery(CommandBehavior behavior)\r\n   at Duplicati.Library.Main.Database.LocalDatabase.UpdateRemoteVolume(String name, RemoteVolumeState state, Int64 size, String hash, Boolean suppressCleanup, TimeSpan deleteGraceTime, IDbTransaction transaction)\r\n   at Duplicati.Library.Main.Operation.FilelistProcessor.RemoteListAnalysis(BackendManager backend, Options options, LocalDatabase database, IBackendWriter log, String protectedfile)\r\n   at Duplicati.Library.Main.Operation.FilelistProcessor.VerifyRemoteList(BackendManager backend, Options options, LocalDatabase database, IBackendWriter log, String protectedfile)\r\n   at Duplicati.Library.Main.Operation.BackupHandler.PreBackupVerify(BackendManager backend, String protectedfile)\r\n   at Duplicati.Library.Main.Operation.BackupHandler.Run(String[] sources, IFilter filter)\r\n   at Duplicati.Library.Main.Controller.<>c__DisplayClass16_0.<Backup>b__0(BackupResults result)\r\n   at Duplicati.Library.Main.Controller.RunAction[T](T result, String[]& paths, IFilter& filter, Action`1 method)\r\n   at Duplicati.Library.Main.Controller.Backup(String[] inputsources, IFilter filter)\r\n   at Duplicati.Server.Runner.Run(IRunnerData data, Boolean fromQueue)","RemoteStackTraceString":null,"RemoteStackIndex":0,"ExceptionMethod":"8\nReset\nSystem.Data.SQLite, Version=, Culture=neutral, PublicKeyToken=db937bc2d44ff139\nSystem.Data.SQLite.SQLite3\nSystem.Data.SQLite.SQLiteErrorCode Reset(System.Data.SQLite.SQLiteStatement)","HResult":-2147467259,"Source":"System.Data.SQLite","WatsonBuckets":null}

I think I have it figured out.
First, I tried to Repair the database. That didn’t work. Gave more errors.
Then I attempted to Delete the Database and Recreate. That didn’t work. Gave more errors.
Then I tried to delete again, still no luck.

Then I opened the location where the Database was stored and saw the .backup file there, even though I had clicked "Delete."
I moved that file to my desktop (so I could save it).
Then I clicked “Run Now” and it re-created the .sqlite file and it is working.

Not sure what caused this, but I think deleting the Database should actually delete it…apparently if there is a .backup file there, it does not.

I’m a programmer (although I will admit, c# is not my best lang), so maybe when I get a chance I’ll look at the code and see I can see what is causing this.
I think it is a great piece of software and will do what I can to help.

– Andrew.

I agree, the delete button should do what it says.

That sounds awesome! I have not been able to reproduce the problem myself, so if you can pinpoint it on your machine, that would be a huge help.