PurgeBrokenFiles results in "Library used incorrectly"


I’m in a problem situation again: Unexpected difference in fileset, I tried to delete it, to no effect, I’ve tried a Verify files, also gives Unexpected difference in fileset version 2
When I try Purge broken files, I get a totally different error however:

15 apr. 2020 11:44: The operation PurgeBrokenFiles has failed with error: Library used incorrectly No transaction is active on this connection
{“ClassName”:“Mono.Data.Sqlite.SqliteException”,“Message”:“Library used incorrectly\r\nNo transaction is active on this connection”,“Data”:null,“InnerException”:null,“HelpURL”:null,“StackTraceString”:" at Mono.Data.Sqlite.SqliteTransaction.IsValid (System.Boolean throwError) [0x00040] in :0 \n at Mono.Data.Sqlite.SqliteTransaction.Rollback () [0x00000] in :0 \n at Duplicati.Library.Main.Operation.PurgeBrokenFilesHandler.Run (Duplicati.Library.Utility.IFilter filter) [0x0064e] in <8f1de655bd1240739a78684d845cecc8>:0 \n at Duplicati.Library.Main.Controller+<>c__DisplayClass35_0.b__0 (Duplicati.Library.Main.PurgeBrokenFilesResults result) [0x0001c] in <8f1de655bd1240739a78684d845cecc8>:0 \n at Duplicati.Library.Main.Controller.RunAction[T] (T result, System.String& paths, Duplicati.Library.Utility.IFilter& filter, System.Action`1[T] method) [0x0011c] in <8f1de655bd1240739a78684d845cecc8>:0 ",“RemoteStackTraceString”:null,“RemoteStackIndex”:0,“ExceptionMethod”:null,“HResult”:-2147467259,“Source”:“Mono.Data.Sqlite”}

I’m guessing this backup is fubar and I should create a new one instead?

Can you elaborate? Did the deletion fail?

I don’t think purge broken files is the right approach with this problem, but the error you got is confusing and may be a bug.

What version of Duplicati are you using? What operating system? If not Windows, what mono version?


Hi, I tried a “delete” operation with the --version=X where X was the number mentioned in the error message. I don’t recall the delete operation returning any failures; but it’s unclear how to access the logs, if I go to logs I only see (under stored) only the “backup” operations. On the “Live” I can see more recent operations. It just keeps coming up with a new “version” that is supposedly corrupted, so I ended up running the delete operation several times, going back and forth between attempting a backup, getting a failure message, deleting, retrying…

I don’t know about all the operations on duplicati, or where that “fileset” lives, could be on the remote storage, could be the local database. I know delete and repair database is very dangerous operation so I didn’t try that one for this issue (I’ve lost backups in the past with that).

So at the time I ran the PurgeBrokenFiles, my “fileset” was in some kind of corrupt state, maybe that caused the error with the database connection?

Version is
Installed from .deb package on Ubuntu Bionic 18.04.4.
mono --version: Mono JIT compiler version 4.6.2 (Debian

It is possible the delete operation isn’t working because you are using an old version of Mono. Duplicati 2.0.5.x requires Mono 5.0 or newer. (The Duplicati deb package now has a flag to require Mono >= 5.0 but that change wasn’t done in time for beta, unfortunately.)

Stop Duplicati service and upgrade Mono per these instructions:


Then restart the Duplicati service and try again.

I’ve updated the Mono, and haven’t seen the error since. But to be honest, hadn’t seen it before either so there’s not really any way to tell if this was the root cause.