The database file is locked after stopping backup job


I reference another topic here as well, because this one resulted in the above issue :smiley:

After stop after upload didn’t work but I needed to stop the backup, I used stop and moved the data which was locally to a remote location where all the other data is located as well.
The other backup jobs work great, but this one makes headaches.

600GB of 1,4TB were transfered and now if I start the job I get

The database file is locked database is locked

I need to fix this without losing the backup data, it took me already quite long to create the 600GB archives.


Error on purge-broken-files
Stop after Upload

In the other post you mention QNAP, so I assume this is still the case.

To check why the database is locked, you need to first get the database path.
You can get it a number of ways, one is to use “Export” then “As commandline” on the backup job, and look for --dbpath=.

Then you need to use lsof <dbpath> from a commandline or similar. This will tell you which processes are locking the file. To recover, you should be able to restart the programs locking the database, and then Duplicati should get access again.

Quick and dirty fix, is to reboot the system, hereby restarting all processes.

1 Like


Great, I got a step further :slight_smile:
I can now rerun the backup job, but instead of the database locked error I get

Error while running name
One or more errors occured.

The log data shows a list with lots of entries (5136 to be precise)
Which all look similar to


I just don’t understand where the error is.



Sorry to revive an old thread, but I had this same issue yesterday (on beta) after I noticed a backup stuck for hours on the verifying step. No amount of rebooting, restarting the Duplicati Windows service, removing/adding the B2 configuration, or logging out/in to Windows removed the lock. Something (I think restarting the service) caused the error to change from “the database file is locked database is locked” to “the process cannot access the file ‘<path to .sqlite db file>’ because it is being used by another process”. I even moved the old database and let Duplicati create a new one, but that still didn’t resolve it. I did also verify the “lock_v2” file was being removed whenever I did a stop/start, but that had no affect either.

Ultimately what I did was stop the service, delete the “control_dir_v2” directory and the Duplicati-server.sqlite file, reimport my B2 configuration, start the service, and re-point to the original db. That seemed to fix it.