keybase-issues icon indicating copy to clipboard operation
keybase-issues copied to clipboard

gpg: signing failed: Inappropriate ioctl for device

Open yveoch opened this issue 7 years ago β€’ 112 comments

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

yveoch avatar Feb 02 '17 21:02 yveoch

I cannot tell you how grateful I am to you!

diego898 avatar Nov 01 '17 17:11 diego898

@dryvenn You are a life saver! THX!

cfig avatar Dec 08 '17 07:12 cfig

You're a saviour! Helped me on Fedora.

dminca avatar Jan 31 '18 13:01 dminca

really thanks a lot

danduk82 avatar Feb 07 '18 13:02 danduk82

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

Thank you so so much!!!

boltzjf avatar Feb 09 '18 01:02 boltzjf

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

kenvac avatar Feb 13 '18 23:02 kenvac

helped me a lot also! thank you

Turini avatar Mar 15 '18 14:03 Turini

Cheers!.

TheOpenDevProject avatar Mar 24 '18 05:03 TheOpenDevProject

You're truly rockstar man! πŸ₯‡ Thanks!

tejasmob avatar May 01 '18 10:05 tejasmob

Amazing really thanks a lot

ivy-dong avatar May 04 '18 08:05 ivy-dong

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.

abhi-jha avatar May 04 '18 20:05 abhi-jha

works inside a docker container Deian stretch both host and container

netsafe avatar May 07 '18 04:05 netsafe

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?

hlzhang avatar Jun 11 '18 17:06 hlzhang

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

jamesdbloom avatar Jun 20 '18 22:06 jamesdbloom

@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

netsafe avatar Jun 21 '18 17:06 netsafe

@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

hlzhang avatar Jul 11 '18 08:07 hlzhang

worked for me on Ubuntu 18... thanks

rootVIII avatar Sep 17 '18 13:09 rootVIII

I cannot thank you enough! ❀️ Hours were lost debugging this πŸ™ˆ

svenluijten avatar Oct 10 '18 19:10 svenluijten

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.

maxtaco avatar Oct 11 '18 00:10 maxtaco

It also works on OSX using zsh. Thanks!

josefigueroa-nedap avatar Oct 29 '18 10:10 josefigueroa-nedap

@dryvenn nice, works on nixos.

dmjio avatar Nov 25 '18 21:11 dmjio

It works! Thank you so much!

dadiyang avatar Dec 02 '18 07:12 dadiyang

@dryvenn thank you, works on ubuntu subsystem.

zsh support

jamalkaksouri avatar Feb 21 '19 14:02 jamalkaksouri

Thank you!

teddybear avatar Feb 26 '19 06:02 teddybear

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

stevenchen3 avatar Feb 27 '19 04:02 stevenchen3

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!

ghost avatar Mar 30 '19 17:03 ghost

You saved my life and my semester :')

fgvenegas avatar May 21 '19 02:05 fgvenegas

Thanks a lot @dryvenn πŸ‘

Bryan-Cee avatar May 21 '19 11:05 Bryan-Cee

πŸ‘Nice find!

akhilesharora avatar May 29 '19 12:05 akhilesharora

Couldn't thank you enough!! Scratching my head since 2 hours trying to understand what is happening!

MahikanthNag avatar May 30 '19 23:05 MahikanthNag