Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gpg: signing failed: Inappropriate ioctl for device #2798

Open
yveoch opened this issue Feb 2, 2017 · 127 comments
Open

gpg: signing failed: Inappropriate ioctl for device #2798

yveoch opened this issue Feb 2, 2017 · 127 comments

Comments

@yveoch
Copy link

yveoch commented Feb 2, 2017

When trying to use the bash+curl verifying method on a server, this cryptic error message might happen:

gpg: signing failed: Inappropriate ioctl for device

Since this is a fatal error and also quite difficult to debug, maybe the fix could be put somewhere (in the provided command line?):

export GPG_TTY=$(tty)

source

@diego898
Copy link

diego898 commented Nov 1, 2017

I cannot tell you how grateful I am to you!

@cfig
Copy link

cfig commented Dec 8, 2017

@dryvenn You are a life saver! THX!

@dminca
Copy link

dminca commented Jan 31, 2018

You're a saviour! Helped me on Fedora.

@danduk82
Copy link

danduk82 commented Feb 7, 2018

really thanks a lot

@boltzjf
Copy link

boltzjf commented Feb 9, 2018

Wow, you are so cool, helped me a lot!

Thank you so so much!!!

@kenvac
Copy link

kenvac commented Feb 13, 2018

Thanks a tonne man!!. Helped me on debian 9.

@Turini
Copy link

Turini commented Mar 15, 2018

helped me a lot also! thank you

zanshin added a commit to zanshin/dotfiles that referenced this issue Mar 15, 2018
GPG_TTY needs to be set to the value in tty ($(tty)) in order for GPG to
work properly with mutt. keybase/keybase-issues#2798
@TheOpenDevProject
Copy link

Cheers!.

@tejasmob
Copy link

tejasmob commented May 1, 2018

You're truly rockstar man! 🥇
Thanks!

@ivy-dong
Copy link

ivy-dong commented May 4, 2018

Amazing
really thanks a lot

@abhi-jha
Copy link

abhi-jha commented May 4, 2018

Oh wow. And I was pulling my hair that my key has expired which it definitely didn't. I don't know why I was thinking its 2019 for some reason. Thank you.

@netsafe
Copy link

netsafe commented May 7, 2018

works inside a docker container Deian stretch both host and container

@hlzhang
Copy link

hlzhang commented Jun 11, 2018

Sadly, no tty on travis-ci or appveyor.
GPG 2.1.11 comes with ubuntu 16.04 throw out a invalid error if I add 'pinentry-mode loopback' into ~/.gnupg/gpg.conf.
Various versions of gpg wasted lot of my time and I think it is a piece of shit, they don't test it on different environments?

@jamesdbloom
Copy link

This doesn't work for me because when I add that setting GPG doesn't sign some artefacts properly anymore.

@netsafe
Copy link

netsafe commented Jun 21, 2018

@chshawkn Travis-CI - in my opinion - is a very questionable CI solution... Call me classy, but I'm still using Jenkins and it never ever failed me regardless of the task and environment I used. With Windows slave all the problems were gone when I used WinSSHD - just write your scripts properly and have fun

@hlzhang
Copy link

hlzhang commented Jul 11, 2018

@netsafe Thanks for your advice. I use Gitlab CI/CD and Jenkins on private projects. Travis-CI is for public repositories.

I've solved the GPG issues on Gitlab CI/CD, Travis-CI and AppVeyor, one script works on all CI platforms.

see: https://github.com/ci-and-cd/maven-build/blob/develop/src/main/ci-script/lib_ci.sh#L702

@rootVIII
Copy link

worked for me on Ubuntu 18... thanks

@svenluijten
Copy link

I cannot thank you enough! ❤️ Hours were lost debugging this 🙈

@maxtaco
Copy link
Contributor

maxtaco commented Oct 11, 2018

Wow, can't believe how many thumbs this issue has. I had a half a mind to update the website to fill in GPG_TTY=$(tty) as suggested in this issue, but that only works in bash, and the current command line seems to work in tcsh too. Looks like we need a flow here to: (1) have users select their shell; and (2) to give you the right command to setenv given the shell. I guess alternatively we can always run bash -c 'lots of commands | other commands', but we'd need another level of quoting.

@josefigueroa-nedap
Copy link

It also works on OSX using zsh. Thanks!

@dmjio
Copy link

dmjio commented Nov 25, 2018

@dryvenn nice, works on nixos.

@dadiyang
Copy link

dadiyang commented Dec 2, 2018

It works! Thank you so much!

@jamalkaksouri
Copy link

jamalkaksouri commented Feb 21, 2019

@dryvenn thank you, works on ubuntu subsystem.

zsh support

@teddybear
Copy link

Thank you!

@stevenchen3
Copy link

