Failed to restore failed to decrypt

Here’s the note that I took during the restoring process. TL;DR: It’s related to the web interface, so use command line instead.

Working on Windows 10 and after using the web interface to create and run a backup job called “test-backup” with destination pointing to a USB-connected external hard drive successfully, the restoring process is acting strange.

  1. If just one file is selected to restore and the source folder remains where it is originally, the file can be restored to a new location but an error such as below is still reported:

    2020-11-02 17:00:13 +08 - [Error-Duplicati.Library.Main.Operation.RestoreHandler-PatchingFailed]: Failed to patch with remote file: "duplicati-b5b00656e1c2e4399905807e3f1c00507.dblock.zip.aes", message: Failed to decrypt data (invalid passphrase?): Invalid password or corrupted data
    

    Complete log:

    {
      "RestoredFiles": 0,
      "SizeOfRestoredFiles": 0,
      "RestoredFolders": 0,
      "RestoredSymlinks": 0,
      "PatchedFiles": 0,
      "DeletedFiles": 0,
      "DeletedFolders": 0,
      "DeletedSymlinks": 0,
      "MainOperation": "Restore",
      "RecreateDatabaseResults": null,
      "ParsedResult": "Error",
      "Version": "2.0.5.1 (2.0.5.1_beta_2020-01-18)",
      "EndTime": "2020-11-02T08:41:54.7965139Z",
      "BeginTime": "2020-11-02T08:41:13.6612302Z",
      "Duration": "00:00:41.1352837",
      "MessagesActualLength": 16,
      "WarningsActualLength": 0,
      "ErrorsActualLength": 2,
      "Messages": [
        "2020-11-02 16:41:13 +08 - [Information-Duplicati.Library.Main.Controller-StartingOperation]: The operation Restore has started",
        "2020-11-02 16:41:13 +08 - [Information-Duplicati.Library.Main.BasicResults-BackendEvent]: Backend event: List - Started:  ()",
        "2020-11-02 16:41:13 +08 - [Information-Duplicati.Library.Main.BasicResults-BackendEvent]: Backend event: List - Completed:  (3 bytes)",
        "2020-11-02 16:41:13 +08 - [Information-Duplicati.Library.Main.Database.LocalRestoreDatabase-SearchingBackup]: Searching backup 0 (11/2/2020 6:36:55) ...",
        "2020-11-02 16:41:13 +08 - [Information-Duplicati.Library.Main.Operation.RestoreHandler-RemoteFileCount]: 1 remote files are required to restore",
        "2020-11-02 16:41:13 +08 - [Information-Duplicati.Library.Main.BasicResults-BackendEvent]: Backend event: Get - Started: duplicati-b0c61469407564d3588544e9f1e13423a.dblock.zip.aes (49.10 MB)",
        "2020-11-02 16:41:13 +08 - [Information-Duplicati.Library.Main.BasicResults-BackendEvent]: Backend event: Get - Retrying: duplicati-b0c61469407564d3588544e9f1e13423a.dblock.zip.aes (49.10 MB)",
        "2020-11-02 16:41:23 +08 - [Information-Duplicati.Library.Main.BasicResults-BackendEvent]: Backend event: Get - Started: duplicati-b0c61469407564d3588544e9f1e13423a.dblock.zip.aes (49.10 MB)",
        "2020-11-02 16:41:24 +08 - [Information-Duplicati.Library.Main.BasicResults-BackendEvent]: Backend event: Get - Retrying: duplicati-b0c61469407564d3588544e9f1e13423a.dblock.zip.aes (49.10 MB)",
        "2020-11-02 16:41:34 +08 - [Information-Duplicati.Library.Main.BasicResults-BackendEvent]: Backend event: Get - Started: duplicati-b0c61469407564d3588544e9f1e13423a.dblock.zip.aes (49.10 MB)",
        "2020-11-02 16:41:34 +08 - [Information-Duplicati.Library.Main.BasicResults-BackendEvent]: Backend event: Get - Retrying: duplicati-b0c61469407564d3588544e9f1e13423a.dblock.zip.aes (49.10 MB)",
        "2020-11-02 16:41:44 +08 - [Information-Duplicati.Library.Main.BasicResults-BackendEvent]: Backend event: Get - Started: duplicati-b0c61469407564d3588544e9f1e13423a.dblock.zip.aes (49.10 MB)",
        "2020-11-02 16:41:44 +08 - [Information-Duplicati.Library.Main.BasicResults-BackendEvent]: Backend event: Get - Retrying: duplicati-b0c61469407564d3588544e9f1e13423a.dblock.zip.aes (49.10 MB)",
        "2020-11-02 16:41:54 +08 - [Information-Duplicati.Library.Main.BasicResults-BackendEvent]: Backend event: Get - Started: duplicati-b0c61469407564d3588544e9f1e13423a.dblock.zip.aes (49.10 MB)",
        "2020-11-02 16:41:54 +08 - [Information-Duplicati.Library.Main.BasicResults-BackendEvent]: Backend event: Get - Failed: duplicati-b0c61469407564d3588544e9f1e13423a.dblock.zip.aes (49.10 MB)",
        "2020-11-02 16:41:54 +08 - [Information-Duplicati.Library.Main.Operation.RestoreHandler-RestoreFailures]: Failed to restore 1 files, additionally the following files failed to download, which may be the cause:\r\nduplicati-b0c61469407564d3588544e9f1e13423a.dblock.zip.aes"
      ],
      "Warnings": [],
      "Errors": [
        "2020-11-02 16:41:54 +08 - [Error-Duplicati.Library.Main.Operation.RestoreHandler-PatchingFailed]: Failed to patch with remote file: \"duplicati-b0c61469407564d3588544e9f1e13423a.dblock.zip.aes\", message: Failed to decrypt data (invalid passphrase?): Invalid password or corrupted data",
        "2020-11-02 16:41:54 +08 - [Error-Duplicati.Library.Main.Operation.RestoreHandler-RestoreFileFailed]: Could not find a part of the path 'D:\\test-backup\\【5】剑桥雅思真题5.pdf'."
      ],
      "BackendStatistics": {
        "RemoteCalls": 6,
        "BytesUploaded": 0,
        "BytesDownloaded": 0,
        "FilesUploaded": 0,
        "FilesDownloaded": 0,
        "FilesDeleted": 0,
        "FoldersCreated": 0,
        "RetryAttempts": 4,
        "UnknownFileSize": 0,
        "UnknownFileCount": 0,
        "KnownFileCount": 3,
        "KnownFileSize": 51521207,
        "LastBackupDate": "2020-11-02T14:36:55+08:00",
        "BackupListCount": 1,
        "TotalQuotaSpace": 1000203833344,
        "FreeQuotaSpace": 60720267264,
        "AssignedQuotaSpace": -1,
        "ReportedQuotaError": false,
        "ReportedQuotaWarning": false,
        "MainOperation": "Restore",
        "ParsedResult": "Success",
        "Version": "2.0.5.1 (2.0.5.1_beta_2020-01-18)",
        "EndTime": "0001-01-01T00:00:00",
        "BeginTime": "2020-11-02T08:41:13.6612302Z",
        "Duration": "00:00:00",
        "MessagesActualLength": 0,
        "WarningsActualLength": 0,
        "ErrorsActualLength": 0,
        "Messages": null,
        "Warnings": null,
        "Errors": null
      }
    }
    
  2. If just one file is selected to restore and the source folder is moved or renamed, the file can’t be restored and errors such as below are reported:

    2020-11-02 16:41:54 +08 - [Error-Duplicati.Library.Main.Operation.RestoreHandler-PatchingFailed]: Failed to patch with remote file: "duplicati-b0c61469407564d3588544e9f1e13423a.dblock.zip.aes", message: Failed to decrypt data (invalid passphrase?): Invalid password or corrupted data
    2020-11-02 16:41:54 +08 - [Error-Duplicati.Library.Main.Operation.RestoreHandler-RestoreFileFailed]: Could not find a part of the path 'D:\test-backup\【5】剑桥雅思真题5.pdf'.
    

    Complete log:

    {
      "RestoredFiles": 0,
      "SizeOfRestoredFiles": 0,
      "RestoredFolders": 0,
      "RestoredSymlinks": 0,
      "PatchedFiles": 0,
      "DeletedFiles": 0,
      "DeletedFolders": 0,
      "DeletedSymlinks": 0,
      "MainOperation": "Restore",
      "RecreateDatabaseResults": null,
      "ParsedResult": "Error",
      "Version": "2.0.5.1 (2.0.5.1_beta_2020-01-18)",
      "EndTime": "2020-11-02T08:41:54.7965139Z",
      "BeginTime": "2020-11-02T08:41:13.6612302Z",
      "Duration": "00:00:41.1352837",
      "MessagesActualLength": 16,
      "WarningsActualLength": 0,
      "ErrorsActualLength": 2,
      "Messages": [
        "2020-11-02 16:41:13 +08 - [Information-Duplicati.Library.Main.Controller-StartingOperation]: The operation Restore has started",
        "2020-11-02 16:41:13 +08 - [Information-Duplicati.Library.Main.BasicResults-BackendEvent]: Backend event: List - Started:  ()",
        "2020-11-02 16:41:13 +08 - [Information-Duplicati.Library.Main.BasicResults-BackendEvent]: Backend event: List - Completed:  (3 bytes)",
        "2020-11-02 16:41:13 +08 - [Information-Duplicati.Library.Main.Database.LocalRestoreDatabase-SearchingBackup]: Searching backup 0 (11/2/2020 6:36:55) ...",
        "2020-11-02 16:41:13 +08 - [Information-Duplicati.Library.Main.Operation.RestoreHandler-RemoteFileCount]: 1 remote files are required to restore",
        "2020-11-02 16:41:13 +08 - [Information-Duplicati.Library.Main.BasicResults-BackendEvent]: Backend event: Get - Started: duplicati-b0c61469407564d3588544e9f1e13423a.dblock.zip.aes (49.10 MB)",
        "2020-11-02 16:41:13 +08 - [Information-Duplicati.Library.Main.BasicResults-BackendEvent]: Backend event: Get - Retrying: duplicati-b0c61469407564d3588544e9f1e13423a.dblock.zip.aes (49.10 MB)",
        "2020-11-02 16:41:23 +08 - [Information-Duplicati.Library.Main.BasicResults-BackendEvent]: Backend event: Get - Started: duplicati-b0c61469407564d3588544e9f1e13423a.dblock.zip.aes (49.10 MB)",
        "2020-11-02 16:41:24 +08 - [Information-Duplicati.Library.Main.BasicResults-BackendEvent]: Backend event: Get - Retrying: duplicati-b0c61469407564d3588544e9f1e13423a.dblock.zip.aes (49.10 MB)",
        "2020-11-02 16:41:34 +08 - [Information-Duplicati.Library.Main.BasicResults-BackendEvent]: Backend event: Get - Started: duplicati-b0c61469407564d3588544e9f1e13423a.dblock.zip.aes (49.10 MB)",
        "2020-11-02 16:41:34 +08 - [Information-Duplicati.Library.Main.BasicResults-BackendEvent]: Backend event: Get - Retrying: duplicati-b0c61469407564d3588544e9f1e13423a.dblock.zip.aes (49.10 MB)",
        "2020-11-02 16:41:44 +08 - [Information-Duplicati.Library.Main.BasicResults-BackendEvent]: Backend event: Get - Started: duplicati-b0c61469407564d3588544e9f1e13423a.dblock.zip.aes (49.10 MB)",
        "2020-11-02 16:41:44 +08 - [Information-Duplicati.Library.Main.BasicResults-BackendEvent]: Backend event: Get - Retrying: duplicati-b0c61469407564d3588544e9f1e13423a.dblock.zip.aes (49.10 MB)",
        "2020-11-02 16:41:54 +08 - [Information-Duplicati.Library.Main.BasicResults-BackendEvent]: Backend event: Get - Started: duplicati-b0c61469407564d3588544e9f1e13423a.dblock.zip.aes (49.10 MB)",
        "2020-11-02 16:41:54 +08 - [Information-Duplicati.Library.Main.BasicResults-BackendEvent]: Backend event: Get - Failed: duplicati-b0c61469407564d3588544e9f1e13423a.dblock.zip.aes (49.10 MB)",
        "2020-11-02 16:41:54 +08 - [Information-Duplicati.Library.Main.Operation.RestoreHandler-RestoreFailures]: Failed to restore 1 files, additionally the following files failed to download, which may be the cause:\r\nduplicati-b0c61469407564d3588544e9f1e13423a.dblock.zip.aes"
      ],
      "Warnings": [],
      "Errors": [
        "2020-11-02 16:41:54 +08 - [Error-Duplicati.Library.Main.Operation.RestoreHandler-PatchingFailed]: Failed to patch with remote file: \"duplicati-b0c61469407564d3588544e9f1e13423a.dblock.zip.aes\", message: Failed to decrypt data (invalid passphrase?): Invalid password or corrupted data",
        "2020-11-02 16:41:54 +08 - [Error-Duplicati.Library.Main.Operation.RestoreHandler-RestoreFileFailed]: Could not find a part of the path 'D:\\test-backup\\【5】剑桥雅思真题5.pdf'."
      ],
      "BackendStatistics": {
        "RemoteCalls": 6,
        "BytesUploaded": 0,
        "BytesDownloaded": 0,
        "FilesUploaded": 0,
        "FilesDownloaded": 0,
        "FilesDeleted": 0,
        "FoldersCreated": 0,
        "RetryAttempts": 4,
        "UnknownFileSize": 0,
        "UnknownFileCount": 0,
        "KnownFileCount": 3,
        "KnownFileSize": 51521207,
        "LastBackupDate": "2020-11-02T14:36:55+08:00",
        "BackupListCount": 1,
        "TotalQuotaSpace": 1000203833344,
        "FreeQuotaSpace": 60720267264,
        "AssignedQuotaSpace": -1,
        "ReportedQuotaError": false,
        "ReportedQuotaWarning": false,
        "MainOperation": "Restore",
        "ParsedResult": "Success",
        "Version": "2.0.5.1 (2.0.5.1_beta_2020-01-18)",
        "EndTime": "0001-01-01T00:00:00",
        "BeginTime": "2020-11-02T08:41:13.6612302Z",
        "Duration": "00:00:00",
        "MessagesActualLength": 0,
        "WarningsActualLength": 0,
        "ErrorsActualLength": 0,
        "Messages": null,
        "Warnings": null,
        "Errors": null
      }
    }
    

