GPG fails to sign commit, error : Inappropriate ioctl for device

I have tried the following -

  • Created new GPG key pair, added to gitconfig and then tried again to sign the commit.
  • Re-installed pinentry and its b-menu and d-menu prompter too. Did not work.
  • export GPG_TTY=$(tty) [did not restart for this one only]
  • Added loopbacking of pinentry
    ^ Restarted each time for the changes I did, nothing worked.

The solutions I have read but did not work -


Output of echo "test" | gpg --clearsign -

Hash: SHA256

gpg: signing failed: Inappropriate ioctl for device
gpg: [stdin]: clear-sign failed: Inappropriate ioctl for device

Did you end up finding a solution for this? I’m having the same issue after reinstalling, except on KDE.

No. I still haven’t got a solution for this yet.

You might need to configure your gpg-agent to use correct pinentry program. Archwiki has good instructions here

Add the line “pinentry-program /usr/bin/pinentry-qt” to the file “~/.gnupg/gpg-agent.conf” and run “gpg-connect-agent reloadagent /bye”