Broken GPG_OPTS in duply 2.5.2 under macOS Sonoma
Brought to you by:
edso
Hi! The macOS version 2.5.2 of duply installed via homebrew under macOS Sonoma 14.2.1 on a macBook Air (M1) IMHO does not pass the "GPG_OPTS" specified in the "conf" file correctly to duplicity.
My entry under GPG_OPTS in the conf-file "/.duply/my.repository/conf":
(...)
GPG_OPTS='--cipher-algo CAMELLIA256 --pinentry-mode loopback --compress-algo bzip2 --compress-level 9 --bzip2-compress-level 9'
(...)
results in the following error when running "duply my.repository backup" under the macOS terminal:
CommandLineError: Option '--cipher-algo CAMELLIA256 --pinentry-mode loopback --compress-algo bzip2 --compress-level 9 --bzip2-compress-level 9' is not a valid option for command 'backup'.
Options valid for command 'backup' are:
--allow-source-mismatch --archive-dir --asynchronous-upload
--azure-blob-tier --azure-max-block-size --azure-max-connections
--azure-max-single-put-size --b2-hide-files --backend-retry-delay
--cf-backend --compare-data --config-dir --copy-blocksize --copy-links
--current-time --dry-run --encrypt-key --encrypt-secret-keyring
--encrypt-sign-key --exclude --exclude-device-files --exclude-filelist
--exclude-if-present --exclude-older-than --exclude-other-filesystems
--exclude-regexp --fail-on-volume --file-changed --file-prefix
--file-prefix-archive --file-prefix-jsonstat --file-prefix-manifest
--file-prefix-signature --files-from --filter-globbing
--filter-ignorecase --filter-literal --filter-regexp
--filter-strictcase --force --ftp-passive --ftp-regular
--full-if-older-than --gpg-binary --gpg-options --hidden-encrypt-key
--idr-fakeroot --ignore-errors --imap-full-address --imap-mailbox
--include --include-filelist --include-regexp --jsonstat --log-fd
--log-file --log-timestamp --max-blocksize --metadata-sync-mode
--mf-purge --mp-segment-size --name --no-compression --no-encryption
--no-files-changed --no-print-statistics --no-restore-ownership
--null-separator --num-retries --numeric-owner --par2-options
--par2-redundancy --par2-volumes --path-to-restore --progress
--progress-rate --pydevd --rename --restore-time --rsync-options
--s3-endpoint-url --s3-kms-grant --s3-kms-key-id
--s3-multipart-chunk-size --s3-mul5tipart-max-procs --s3-region-name
--s3-unencrypted-connection --s3-use-deep-archive --s3-use-glacier
--s3-use-glacier-ir --s3-use-ia --s3-use-onezone-ia --s3-use-rrs
--s3-use-server-side-encryption --s3-use-server-side-kms-encryption
--scp-command --sftp-command --show-changes-in-set --sign-key
--skip-if-no-change --skip-volume --ssh-askpass --ssh-options
--ssl-cacert-file --ssl-cacert-path --ssl-no-check-certificate
--swift-storage-policy --tempdir --time-separator --timeout
--use-agent --verbosity --version --volsize --webdav-headers
See man page for more information.
Enter 'duplicity --help' for help screen.
2024-01-21 09:52:05.000 Task 'BKP' failed with exit code '23'.
--- Finished state FAILED 'code 23' at 2024-01-21 09:52:05.000 - Runtime 00:00:00.000 ---
Without "GPG_OPTS"-entry everything runs smooth. Therefore I think that the parser does not process the "GPG_OPTS"-line correctly and does not add the prefix "--gpg-options" when running duplicity. Can you please check/investigate or give a hint how to fix GPG_OPTS? Thank you!
Best regards!
Ralf
moin Ralf,
please run duply backup command with parameter
--previewand the offending GPG_OPTS enabled. post the complete output here after. i need versions outputs as well.thanks.. ede
Last edit: ede 2024-01-21
moin ede
wow - thank you for the fast reply! Here is the requested output (I have replaced only PGP-key-id and passphrase with generics):
Hopefully it will help in your investigation. Thank you!
Best regards
Ralf
hey Ralf,
the command line generated by duply is fine. i verified that duplicity is at fault here. i opened a ticket in that regard https://gitlab.com/duplicity/duplicity/-/issues/795 .
consider downgrading duplicity, if the option is important to you or wait for the fix :)
will close this as invalid as duply is working as expected. ..sunny regards ede
moin ede
thank you for your help and your investigations. I will try your suggestion with downgrading...
Hi, I have the same issue on Linux:
duply --version
duply version 2.5.2
(https://duply.net)
Using installed duplicity version 2.2.3, python 3.11.9 (/usr/bin/python3.11) 'PYTHONPATH=:/usr/lib64/python311.zip:/usr/lib64/python3.11:/usr/lib64/python3.11/lib-dynload:/usr/lib64/python3.11/site-packages:/usr/lib64/python3.11/site-packages/PIL:/usr/lib64/python3.11/_import_failed:/usr/lib/python3.11/site-packages', gpg 2.4.5 (Home: /root/.gnupg), awk 'GNU Awk 5.3.0, API 4.0, PMA Avon 8-g1, (GNU MPFR 4.2.1, GNU MP 6.3.0)', grep 'grep (GNU grep) 3.11', bash '5.2.26(1)-release (x86_64-suse-linux)'.
I triied the duplicity suggestion using the '=' sign when defining options, by changing duply conf file line as follows:
GPG_OPTS="--pinentry-mode=loopback" # Needed to work from cron
But running
duply my-backup-all-profile backup --allow-source-mismatch
Results in error which includes this line:
CommandLineError: argument --gpg-options: expected one argument
Is downgrading duplicity still the only option, and if so, would you be able to suggest duplicity version which should not have this issue? I reviewed duplicity issues around this, and it is not clear which version to use. Sorry for the long message, and thanks.
hey Milan,
turns out that the new command line parser used by duplicity is at fault and even worse that it will probably not be fixed as it was designed that way intentionally.
good news for you though. since quite some time
--pinentry-mode=loopbackis not needed anymore as duplicity will set it itself if needed. so no need for duply to provide it anymore. PROBLEMSOLVED :) at least for you.will need to patch up duply. as a permanent fix (some) option values given to duplicity will need the equal sign bound syntax e.g.
--option=valueinstead of the classic--option value.WORKAROUND for now. if you really need to provide parameters to gpg disable
#GPGOPTSand add them in the end by appendingDUPL_PARAMS=(NOTE the--gpg-options='...') e.g.DUPL_PARAMS="$DUPL_PARAMS --gpg-options='--compress-algo=bzip2 --bzip2-compress-level=9'"Last edit: ede 2024-05-08
can you guys please test if the new devel version fixes the issue for you?
https://duply.net/tmp/duply.sh
should be fixed in v2.5.3 . released now.