GPG encrypted backup failed using Duplicati GUI

Hello,

I am using Duplicati 2.0.4.23_beta_2019-07-14 on a Mac OS.

I am new to Duplicati and I am experimenting with AES and GPG encryptions. Using AES everything works fine, but when I try to use GPG the backup never works. I always get this errors:

2019-10-23 01:46:22 +02 - [Retry-Duplicati.Library.Main.Operation.Common.BackendHandler-RetryPut]: Operation Put with file duplicati-b5d61d53ff4f24ce5b7056ad2e988f7b0.dblock.zip.gpg attempt 4 of 5 failed with message: Failed to execute GPG at ““gpg” --batch --passphrase-fd 0 --symmetric”: ApplicationName=‘gpg’, CommandLine=’ --batch --passphrase-fd 0 --symmetric’, CurrentDirectory=’’, Native error= Cannot find the specified file
System.Exception: Failed to execute GPG at ““gpg” --batch --passphrase-fd 0 --symmetric”: ApplicationName=‘gpg’, CommandLine=’ --batch --passphrase-fd 0 --symmetric’, CurrentDirectory=’’, Native error= Cannot find the specified file —> System.ComponentModel.Win32Exception: ApplicationName=‘gpg’, CommandLine=’ --batch --passphrase-fd 0 --symmetric’, CurrentDirectory=’’, Native error= Cannot find the specified file

The thing that puzzles me the most is that I have exported the backup configuration as command line from the duplicati GUI. I have copied, then, the resulting command into a terminal command line and executed it and the backup worked perfectly. The gpg files are created and stored in the destination folders every time. I have tried with symmetric and asymmetric encryption on gpg with the same result. If I run it from the GUI, it fails. If I executed it as a command line, it works.

Any idea why would a backup executed from the GUI returned those errors and the same backup exported into a command line an executed from the terminal would work flawlessly? What would be the difference in the way Duplicati interacts with the gpg command from a backup run from the GUI and the same one executed from the command line?

I hope someone could cast some light on this issue. Many thanks!

Welcome to the forum @tinerrr

I don’t have macOS, so am not the ideal person to answer, but I wonder if your Duplicati GUI server was started as root with a different PATH than your personal login. Poking with ps can show you environment variables such as PATH, and which can be used to find your command line gpg. Is it on Duplicati PATH? “Cannot find the specified file” seems to imply no. launchctl might fix that, but the Internet has advice too.

Well, there you go. It seemed it was a permissions problem. I forced the GUI server to start as root and now it’s working. I have to dig a bit more to figure out what kind of permissions the server may need to do its job with the GPG command but so far you directed me into the right way to look.

Many thanks for your help.:+1:t3:

1 Like