Kudos!!!! This saves me a lot of time. Appreciated.

@ghost
Copy link

ghost commented Mar 30, 2019

Thank you so much!

I had this problem where I had my user.signingKey set to the correct value in Git on Ubuntu 18.04 after following this tutorial, but I was still unable to sign commits. Every time I tried, I got this error:

error: gpg failed to sign the data
fatal: failed to write commit object

This fixed that right up. Thanks again!

@iiykeazu
Copy link

The GOAT

@TruncatedDinoSour
Copy link

The GOAT

image

@TruncatedDinoSour
Copy link

the CAT

box_cat

@FarmersWrap
Copy link

Thank you so much! Saved my ass.

mdb added a commit to mdb/dotfiles that referenced this issue Dec 9, 2023
@andremacdowell
Copy link

I really wasn't expecting that this would solve my problem, thanks!

@kowalks
Copy link

kowalks commented Feb 15, 2024

I think I've already gotten this error message like 12938901832 times before.

I keep debugging it for like 3 hours.

And always this issue post saves me.

You have saved our lives. We are eternally grateful.

unlsycn added a commit to unlsycn/.files that referenced this issue Feb 21, 2024
@neeels
Copy link

neeels commented Mar 1, 2024

This issue post has gained a meta level of helpfulness, an evergreen of uplift:
for years now, every now and then, we get heartwarming thank-you messages by surprise.
It's one of those small positive things that make my day.

Thanks everyone! <3

@rafay99-epic
Copy link

When trying to use the bash+curl verifying method on a server, this cryptic error message might happen:

gpg: signing failed: Inappropriate ioctl for device

Thank you so much...Life Saver

@EtherealEntity
Copy link

my saviour! :D

@Jacob-Stevens-Haas
Copy link

Suddenly, this doesn't seem to be working. I'm trying to get a copy of my GPG keys to my new laptop with:

ssh <user@server> gpg --export-secret-key <keyid> | gpg --import --batch

I've added the magic words to .profile, .bashrc, and .bash_profile in both user@server and locally, including restarting the terminal. Not sure what's going on.

@pransteter
Copy link

Man... you are absolutely an amazing savior. Awesome. Thank you so much!

@azharlihan
Copy link

Thanks @yveoch you save mee..

#2798 (comment)

@uratne
Copy link

uratne commented Jun 29, 2024

Thanks @yveoch worked for me

@rizlas
Copy link

rizlas commented Jul 1, 2024

2024 and still kicking! Thank you ❤️

@romayengineer
Copy link

thank you very much!

@yankikucuk
Copy link

real superhero.

@space7panda
Copy link

For lazy zsh users:

echo 'export GPG_TTY=$(tty)' >> ~/.zshrc

@josenriagu
Copy link

on MacOS, make sure you also have a pinentry program installed (if you have specified a passphrase when setting up your gpg key). You can do so (using homebrew as example);

brew install pinentry-mac
then
echo "pinentry-program $(which pinentry-mac)" >> ~/.gnupg/gpg-agent.conf
and finally
killall gpg-agent

Restart your terminal and voila!

As seen on Github Docs: Telling Git about your signing key

@owans
Copy link

owans commented Aug 19, 2024

Worked for me. Thank you @josenriagu

@ismailarilik
Copy link

Just a thought: This shouldn't be an issue nor a bug since the need to expose GPG_TTY=$(tty) is documented here: https://www.gnupg.org/documentation/manuals/gnupg/Invoking-GPG_002dAGENT.html

Of course, it can also be documented for keybase.

@FatDoge
Copy link

FatDoge commented Oct 15, 2024

It works!😋

@Dude29
Copy link

Dude29 commented Oct 16, 2024

Thank you for this! 🙏

@gscu
Copy link

gscu commented Oct 17, 2024

THANK YOU

CupapiOT referenced this issue in CupapiOT/my-neovim-config Oct 20, 2024
@red17electro
Copy link

red17electro commented Oct 25, 2024

on MacOS, make sure you also have a pinentry program installed (if you have specified a passphrase when setting up your gpg key). You can do so (using homebrew as example);

brew install pinentry-mac then echo "pinentry-program $(which pinentry-mac)" >> ~/.gnupg/gpg-agent.conf and finally killall gpg-agent

Restart your terminal and voila!

As seen on Github Docs: Telling Git about your signing key

Thanks, this worked for me 🙏🏻

@Asthriona
Copy link

When trying to use the bash+curl verifying method on a server, this cryptic error message might happen:

gpg: signing failed: Inappropriate ioctl for device

Since this is a fatal error and also quite difficult to debug, maybe the fix could be put somewhere (in the provided command line?):

export GPG_TTY=$(tty)

source

Much love! <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests