Menu

#141 duplicity complains about GPG_OPTS for status command

duply
closed-fixed
nobody
None
5
2024-07-10
2024-02-29
FiLiS
No

It seems, some arguments don't play well with duplicity anymore.
When using

GPG_OPTS='--pinentry-mode=loopback --compress-algo=bzip2 --bzip2-compress-level=9'

in your conf file, but duplicity throws an error when running duply foo status now:

duplicity.cli_util.CommandLineError: Option '--pinentry-mode' is not a valid option for command 'collection-status'.

removing the first parameter gets you

CommandLineError: Option '--compress-algo' is not a valid option for command 'collection-status'.

This is running duply 2.5.1 and duplicity 2.2.2, both installed on FreeBSD as package.
Is this a duply or a duplicity issue?
The --pinentry-mode=loopback is a workaround for some GPG problem in GnuPG 2.1+, I don't know if it can be left out, both duply foo status and duply foo backup work without it, it seems.

Discussion

  • ede

    ede - 2024-02-29

    this is the same duplicity issue as https://sourceforge.net/p/ftplicity/bugs/140/ which is according to the duplicity changelog fixed in v2.2.0

    are you sure that you are running duplicity 2.2.2 ? can you post the complete output with versions and all?

    feel free to post to the duplicity ticket wrt. the underlying issue https://gitlab.com/duplicity/duplicity/-/issues/795

     
  • Nuno Teixeira

    Nuno Teixeira - 2024-03-01

    2.2.2 man page says related to --pinentry-mode:

    NOTE: Contrary to previous versions of duplicity, this option
    will also be honored by GnuPG 2 and newer versions. If GnuPG 2
    is in use, duplicity passes the option --pinentry-mode=loopback
    to the the gpg process unless --use-agent is specified on the
    duplicity command line. This has the effect that GnuPG 2 uses
    the agent only if --use-agent is given, just like GnuPG 1.
    

    Does it make sense about using this option and error msg:
    duplicity.cli_util.CommandLineError: Option '--pinentry-mode' is not a valid option for command 'collection-status'.

     
  • ede

    ede - 2024-03-01

    no Nuno,

    it's a bug in duplicity not accepting some --name value pairs separated by space anymore. the alternative --name=value still works. please read the ticket https://gitlab.com/duplicity/duplicity/-/issues/795

    what confuses me is that the error is supposed to be fixed in duplicity.

    but furthermore, wrt. "--pinentry-mode" , this does indeed not need be set anymore as duplicity will do that automagically since some time. need to clean that from the conf template, will do :)

     

    Last edit: ede 2024-03-01
  • Filias

    Filias - 2024-04-03

    running duply with bash -x shows that it generates the following command:

    ++ duplicity collection-status --archive-dir /var/.duply-cache --name duply_backup --encrypt-key XXXXX --encrypt-key XXXXX --sign-key XXXXX --gpg-options '--pinentry-mode=loopback --compress-algo=bzip2 --bzip2-compress-level=9' --full-if-older-than 1W sftp://user@backup.example.com
    

    According to https://gitlab.com/duplicity/duplicity/-/issues/795 the easy fix would be to use --gpg-options='$GPG_OPTS' instead of --gpg-options '$GPG_OPTS' because it seems the error is still persistent.

    For reference, my versions:

    Start duply v2.5.1, time is 2024-04-03 11:06:54.
    Using profile '/root/.duply/host'.
    Using installed duplicity version 2.2.2, python 3.9.18 (/usr/local/bin/python3.9) 'PYTHONPATH=:/usr/local/lib/python39.zip:/usr/local/lib/python3.9:/usr/local/lib/python3.9/lib-dynload:/usr/local/lib/python3.9/site-packages', gpg 2.4.4 (Home: /root/.gnupg), awk 'awk version 20210215', grep 'grep (BSD grep, GNU compatible) 2.6.0-FreeBSD', bash '5.2.26(1)-release (amd64-portbld-freebsd13.2)'.
    

    I'll update the duplicity ticket, too.

     
  • ede

    ede - 2024-04-03

    you are totally right. but seeing it as a rarely used option , --pinentry-mode=loopback is set by duplicity these days, i'll prefer to have upstream fix the issue properly.

    as a workaround you probably may comment #GPG_OPTS=... and add the "working" --gpg-options='--compress-algo=bzip2 --bzip2-compress-level=9' to latest conf entry DUPL_PARAMS=...

    if i find time i might have a look at it at the duplicity issue but can't promise anything. life's keeping me busy just now.

     

    Last edit: ede 2024-04-03
  • Filias

    Filias - 2024-04-03

    OK, the workaround does work, but requires me to set GPG_TEST='disabled', because otherwise the calls to gpg wont get the neccessary GPG_OPTS set, it seems.

    Thanks for yourhelp!

     
  • ede

    ede - 2024-04-03

    i see. while duplicity internally sets --pinentry-mode=loopback duply for the tests does not. i wonder why i never stumbled over that.

     
  • ede

    ede - 2024-05-08

    posted a WORKAROUND here https://sourceforge.net/p/ftplicity/bugs/140/#3138.
    working on a fix.

     
  • ede

    ede - 2024-06-29

    can you guys please test if the new devel version fixes the issue for you?

    https://duply.net/tmp/duply.sh

     
  • ede

    ede - 2024-07-10
    • status: open --> closed-fixed
     
  • ede

    ede - 2024-07-10

    should be fixed in v2.5.3 . released now.

     
  • Filias

    Filias - 2024-07-10

    Thanks! I'll report back if things don't work as expected.

     

Log in to post a comment.

MongoDB Logo MongoDB