keybase / keybase-issues

A single repo for managing publicly recognized issues with the keybase client, installer, and website.
900 stars 37 forks source link

gpg: signing failed: Inappropriate ioctl for device #2798

Open yveoch opened 7 years ago

yveoch commented 7 years ago

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 commented 7 years ago

I cannot tell you how grateful I am to you!

cfig commented 6 years ago

@dryvenn You are a life saver! THX!

dminca commented 6 years ago

You're a saviour! Helped me on Fedora.

danduk82 commented 6 years ago

really thanks a lot

boltzjf commented 6 years ago

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

Thank you so so much!!!

kenvac commented 6 years ago

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

Turini commented 6 years ago

helped me a lot also! thank you

TheOpenDevProject commented 6 years ago

Cheers!.

tejasmob commented 6 years ago

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

ivy-dong commented 6 years ago

Amazing really thanks a lot

abhi-jha commented 6 years ago

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 commented 6 years ago

works inside a docker container Deian stretch both host and container

hlzhang commented 6 years ago

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 commented 6 years ago

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

netsafe commented 6 years ago

@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 commented 6 years ago

@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 commented 6 years ago

worked for me on Ubuntu 18... thanks

svenluijten commented 6 years ago

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

maxtaco commented 6 years ago

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 commented 6 years ago

It also works on OSX using zsh. Thanks!

dmjio commented 6 years ago

@dryvenn nice, works on nixos.

dadiyang commented 5 years ago

It works! Thank you so much!

jamalkaksouri commented 5 years ago

@dryvenn thank you, works on ubuntu subsystem.

zsh support

teddybear commented 5 years ago

Thank you!

stevenchen3 commented 5 years ago

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

ghost commented 5 years ago

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!

fgvenegas commented 5 years ago

You saved my life and my semester :')

Bryan-Cee commented 5 years ago

Thanks a lot @dryvenn πŸ‘

akhilesharora commented 5 years ago

πŸ‘Nice find!

MahikanthNag commented 5 years ago

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

epsilon-0 commented 5 years ago

HOWW!!!???

Thanks a lot none the less.

c0un7-z3r0 commented 5 years ago

Thank you so much πŸ‘ @dryvenn

fazlearefin commented 5 years ago

Here's yet another solution for macOS

brew install pinentry-mac
echo "pinentry-program /usr/local/bin/pinentry-mac" >> ~/.gnupg/gpg-agent.conf
killall gpg-agent

# now test if it is working
echo "test" | gpg --clearsign

However, the original solution by @dryvenn by just sticking export GPG_TTY=$(tty) somewhere in your .bashrc or .zshrc is a much simpler solution and works on macOS as well.

sreekhar-ale commented 5 years ago

@fazlearefin It worked on mac osx for me. Thanks

teddyotieno commented 5 years ago

Awesome, thanks a bunch πŸ‘

r10s commented 5 years ago

works like a charm, thanx!

wanderingeek commented 5 years ago

You're a hero @dryvenn !

arg commented 5 years ago

Thank you! πŸ‘

no1453 commented 5 years ago

I recently had this same problem when verifying my website. The suggested solution worked, of course. It's been two and a half years since this issue was posted; I'm rather surprised there's been no resolution.

maxtaco commented 5 years ago

There's actually not much we can do here. We set this variable when we can, but sometimes, we can't possibly figure out the TTY.

no1453 commented 5 years ago

Ah, makes sense, thanks for the reply.

yamila-moreno commented 5 years ago

2 years and a half after the original issue, this is still useful. Thanks a lot @dryvenn

tcmhoang commented 5 years ago

You saved my time !!! Thanks

dieppa commented 5 years ago

this saved my day! Thanks man!

fincatto commented 5 years ago

Thank you!

rosmahajan commented 5 years ago

Awesome it worked in MacOS

ghost commented 4 years ago

Great, worked out for MacOs + zshell

Nicceboy commented 4 years ago

Worked in the Arch Linux and zshell :)

snowztail commented 4 years ago

Yay! Thank you sooooo much!

6a6f6a6f commented 4 years ago

You make me love WSL again, thanks!