You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Prompt for GPG passphrase and then silent failure to commit #737
Yesterday I started seeing a new prompt for my GPG passphrase when I attempted a commit in Atom with the atom/github package. I type the passphrase, and it fails silently. The changes that were staged are still staged.
Steps to Reproduce
Make a change
Stage the change
Type a commit message and click Commit
Prompt for GPG passphrase appears:
Type in passphrase and click Sign in
Prompt disappears, but commit is not made and change is still staged.
Developer Console shows this:
Expected behavior:
I am using a gpg-agent (the configuration that comes with gpgtools) and I don't get a prompt on the command-line. I expected no prompt at all. If I get a prompt, I would expect that typing in the correct passphrase would succeed in creating the commit, and an incorrect passphrase would fail with an error.
Actual behavior:
I get a prompt, and typing in the correct passphrase fails silently.
@smashwilson - Thanks for fixing the silent failure problem. I can confirm that a commit failure will now surface as an error, rather than silence (with a log to the console). 🎉 ❇️
However, this was only part of my issue. When I try to commit a change I initially get a prompt for a GPG passphrase, which I enter (correctly, from a password manager). It was followed by silence and an error being logged to the console. It is now followed by this error:
Same error only prettier 😉
I can make the commit, with gpg signature, on the command-line without interaction:
$ git commit -m "Add a reusable for choosing a branch"
You need a passphrase to unlock the secret key for
user: "Brett Westover <[email protected]>"
4096-bit RSA key, ID 6D34F71F, created 2016-03-24
[desktop-contributing-2 4c0e759f9d] Add a reusable for choosing a branch
1 file changed, 4 insertions(+)
$
I'm using a gpg-agent, so I don't get prompted for my passphrase. Since I get prompted in Atom, I would suspect its not talking to that agent. However, since even a correct password doesn't work, I suspect it isn't able to shell out to gpg at all.
I was able to make commits with the atom/github package with this configuration up until recently. It's been about 5-6 days now. (And I miss it!! 💙 😧 )
Let me know if you need anything further from me to help reproduce. Should this issue be re-opened, or shall I create another?
@bwestover Whoops! My mistake, I was too eager on the close button there 🙈 😆
I'm using a gpg-agent, so I don't get prompted for my passphrase. Since I get prompted in Atom, I would suspect its not talking to that agent. However, since even a correct password doesn't work, I suspect it isn't able to shell out to gpg at all.
Quite possible. I'm also wondering if our wrapper script is discovering or invoking your gpg binary incorrectly. Can you share the output of:
gpg --version
git config gpg.program
Something else that may help: if you open the github package settings in the settings view and enable "Git Diagnostics," it'll execute git commands with GIT_TRACE=1 and log all of the output to the dev console. Expand the console groups labelled with git:git -c gpg.program=... commit -m... to see the commit traces - there should be two of them.
I may need to add in a bit more debugging output to the GPG wrapper to get to the bottom of this, though.
I was able to make commits with the atom/github package with this configuration up until recently. It's been about 5-6 days now. (And I miss it!! 💙 😧 )
💭 Regressing that recently suggests that this may have something to do with the way that we handle git errors? Commands that may require the use of a GPG key (commit, merge, pull) are executed first without the prompt-through-Atom helper then re-executed with it on failure.
$ gpg --version
gpg (GnuPG/MacGPG2) 2.0.30
libgcrypt 1.7.0
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Home: ~/.gnupg
Supported algorithms:
Pubkey: RSA, RSA, RSA, ELG, DSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
CAMELLIA128, CAMELLIA192, CAMELLIA256
Hash: MD5, SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2
gpg.program
$ git config gpg.program
No output. Yikes, is there supposed to be? It looks like you fall back to just gpg if this isn't set so probably ok?
Phew, thanks for the data! I was hoping that git would report something more informative for the run_command failures (like the stderr of our wrapper script's output for example) but it looks like it does not. Inconvenient.
No output. Yikes, is there supposed to be? It looks like you fall back to just gpg if this isn't set so probably ok?
Yep, that's fine - I mainly wanted to see if you'd set it to gpg2 or something, since it'd override the ${PATH} lookup 😄
A crazy test you didn't ask for
Haha, yeah, it's trying to write a query to a socket that connects back to the Atom process to show that prompt dialog, so when you run it on its own it'll just wait forever.
I'm wondering if this is a PATH issue like #764, in which case #765 might take care of this. Care to apm upgrade github and try again?
I have this issue on MacOS with Atom v1.45.0 and gnupg installed via homebrew. The gpg password prompt comes up and I enter the password, but always fails. The same password works in the bash shell.
Activity
bwestover commentedon May 9, 2017
@smashwilson - Thanks for fixing the silent failure problem. I can confirm that a commit failure will now surface as an error, rather than silence (with a log to the console). 🎉 ❇️
However, this was only part of my issue. When I try to commit a change I initially get a prompt for a GPG passphrase, which I enter (correctly, from a password manager). It was followed by silence and an error being logged to the console. It is now followed by this error:
Same error only prettier 😉
I can make the commit, with gpg signature, on the command-line without interaction:
I'm using a gpg-agent, so I don't get prompted for my passphrase. Since I get prompted in Atom, I would suspect its not talking to that agent. However, since even a correct password doesn't work, I suspect it isn't able to shell out to
gpgat all.I was able to make commits with the atom/github package with this configuration up until recently. It's been about 5-6 days now. (And I miss it!! 💙 😧 )
Let me know if you need anything further from me to help reproduce. Should this issue be re-opened, or shall I create another?
smashwilson commentedon May 9, 2017
@bwestover Whoops! My mistake, I was too eager on the close button there 🙈 😆
Quite possible. I'm also wondering if our wrapper script is discovering or invoking your gpg binary incorrectly. Can you share the output of:
gpg --versiongit config gpg.programSomething else that may help: if you open the github package settings in the settings view and enable "Git Diagnostics," it'll execute git commands with
GIT_TRACE=1and log all of the output to the dev console. Expand the console groups labelled withgit:git -c gpg.program=... commit -m...to see the commit traces - there should be two of them.I may need to add in a bit more debugging output to the GPG wrapper to get to the bottom of this, though.
💭 Regressing that recently suggests that this may have something to do with the way that we handle git errors? Commands that may require the use of a GPG key (commit, merge, pull) are executed first without the prompt-through-Atom helper then re-executed with it on failure.
bwestover commentedon May 9, 2017
gpg version
gpg.program
No output. Yikes, is there supposed to be? It looks like you fall back to just
gpgif this isn't set so probably ok?gpg-no-tty.sh#L7:
Console output after enabling "Git Diagnostics"
...and again in text, in case thats easier to read☺️
A crazy test you didn't ask for (feel free to ignore)
I thought I'd see what happened if I tried to run the wrapper script on my terminal directly.
smashwilson commentedon May 9, 2017
Phew, thanks for the data! I was hoping that git would report something more informative for the
run_commandfailures (like the stderr of our wrapper script's output for example) but it looks like it does not. Inconvenient.Yep, that's fine - I mainly wanted to see if you'd set it to
gpg2or something, since it'd override the${PATH}lookup 😄Haha, yeah, it's trying to write a query to a socket that connects back to the Atom process to show that prompt dialog, so when you run it on its own it'll just wait forever.
I'm wondering if this is a PATH issue like #764, in which case #765 might take care of this. Care to
apm upgrade githuband try again?bwestover commentedon May 9, 2017
😻 - That did it 🎉
Did a commit with no prompt, just flew through!
Console had this output:
Thank you so much 👍
smashwilson commentedon May 9, 2017
Woo, excellent! Thank you for all the info 😁
ahuffman commentedon Apr 28, 2020
I have this issue on MacOS with Atom v1.45.0 and gnupg installed via homebrew. The gpg password prompt comes up and I enter the password, but always fails. The same password works in the bash shell.