41

When decrypting I get following error:

$ eyaml decrypt -s 'ENC and the key goes on here'
.gnupg --quiet --no-secmem-warning --no-permission-warning --no-tty --yes --decrypt)
failed with: gpg: Sorry, no terminal at all requested - can't get input

I have checked my keys, everything is in order. At this point I am out of options.

vhs
  • 9,316
  • 3
  • 66
  • 70
roger moore
  • 541
  • 1
  • 5
  • 6
  • Can you reproduce the issue with a simpler command and update the question? I got the same error with a simple `gpg --edit-key ` which was resolved by Josh Habdas' answer. – bschlueter Jul 16 '19 at 17:13

4 Answers4

64

If you configured Automatic Git commit signing with GPG on macOS and you see this error comment out no-tty in ~/.gnupg/gpg.conf as suggested by Fahl-Design.

enter image description here

This will also allow you to generate new GPG keys following the GitHub instructions for new keys.

vhs
  • 9,316
  • 3
  • 66
  • 70
19

You need to remove the option --no-tty

--no-tty
Make sure that the TTY (terminal) is never used for any output. This option is needed in some cases because GnuPG sometimes prints warnings to the TTY even if --batch is used.

oden
  • 3,461
  • 1
  • 31
  • 33
7

For those who are encountering this error from scripts that are running with no TTY available, adding --batch to the GPG command line, or batch to a line in ~/.gnupg/gpg.conf can make the problem go away.

Throw Away Account
  • 2,593
  • 18
  • 21
  • This helps for me to open – Pradap Pandian Jan 11 '22 at 14:32
  • This helped me, but a more permanent and global solution would be to follow @JamalMcCrackin suggestion in a note to oden's answer: to edit your ~/.gnupg/gpg.conf by deleting your no-tty seting in case you have it there. – pilgix Feb 18 '23 at 04:03
0

I had to update my git email so that it matched the email on my gpg key and the primary email on my Github.

$ git config --global user.email "myemailaddress@gmail.com"
Amber
  • 21
  • 4