Unique constraint failed error

Hello,

I am trying to backup my files from one Storj bucket to another Storj bucket (in addition to other profiles where the backup destinations are two Synology drives), but I keep getting a “unique constraint failed” error.

How can I fix this?

Here is the log:

Jan 17, 2025 12:11 PM: The operation Repair has failed with error: constraint failed UNIQUE constraint failed: DuplicateBlock.BlockID, DuplicateBlock.VolumeID
code = Constraint (19), message = System.Data.SQLite.SQLiteException (0x800027AF): constraint failed
UNIQUE constraint failed: DuplicateBlock.BlockID, DuplicateBlock.VolumeID
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.ExecuteNonQuery(CommandBehavior behavior)
at Duplicati.Library.Main.Database.ExtensionMethods.ExecuteNonQuery(IDbCommand self, Boolean writeLog, String cmd, Object values)
at Duplicati.Library.Main.Database.LocalRecreateDatabase.CleanupMissingVolumes()
at Duplicati.Library.Main.Operation.RecreateDatabaseHandler.DoRun(LocalDatabase dbparent, Boolean updating, IFilter filter, NumberedFilterFilelistDelegate filelistfilter, BlockVolumePostProcessor blockprocessor)
at Duplicati.Library.Main.Operation.RecreateDatabaseHandler.Run(String path, IFilter filter, NumberedFilterFilelistDelegate filelistfilter, BlockVolumePostProcessor blockprocessor)
at Duplicati.Library.Main.Operation.RepairHandler.RunRepairLocal(IFilter filter)
at Duplicati.Library.Main.Operation.RepairHandler.Run(IFilter filter)
at Duplicati.Library.Main.Controller.<>c__DisplayClass21_0.b__0(RepairResults result)
at Duplicati.Library.Main.Controller.RunAction[T](T result, String& paths, IFilter& filter, Action1 method) at Duplicati.Library.Main.Controller.RunAction[T](T result, IFilter& filter, Action1 method)
at Duplicati.Library.Main.Controller.Repair(IFilter filter)
at Duplicati.Server.Runner.Run(IRunnerData data, Boolean fromQueue)

That looks like the report here. Is this 2.1.0.2 Beta as well? See bottom for fix, but it’s Canary.

Recreate constraint violation on DuplicateBlock has more info on the second attempt for a fix.

As of right now, nobody has verified it though.

It’s not the beta. It’s the official. Should I just wait for an update to the official version?

Edit 1: Never mind, it’s the beta. 2.1.0.2_beta_2024-11-29.

Meaning what for “official”? What version does About say? Or look at your installation file.

It’s the beta. Did you see my edit?

I do now, but not before. Presumably the Canary fix (if effective) will be in a new Beta sometime.

You can probably do a Canary install somewhere else to see whether it can recreate a database.

If it can, then you will have something to look forward to. Why are you doing a Recreate anyway?

If you can do database Recreate somewhere, then you can move it to your 2.1.0.2 system to use.

Downgrade from 2.1.0.2 to 2.0.8.1 might be an option, but seems a waste if other things work OK.

I reformatted my computer and was adding my backup profiles again after Duplicati install. I did a recreate because I got an error that there were remote files not found in local storage and that I needed to repair. The repair was not successful, so the system prompted me to recreate.

Migrating Duplicati to a new machine can also be used in a reformat situation.
If database files were not preserved, then they must be recreated somewhere.

If you have only one computer, you can probably install Canary to do recreate.
If that works, then install 2.1.0.2, as Beta is less likely to throw some surprises.

OK. Thanks for your help. You are awesome!

Please report if Canary works. I’m hoping the fix attempts get some successes from people.

Thanks.

This? Release v2.1.0.107_canary_2025-01-17 · duplicati/duplicati · GitHub

Yes, and I guess you want duplicati-2.1.0.107_canary_2025-01-17-win-x64-gui.msi assuming this is a typical Windows system. That’s the Canary version of what’s highlighted on Download page which you can install to return to Beta after seeing if today’s Canary can Recreate database for you.