Discussion:
[Duplicity-talk] Problem with duply / gpg and docker - Not a tty
Peter Hase
2016-04-02 14:31:49 UTC
Permalink
Hi all,
I’ve tried to use duply instead of duplicity on my newly created docker image (https://github.com/Gymnae/docker-duplicity <https://github.com/Gymnae/docker-duplicity>) for backing up volumes and folders to s3 buckets.
The problems are more in-depth described here: http://stackoverflow.com/questions/36356924/not-a-tty-error-in-alpine-based-duplicity-image <http://stackoverflow.com/questions/36356924/not-a-tty-error-in-alpine-based-duplicity-image>

/ # duply koken backup -v9
Start duply v1.9.1, time is 2016-04-02 14:18:47.
Using profile '/home/duplicity/.duply/koken'.
Using installed duplicity version 0.7.05, python 2.7.11, gpg 2.1.10 (Home: ~/.gnupg), bash '4.3.42(1)-release (x86_64-alpine-linux-musl)'.
Autoset found secret key of first GPG_KEY entry ‘<mysecretkey>' for signing.
Checking TEMP_DIR '/tmp' is a folder (OK)
Checking TEMP_DIR '/tmp' is writable (OK)
TODO: reimplent tmp space check
Test - Encrypt to '<mysecretkey>' & Sign with '<mysecretkey>' (FAILED)

Sorry. A fatal ERROR occured:

Encryption failed (Code 2).
gpg: using "<mysecretkey>" as default secret key
[GNUPG:] PROGRESS need_entropy X 8 16
[GNUPG:] PROGRESS need_entropy X 16 16
[GNUPG:] BEGIN_SIGNING H8
[GNUPG:] PINENTRY_LAUNCHED 225
gpg: signing failed: Not a tty
[GNUPG:] BEGIN_ENCRYPTION 2 9
[GNUPG:] FAILURE sign-encrypt 83918950
gpg: /usr/bin/duply: sign+encrypt failed: Not a tty

Hint:
This error means that gpg is probably misconfigured or not working
correctly. The error message above should help to solve the problem.
However, if for some reason duply should misinterpret the situation you
can define GPG_TEST='disabled' in the conf file to bypass the test.
Please do not forget to report the bug in order to resolve the problem
in future versions of duply.

This is kind of the same problem, which I had with duplicity.
Something is keeping gpg from signing and encrypting the files - even decrypting does not work for incremental backups.
Something something tty. No clue what I can do


Any help it super welcome.
e***@web.de
2016-04-03 12:14:19 UTC
Permalink
Post by Peter Hase
Hi all,
I’ve tried to use duply instead of duplicity on my newly created docker image (https://github.com/Gymnae/docker-duplicity) for backing up volumes and folders to s3 buckets.
The problems are more in-depth described here: http://stackoverflow.com/questions/36356924/not-a-tty-error-in-alpine-based-duplicity-image
/ # duply koken backup -v9
Start duply v1.9.1, time is 2016-04-02 14:18:47.
Using profile '/home/duplicity/.duply/koken'.
Using installed duplicity version 0.7.05, python 2.7.11, gpg 2.1.10 (Home: ~/.gnupg), bash '4.3.42(1)-release (x86_64-alpine-linux-musl)'.
Autoset found secret key of first GPG_KEY entry ‘<mysecretkey>' for signing.
Checking TEMP_DIR '/tmp' is a folder (OK)
Checking TEMP_DIR '/tmp' is writable (OK)
TODO: reimplent tmp space check
Test - Encrypt to '<mysecretkey>' & Sign with '<mysecretkey>' (FAILED)
Encryption failed (Code 2).
gpg: using "<mysecretkey>" as default secret key
[GNUPG:] PROGRESS need_entropy X 8 16
[GNUPG:] PROGRESS need_entropy X 16 16
[GNUPG:] BEGIN_SIGNING H8
[GNUPG:] PINENTRY_LAUNCHED 225
gpg: signing failed: Not a tty
[GNUPG:] BEGIN_ENCRYPTION 2 9
[GNUPG:] FAILURE sign-encrypt 83918950
gpg: /usr/bin/duply: sign+encrypt failed: Not a tty
This error means that gpg is probably misconfigured or not working
correctly. The error message above should help to solve the problem.
However, if for some reason duply should misinterpret the situation you
can define GPG_TEST='disabled' in the conf file to bypass the test.
Please do not forget to report the bug in order to resolve the problem
in future versions of duply.
This is kind of the same problem, which I had with duplicity.
Something is keeping gpg from signing and encrypting the files - even decrypting does not work for incremental backups.
Something something tty. No clue what I can do…
Any help it super welcome.
do you provide a gpg passphrase for the key in your duplicity conf? it seems to be needed, but when run in cron there is no tty available to prompt you to put it in. that's the error you see.

if so, gpg 2.1 needs some extra setup to accept a passphrase piped into it. see here
https://sourceforge.net/p/ftplicity/bugs/76/#74c5

if you are using the latest duply, which is advised, you should find comments regarding the use of gpg 2.1 in the generated conf file.

alternatively use gpg-agent.

..ede

Loading...