Restore fails with "Failed to connect: The database file is locked database is locked"

I am running Duplicati - 2.0.3.3_beta_2018-04-02 via docker.

My back up is finished with the GUI stating " Next scheduled task: nas-comics Saturday at 11:00 PM"

When I run the restore it stays on starting for several minutes then I get the following the in the log

Mono.Data.Sqlite.SqliteException (0x80004005): The database file is locked

database is locked

at Mono.Data.Sqlite.SQLite3.Step (Mono.Data.Sqlite.SqliteStatement stmt) [0x00089] in <ebbb7686960a408ebdd1b567a5688870>:0 

at Mono.Data.Sqlite.SqliteDataReader.NextResult () [0x00104] in <ebbb7686960a408ebdd1b567a5688870>:0 

at Mono.Data.Sqlite.SqliteDataReader..ctor (Mono.Data.Sqlite.SqliteCommand cmd, System.Data.CommandBehavior behave) [0x0004e] in <ebbb7686960a408ebdd1b567a5688870>:0 

at (wrapper remoting-invoke-with-check) Mono.Data.Sqlite.SqliteDataReader..ctor(Mono.Data.Sqlite.SqliteCommand,System.Data.CommandBehavior)

at Mono.Data.Sqlite.SqliteCommand.ExecuteReader (System.Data.CommandBehavior behavior) [0x00006] in <ebbb7686960a408ebdd1b567a5688870>:0 

at Mono.Data.Sqlite.SqliteCommand.ExecuteDbDataReader (System.Data.CommandBehavior behavior) [0x00000] in <ebbb7686960a408ebdd1b567a5688870>:0 

at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader () [0x00000] in <51adf9c0a1cb4e2e9307b9cacd9a78c3>:0 

at Duplicati.Library.Main.Database.ExtensionMethods.ExecuteScalarInt64 (System.Data.IDbCommand self, System.String cmd, System.Int64 defaultvalue, System.Object[] values) [0x0004e] in <ae134c5a9abb455eb7f06c134d211773>:0 

at Duplicati.Library.Main.Database.LocalDatabase..ctor (System.Data.IDbConnection connection, System.String operation) [0x0005e] in <ae134c5a9abb455eb7f06c134d211773>:0 

at Duplicati.Library.Main.Database.LocalDatabase..ctor (System.String path, System.String operation, System.Boolean shouldclose) [0x00007] in <ae134c5a9abb455eb7f06c134d211773>:0 

at Duplicati.Library.Main.Database.LocalListDatabase..ctor (System.String path) [0x00000] in <ae134c5a9abb455eb7f06c134d211773>:0 

at Duplicati.Library.Main.Operation.ListFilesHandler.Run (System.Collections.Generic.IEnumerable`1[T] filterstrings, Duplicati.Library.Utility.IFilter compositefilter) [0x0007d] in <ae134c5a9abb455eb7f06c134d211773>:0 

at Duplicati.Library.Main.Controller+<>c__DisplayClass24_0.<List>b__0 (Duplicati.Library.Main.ListResults result) [0x0001c] in <ae134c5a9abb455eb7f06c134d211773>:0 

at Duplicati.Library.Main.Controller.RunAction[T] (T result, System.String[]& paths, Duplicati.Library.Utility.IFilter& filter, System.Action`1[T] method) [0x0014b] in <ae134c5a9abb455eb7f06c134d211773>:0 

at Duplicati.Library.Main.Controller.RunAction[T] (T result, Duplicati.Library.Utility.IFilter& filter, System.Action`1[T] method) [0x00007] in <ae134c5a9abb455eb7f06c134d211773>:0 

at Duplicati.Library.Main.Controller.List (System.Collections.Generic.IEnumerable`1[T] filterstrings, Duplicati.Library.Utility.IFilter filter) [0x00021] in <ae134c5a9abb455eb7f06c134d211773>:0 

at Duplicati.Server.Runner.Run (Duplicati.Server.Runner+IRunnerData data, System.Boolean fromQueue) [0x00767] in <670b0e4a9ae144208688fcb192d20146>:0 

at Duplicati.Server.WebServer.RESTMethods.Backup.ListFileSets (Duplicati.Server.Serialization.Interface.IBackup backup, Duplicati.Server.WebServer.RESTMethods.RequestInfo info) [0x000a4] in <670b0e4a9ae144208688fcb192d20146>:0 

at Duplicati.Server.WebServer.RESTMethods.Backup.GET (System.String key, Duplicati.Server.WebServer.RESTMethods.RequestInfo info) [0x001f6] in <670b0e4a9ae144208688fcb192d20146>:0 

at Duplicati.Server.WebServer.RESTHandler.DoProcess (Duplicati.Server.WebServer.RESTMethods.RequestInfo info, System.String method, System.String module, System.String key) [0x00140] in <670b0e4a9ae144208688fcb192d20146>:0

Did you ever resolve this?

The database is normally locked while a backup is running - is it possible some part of the job (such as the post-backup verification) is still running run you try to do a restore?

Sorry the long delay, but I set up a new duplicati Docker using 2.0 Beta instead of Canary and have not encountered this error since.

Glad to hear it! 

This is probably related: Error "database is locked" when trying to run a backup after a force stop · Issue #3445 · duplicati/duplicati · GitHub

This bug was introduced in v2.0.3.6, but I see you are using v2.0.3.3