Open Arcanemagus opened 6 years ago
I get the same 0x00000003 handle error. I also have gpg.program manually set.
It's been a while, but I believe gpg 2.2.x doesn't work with Atom's credential dialog because gpg has been deprecating the --passphrase-fd
option that we use to provide the entered passphrase. (I think it was 2.1 that gated it behind a non-default gpg-agent configuration option, and 2.2 ignored it entirely). The "real solution" here is to create an isolated GNUPGHOME with a dedicated gpg-agent process configured with a pinentry program that talks back to Atom through the named pipe we use for passwords elsewhere. This is what I was working toward with squeegpg, but alas that keeps being bumped for other priorities.
In the meantime, you'll likely have the best luck configuring your gpg-agent to use a graphical pinentry program. I got one automatically when I installed gpg4win - I'm not sure if they offer it as a stand-alone download, though.
In the meantime, you'll likely have the best luck configuring your gpg-agent to use a graphical pinentry program.
Just to note, steps 3-4 are to explicitly cancel exactly that so this can be reproduced 😆.
Oh! Right, I see that now.
Unfortunately I don't think I can distinguish an explicit cancellation of the native pinentry from a pinentry failure due to not being able to allocate a tty (which is the normal case we want to intercept). I think implementing a custom pinentry ourselves is still the path forward here.
Im confused with this report, this is nothing new and well known @smashwilson since https://github.com/atom/github/pull/846 and https://github.com/atom/github/issues/1373
You have to use the GPG pinentry because the built in one DOESNT work for yonks.
Or am I missing something?
Edit: Ive now left a trail of breadcrumbs related to this issue and picking on #814, past work #846 and current work into #1373 so anyone paying attention to that relation can goto in a jip.
Im confused with this report, this is nothing new and well known @smashwilson since #846 and #1373
This was mainly filed due to the stack trace not having been recorded yet @the-j0k3r 😉.
Edit: Ive now left a trail of breadcrumbs related to this issue and picking on #814
If you read the additional information section I actually already said that this is probably the same issue at the core as #814, but as it's a different platform and different stack trace it's not actually the same issue.
Thanks for linking everything together!
This was mainly filed due to the stack trace not having been recorded yet @the-j0k3r wink.
who knows the other issues I quoted are closed, so maybe just like you said.
If you read the additional information section I actually already said that this is probably the same issue at the core as #814, but as it's a different platform and different stack trace it's not actually the same issue.
Thanks for linking everything together!
Yes ;) this is one of those instances where the right kind of bot would probably do same job, sadly the only bot I know that checks for duplicates and such things still requires human interaction by someone with access to trigger it, that said, Im happy to do such linking once in a while in issues that interest me/affect me once in a while.
I thinks its helpful so you're welcome and thanks :)
Well, thought I'd throw my hat into the "GPG not working with commits" ring here. Since there are a number of these issues I decided not to open yet another one, even though my issue is slightly different so stack trace error also differs. Of course, if you want me to open another one, I will. :smile:
Windows 10 v1809 Home. I never got the pinentry from an outside GPG program, just the internal Atom one. Not until I changed git config --global gpg.program
from C:/Program Files/Git/usr/bin/gpg.exe
to C:/Program Files (x86)/GnuPG/bin/gpg.exe
. Then I got the GPG4Win pinentry and it actually worked. But Atom's pinentry doesn't.
What happens with Git for Windows as the git config --global gpg.program C:/Program Files/Git/usr/bin/gpg.exe
is that the pinentry works with other Git Clients, like GitHub Desktop, but in Atom I get the internal Atom pinentry, which refuses to work. Atom knew my Git GPG key so it must have read from the Git for Windows GPG and not GPG4Win as that one didn't have my keys imported (did that later). I tried adding each gpg pinentry program (Git for Windows and GPG4Win) into gpg-agent.conf via pinentry-program path\program.exe
with no difference in results (although, maybe I did something wrong with this setting). See below for trace output with Git for Windows git config --global gpg.program
used, Git Diagnostics enabled and the internal Atom pinentry used.
Unable to commit
00:06:56.691068 exec-cmd.c:236 trace: resolved executable dir: C:/Users/ME/AppData/Local/atom/app-1.45.0/resources/app.asar.unpacked/node_modules/dugite/git/mingw64/bin
00:06:56.694066 git.c:415 trace: built-in: git commit --cleanup=verbatim -m 'Will GPG work with Atom?'
00:06:56.701067 run-command.c:643 trace: run_command: 'C:\Users\ME\AppData\Local\Temp\github-2020327-112024-17hexop.ljrd\gpg-wrapper.sh' -bsau THIS-IS-MY-KEY
00:06:56.882958 exec-cmd.c:236 trace: resolved executable dir: C:/Users/ME/AppData/Local/atom/app-1.45.0/resources/app.asar.unpacked/node_modules/dugite/git/mingw64/bin
00:06:56.884957 git.c:415 trace: built-in: git config gpg.program
00:06:57.099818 exec-cmd.c:236 trace: resolved executable dir: C:/Users/ME/AppData/Local/atom/app-1.45.0/resources/app.asar.unpacked/node_modules/dugite/git/mingw64/bin
00:06:57.100818 git.c:415 trace: built-in: git config user.signingkey
git-askpass-atom: no user askpass specified
git-askpass-atom: requesting dialog through Atom socket
git-askpass-atom: prompt = "Please enter the passphrase for the GPG key 'THIS-IS-MY-KEY'."
git-askpass-atom: connection established
git-askpass-atom: writing query
git-askpass-atom: query written
git-askpass-atom: Atom socket stream terminated
git-askpass-atom: Atom reply parsed
git-askpass-atom: success
gpg: WARNING: no command supplied. Trying to guess what you mean ...
gpg: no valid OpenPGP data found.
gpg: processing message failed: Unknown system error
error: gpg failed to sign the data
fatal: failed to write commit object
Same here. Both of the IntelliJ based editors I use (Android Studio and IDEA) use the normal gpg4win dialog, while Atom uses its own thing and throws errors. I'm not able to commit since I started signing everything.
Edit: If I use git4win it uses the gpg4win dialog thingy too, so I started just using that temporarily.
Prerequisites
Description
If you normally use a GPG agent to sign the commit, but attempt to cancel the dialog from that Atom will present you a dialog of its own to gather the passphrase for the key, but entering the correct passphrase fails to sign the commit with an error message.
Steps to Reproduce
gpg-agent
withgpgconf --kill gpg-agent
commit.gpgsign=true
)Expected behavior:
Atom to sign the commit.
Actual behavior:
Atom fails to sign the commit with the following stack trace:
Reproduces how often:
100% of the time.
Versions
OS: Windows 10 x64 Enterprise
Additional Information
I've manually specified
gpg.program
to beC:\Program Files (x86)\GnuPG\bin\gpg.exe
instead of lettinggit
determine it automatically. It's been a while since I set it up, but this was necessary to get things working properly with the GPG agent.Note: This is possibly the same issue at its core as https://github.com/atom/github/issues/814, but with a different stack trace.