-
Notifications
You must be signed in to change notification settings - Fork 878
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot decrypt with GPG 2.2.5 and SOPS 3.0.0 #304
Comments
See this comment for what you can do to debug the issue |
Hi. I think I am having the same problem:
I don't have any other versions of gpg installed, or sops for that matter. I've tried encrypting and decrypting directly with gpg, and that works fine. This is also with a brand new key. The comment referenced, didn't help me all that much. Is this a bug, or is something wrong with my setup? Any help would be greatly appreciated. Best regards, |
This is probably something wrong with your setup. SOPS calls the gpg binary, and it's returning exit status 2, which is of course unsuccessful. Some things you could try:
|
Suddenly it started working. And I actually have no idea why. Also been trying to reproduce my error above, but cannot. At sometime I did a Anyways, I certainly don't need any help to fix this any more :) Best regards, |
The problem suddenly re-occured... I think it has to do with the gpg-agent. For the moment, this solved it for me, adding to .bashrc or similiar (I hava a .zshrc), as described in https://www.gnupg.org/documentation/manuals/gnupg/Invoking-GPG_002dAGENT.html:
I restarted the shell, and on first decrypt command I was asked for my passprase to my keys. After that all the shells seems to be able to decrypt again. If this is the case, I would say the error message probably could hint at this solution. Cheers, |
I'm not sure the error message should hint at this, as it's only one of the many possible reasons for which calling |
No, unfortunately I've seen nothing else than posted here. However, I found this issue with a google search fairly quickly, so maybe it may help others. We may be rolling this out to the entire org, so I am sure I will see lots of variants of this. Will update the issue if I find anything else. |
Did this on my colleagues Mac, and he got the same error. Adding the tty settings into his .zshrc also fixed it for him. |
Confirmed Closing this issue. |
@stoyle I tried with this resolution and appended the below 2 lines in ".bash_profile".
I still have the same issue.
Could it be an issue with the sops version ?
|
Any info |
I'd the same issue, and this page was super useful. Thanks |
I don't find it user-friendly to have to set up GPG_TTY in order to decrypt a file. Couldn't sops figure this out by itself? |
I had the same issue (".gnupg/secring.gpg: no such file") but my problem was that I was trying to decrypt an encrypted file that didn't have my key setup. The error message was misleading the troubleshooting - I was trying to generate somehow secring.gpg with gpg2 and in the end it was just the missing setup in the file. |
gpg is either weird, picky, or knows more than I do (all three are correct :) https://www.gnupg.org/documentation/manuals/gnupg/Common-Problems.html
https://www.gnupg.org/documentation/manuals/gnupg/Invoking-GPG_002dAGENT.html Clearly not the job for SOPS to set this; but from a UX point of view, may be useful to warn if GPG_TTY is not set then PGP is being used. In my container image that I'm creating for my own needs, I have dropped the appropriate lines into /etc/profile.d/gpg-tty.sh cat > /etc/profile.d/gpg-tty.sh <<'EOF'
# This is _required_ if you want 'gpg' to call out to the agent, otherwise
# the pinentry won't work. Also required if using non-tty pinentries.
#
# https://www.gnupg.org/documentation/manuals/gnupg/Common-Problems.html
#
GPG_TTY=`tty`
export GPG_TTY
EOF |
Fix sops problem, s. getsops/sops#304
Fix sops problem, s. getsops/sops#304
Fix sops problem, s. getsops/sops#304
Fix sops problem, s. getsops/sops#304
Fix sops problem, s. getsops/sops#304
Fix sops problem, s. getsops/sops#304
Fix sops problem, s. getsops/sops#304
Fix sops problem, s. getsops/sops#304
Fix sops problem, s. getsops/sops#304
Fix sops problem, s. getsops/sops#304
Fix sops problem, s. getsops/sops#304
Fix sops problem, s. getsops/sops#304
Fix sops problem, s. getsops/sops#304
Fix sops problem, s. getsops/sops#304
Fix sops problem, s. getsops/sops#304
Fix sops problem, s. getsops/sops#304
Fix sops problem, s. getsops/sops#304
Fix sops problem, s. getsops/sops#304
Fix sops problem, s. getsops/sops#304
Fix sops problem, s. getsops/sops#304
Fix sops problem, s. getsops/sops#304
Fix sops problem, s. getsops/sops#304
Fix sops problem, s. getsops/sops#304
Fix sops problem, s. getsops/sops#304
Fix sops problem, s. getsops/sops#304
Fix sops problem, s. getsops/sops#304
It appears the utility is looking for a secret key in a file but my GPG installation (through macOS homebrew) uses the gpg-agent. I cannot decrypt files as demonstrated below.
The text was updated successfully, but these errors were encountered: