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

**URL:** <https://forum.duplicati.com/t/restore-fails-with-failed-to-connect-the-database-file-is-locked-database-is-locked/4491>\
**Category:** Support\
**Created:** [August 30, 2018, 1:32am UTC](https://forum.duplicati.com/t/restore-fails-with-failed-to-connect-the-database-file-is-locked-database-is-locked/4491 "2018-08-30T01:32:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![deadman36g](https://forum.duplicati.com/user_avatar/forum.duplicati.com/deadman36g/32/111_2.png) [@deadman36g](https://forum.duplicati.com/u/deadman36g)\
**Post date:** [August 30, 2018, 1:32am UTC](https://forum.duplicati.com/t/restore-fails-with-failed-to-connect-the-database-file-is-locked-database-is-locked/4491/1 "2018-08-30T01:32:48Z")

</div>

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 &lt;ebbb7686960a408ebdd1b567a5688870&gt;:0 

at Mono.Data.Sqlite.SqliteDataReader.NextResult () [0x00104] in &lt;ebbb7686960a408ebdd1b567a5688870&gt;:0 

at Mono.Data.Sqlite.SqliteDataReader..ctor (Mono.Data.Sqlite.SqliteCommand cmd, System.Data.CommandBehavior behave) [0x0004e] in &lt;ebbb7686960a408ebdd1b567a5688870&gt;: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 &lt;ebbb7686960a408ebdd1b567a5688870&gt;:0 

at Mono.Data.Sqlite.SqliteCommand.ExecuteDbDataReader (System.Data.CommandBehavior behavior) [0x00000] in &lt;ebbb7686960a408ebdd1b567a5688870&gt;:0 

at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader () [0x00000] in &lt;51adf9c0a1cb4e2e9307b9cacd9a78c3&gt;:0 

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

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

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

at Duplicati.Library.Main.Database.LocalListDatabase..ctor (System.String path) [0x00000] in &lt;ae134c5a9abb455eb7f06c134d211773&gt;:0 

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

at Duplicati.Library.Main.Controller+&lt;&gt;c __DisplayClass24_0.&lt;List&gt;b__ 0 (Duplicati.Library.Main.ListResults result) [0x0001c] in &lt;ae134c5a9abb455eb7f06c134d211773&gt;:0 

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

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

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

at Duplicati.Server.Runner.Run (Duplicati.Server.Runner+IRunnerData data, System.Boolean fromQueue) [0x00767] in &lt;670b0e4a9ae144208688fcb192d20146&gt;:0 

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

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

at Duplicati.Server.WebServer.RESTHandler.DoProcess (Duplicati.Server.WebServer.RESTMethods.RequestInfo info, System.String method, System.String module, System.String key) [0x00140] in &lt;670b0e4a9ae144208688fcb192d20146&gt;:0
```

---

<div class="post-metadata">

**Author:** ![JonMikelV](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/j/439d5e/32.png) [@JonMikelV](https://forum.duplicati.com/u/JonMikelV)\
**Post date:** [November 9, 2018, 7:04pm UTC](https://forum.duplicati.com/t/restore-fails-with-failed-to-connect-the-database-file-is-locked-database-is-locked/4491/2 "2018-11-09T19:04:20Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![deadman36g](https://forum.duplicati.com/user_avatar/forum.duplicati.com/deadman36g/32/111_2.png) [@deadman36g](https://forum.duplicati.com/u/deadman36g)\
**Post date:** [November 11, 2018, 10:52pm UTC](https://forum.duplicati.com/t/restore-fails-with-failed-to-connect-the-database-file-is-locked-database-is-locked/4491/3 "2018-11-11T22:52:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![JonMikelV](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/j/439d5e/32.png) [@JonMikelV](https://forum.duplicati.com/u/JonMikelV)\
**Post date:** [November 12, 2018, 2:57am UTC](https://forum.duplicati.com/t/restore-fails-with-failed-to-connect-the-database-file-is-locked-database-is-locked/4491/4 "2018-11-12T02:57:30Z")

</div>

Glad to hear it!&nbsp;

---

<div class="post-metadata">

**Author:** ![mikaelmello](https://forum.duplicati.com/user_avatar/forum.duplicati.com/mikaelmello/32/2097_2.png) [@mikaelmello](https://forum.duplicati.com/u/mikaelmello)\
**Post date:** [November 12, 2018, 11:35am UTC](https://forum.duplicati.com/t/restore-fails-with-failed-to-connect-the-database-file-is-locked-database-is-locked/4491/5 "2018-11-12T11:35:02Z")

</div>

This is probably related: [Error "database is locked" when trying to run a backup after a force stop · Issue #3445 · duplicati/duplicati · GitHub](https://github.com/duplicati/duplicati/issues/3445)

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