It seems to me that Duplicati is just trying to restore the files from the source folder instead of the backup folder. What’s the reason that it can’t download a file from a USB-connected hard drive? How can I solve this problem? I’ve cross-checked the passphrase to make sure it’s correct, but even if it’s restored from the existing job where no passphrase input is involved, the errors would still show up.

This is probably with relation to the GUI interface because running in command line works just fine. For example, to restore a file to the original location:

"D:\programs\Duplicati 2\Duplicati.CommandLine.exe" restore "file://F:\test-backup" "<file>" --encryption-module=aes --compression-module=zip --dblock-size=50mb --passphrase="<passphrase>" --disable-module=console-password-input

To restore from b2 (see The RESTORE command and B2 Cloud Storage):

"D:\programs\Duplicati 2\Duplicati.CommandLine.exe" restore "b2://<bucket>/<folder>" "<file>" --b2-accountid="<accountId>" --b2-applicationkey="<applicationKey>" --encryption-module=aes --compression-module=zip --dblock-size=50mb --passphrase="<passphrase>" --disable-module=console-password-input

Note that there should be no spaces before and after the = sign such as --b2-accountid = "foo", because spaces are shell delimiters. You would see the error message if there are spaces:

ErrorID: B2MissingUserID
No "B2 Cloud Storage Account ID" given