Cannot restore a file

Hello,

I recently needed to restore a Calibre metadata.db file from backup to Box. It has been failing and I cannot seem to repair the DB no matter what I do.

First failure:

Duplicati.Library.Interface.UserInformationException: Found 6 files that are missing from the remote storage, please run repair
   at Duplicati.Library.Main.Operation.FilelistProcessor.VerifyRemoteList(BackendManager backend, Options options, LocalDatabase database, IBackendWriter log, IEnumerable`1 protectedFiles)
   at Duplicati.Library.Main.Operation.RestoreHandler.DoRun(LocalDatabase dbparent, IFilter filter, RestoreResults result)
   at Duplicati.Library.Main.Operation.RestoreHandler.Run(String[] paths, IFilter filter)
   at Duplicati.Library.Main.Controller.<>c__DisplayClass15_0.<Restore>b__0(RestoreResults result)
   at Duplicati.Library.Main.Controller.RunAction[T](T result, String[]& paths, IFilter& filter, Action`1 method)
   at Duplicati.Library.Main.Controller.Restore(String[] paths, IFilter filter)
   at Duplicati.Server.Runner.Run(IRunnerData data, Boolean fromQueue)

After running repair:

Duplicati.Library.Interface.UserInformationException: The backup storage destination is missing data files. You can either enable `--rebuild-missing-dblock-files` or run the purge command to remove these files. The following files are missing: duplicati-bf298ba138577419583d857dc46c06e23.dblock.zip.aes
   at Duplicati.Library.Main.Operation.RepairHandler.RunRepairRemote()
   at Duplicati.Library.Main.Operation.RepairHandler.Run(IFilter filter)
   at Duplicati.Library.Main.Controller.RunAction[T](T result, String[]& paths, IFilter& filter, Action`1 method)
   at Duplicati.Library.Main.Controller.Repair(IFilter filter)
   at Duplicati.Server.Runner.Run(IRunnerData data, Boolean fromQueue)

After enabling --rebuild-missing-dblock-files and trying to restore again:

Duplicati.Library.Interface.UserInformationException: Found 1 files that are missing from the remote storage, please run repair
   at Duplicati.Library.Main.Operation.FilelistProcessor.VerifyRemoteList(BackendManager backend, Options options, LocalDatabase database, IBackendWriter log, IEnumerable`1 protectedFiles)
   at Duplicati.Library.Main.Operation.RestoreHandler.DoRun(LocalDatabase dbparent, IFilter filter, RestoreResults result)
   at Duplicati.Library.Main.Operation.RestoreHandler.Run(String[] paths, IFilter filter)
   at Duplicati.Library.Main.Controller.<>c__DisplayClass15_0.<Restore>b__0(RestoreResults result)
   at Duplicati.Library.Main.Controller.RunAction[T](T result, String[]& paths, IFilter& filter, Action`1 method)
   at Duplicati.Library.Main.Controller.Restore(String[] paths, IFilter filter)
   at Duplicati.Server.Runner.Run(IRunnerData data, Boolean fromQueue)

After running repair again:

Jan 12, 2023 1:46 PM: This may be fixed by deleting the filesets and running repair again
Jan 12, 2023 1:46 PM: Repair cannot acquire 20 required blocks for volume duplicati-bf298ba138577419583d857dc46c06e23.dblock.zip.aes, which are required by the following filesets:

But it doesn’t reveal the filesets. Then this:

Jan 12, 2023 1:46 PM: Failed to perform cleanup for missing file: duplicati-bf298ba138577419583d857dc46c06e23.dblock.zip.aes, message: Repair not possible, missing 20 blocks. If you want to continue working with the database, you can use the "list-broken-files" and "purge-broken-files" commands to purge the missing data from the database and the remote storage.

I ran the following command from CLI and got the result shown:

PS C:\Program Files\Duplicati 2> .\Duplicati.CommandLine.exe list-broken-files box://Backups/Library?authid=****

Enter encryption passphrase: *********

ErrorID: DatabaseDoesNotExist
Database file does not exist: C:\Users\Marc\AppData\Local\Duplicati\CMWRVSWIZA.sqlite

Please advise.

Hello

to set appropriately the command from CLI, it’s easier to export the job as command line and to replace the ‘backup’ command by the one you want to use (here ‘list-broken-files’), remove the options that don’t make sense for the command (here you should remove the filters and the arguments - the file names and directories to backup), since Duplicati will refuse to run the command if it finds invalid options.

If you do that, you’ll find that the exported command includes a reference to the database - it’s likely that when you don’t specify it, the command will set a reference to a default database that is not the real one used by backups. This may be the reason for your final problem.

I think that purge-broken-files may be the way to fix the initial problem indeed.

All database names (GUI or CLI) are assigned as random unless you say which dbpath you want.
GUI remembers DB per-job in Duplicati-server.sqlite database. CLI remembers it in dbconfig.json.
Future CLI runs find it again based on the destination. When using CLI for GUI, pass GUI dbpath.
Using the Command line tools from within the Graphical User Interface does this for you, as does
Export As Command-line if you prefer to do your modification from that instead (to use a true CLI).

True CLI runs independently from GUI, but can be sort of connected to GUI through the database.

Almost certainly, if backup was GUI (if not, say so). You can also see its path in database screen.

About → Show log → Live → Warning would probably name them. Kind of awkward, admittedly…
The PURGE-BROKEN-FILES command (and list-broken-files) seems to notice dblocks best.
Although you got a message on at least one dblock, it would be good to see how dindex are now.

I think this is run before and after a backup unless you ask for no-backend-verification.
Beyond prior question about database and files, I wonder how backup worked before?

I made progress with this:

 .\Duplicati.CommandLine.exe purge-broken-files box://Backups/Library?authid=***** --dbpath=C:\Users\Marc\AppData\Local\Duplicati\WNNKUPALIO.sqlite

But it asks for the encryption passphrase and when I type in what I think is the correct one it says:

You have attempted to change a passphrase to an existing backup, which is not supported. Please configure a new clean backup if you want to change the passphrase.

Does this mean it’s the incorrect passphrase? Shouldn’t it tell me the passphrase is incorrect and to try again?

It would probably be best doing it as said below, rather than trying to do all the options from scratch.

EDIT to repeat other option:

Figured it out. Seems to have purged correctly. Let’s now see if the repair works.

1 Like

It worked and I’ve got things backed up properly again.

1 Like