32

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
  • 7,906
  • 2
  • 61
  • 66
roger moore
  • 451
  • 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

52

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
  • 7,906
  • 2
  • 61
  • 66
15

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,266
  • 1
  • 29
  • 31
  • 6
    if someone else finds this question/answer with other gpg commands check your `~/.gnupg/gpg.conf` for the **no-tty** seting and disable it – JamalMcCrackin Jun 18 '18 at 23:04
  • 1
    @josh-habdas yes, your are right. But I found this question by the error message title and had "no-tty" in my config (to use singed git commits with phpstorm) – JamalMcCrackin Jul 04 '18 at 12:45
2

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,427
  • 13
  • 19
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