shiftkey / desktop

Fork of GitHub Desktop to support various Linux distributions
MIT License
6.87k stars 521 forks source link

Commit fails with GPG signing: inappropriate ioctl for device #1045

Open tamas646 opened 7 months ago

tamas646 commented 7 months ago

The problem

When I try to make a commit with GPG signing the app shows a popup with the following error message:

gpg: signing failed: inappropriate ioctl for device

I made a research about this problem and tried switching the pinentry-program (in .gnupg/gpg-agent.conf) to some other and it produced the results below:

While none of them are working from github desktop, all of them are working fine if I call them from a terminal with the test code below:

echo test | gpg --clear-sign

I'm using the latest KDE plasma desktop under Arch linux.

Release version

3.3.12-linux2 (x64)

Operating system

Arch linux

Steps to reproduce the behavior

No response

Log files

No response

Screenshots

No response

Additional context

No response

shiftkey commented 7 months ago

While none of them are working from github desktop, all of them are working fine if I call them from a terminal with the test code below:

This is an interesting note, and I wonder if the environment variables is missing things depending on how you launch the app (e.g. using the system launcher). Does the behaviour change if you launch github-desktop from the terminal and then try this?

I ask because inappropriate ioctl for device gave me a similar hit for GPG signing failing https://github.com/keybase/keybase-issues/issues/2798 which mentions tty and GPG_TTY, and I wonder what settings you have in your shell profile that might not be available elsewhere...

tamas646 commented 7 months ago

Okay, I tried the following:

  1. Open terminal
  2. Run github-desktop and commit something -> not working: no pinentry/inappropriate ioctl for device
  3. Run echo test | gpg --clear-sign -> working fine: shows the pinentry popup window
  4. Run export GPG_TTY=$(tty)
  5. Run github-desktop and commit something -> not working: no pinentry/inappropriate ioctl for device
  6. Run echo test | gpg --clear-sign -> working fine: shows the pinentry popup window

So it seems that export GPG_TTY=$(tty) does not solve the problem for me. Also it turns out that running the app from the same shell profile - as where the test code works fine - does not affects the app's behavior.