Skip to content
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

Able to store secrets, but with errors #13

Closed
mrcrilly opened this issue Feb 2, 2017 · 9 comments
Closed

Able to store secrets, but with errors #13

mrcrilly opened this issue Feb 2, 2017 · 9 comments
Milestone

Comments

@mrcrilly
Copy link
Contributor

mrcrilly commented Feb 2, 2017

I saw gopass on Hacker News and thought I would check it out. I actually plan on doing a PR for #4, but I have experienced an issue I want to raise here. Perhaps someone can expand further on this.

$ gopass insert world
Enter password for world:
Failed to restore terminal: errno 0
Retype password for world:
Failed to restore terminal: errno 0
gopass: Encrypting world for these recipients:
 - 0xB058C2BF639F134B - Mike C (Hi) <mc@sent.com>

Do you want to continue? [Y/n]:
error: gpg failed to sign the data
fatal: failed to write commit object

Error: failed to committ files to git: exit status 128

$ gopass show world
hello

So I insert a secret and it seems to fail, but then I'm able to retrieve it. The secret is present in the .password-store as a .gpg file and is indeed encrypted. Any thoughts on the errors here?

Versions:

  • macOS 10.12
  • gpg (GnuPG) 2.0.30 / libgcrypt 1.7.6 (gpg installed via brew)
  • git version 2.11.0
  • gopass HEAD (n/a ) go1.7.5
@metalmatze
Copy link
Contributor

Please take a look at the FAQ.
https://www.justwatch.com/gopass/faq/

I think that's exactly the problem, right?! 😊

@ksophocleous
Copy link

@metalmatze the FAQ solves part of the problem, thanks for that.

but the error Failed to restore terminal: errno 0 still remains

@metalmatze metalmatze added the bug label Feb 3, 2017
@metalmatze metalmatze added this to the 1.0.1 milestone Feb 3, 2017
@metalmatze
Copy link
Contributor

I can confirm this bug. It happend to me right now on ArchLinux.

$ gopass insert foo
Enter password for foo: 
Failed to restore terminal: errno 0
Retype password for foo: 
Failed to restore terminal: errno 0
gopass: Encrypting foo for these recipients:
 - 0xB1C7DF661ABB2C1A - Matthias Loibl <mail@matthiasloibl.com>

Do you want to continue? [Y/n]: 
[master bd0cf1f] Save secret to foo.
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 foo.gpg

@Ratatosk42
Copy link

Ratatosk42 commented Feb 3, 2017

The bug is the same i discover on #17

Change the .git/config solve the probleme

@hartzell
Copy link
Contributor

hartzell commented Feb 3, 2017

[edit for clarity]

I was seeing the same problem:

Error: failed to committ files to git: exit status 128

(ps, #27 fixes the typo...)

In addition to the FAQ cited above, it turned out that I had used one form of my company email when creating the GPG key (shortname@myco.com) and had a different form in my ~/.gitconfig [user] section (first.last@subdir.myco.com).

Changing the email address in my ~/.gitconfig to match the one I used in the key allowed things to complete successfully.

Seems like I should pick one form and stick with it...

@trongdong
Copy link

I'm facing this bug as well. My setup is identical to @mrcrilly
I also tried the FAQ, change signingkey in git config and change gpg email as @hartzell mentioned as well but no luck.

➜  ~ gopass insert foo/bar1
Enter password for foo/bar1: 
Failed to restore terminal: errno 0
Retype password for foo/bar1: 
Failed to restore terminal: errno 0
gopass: Encrypting foo/bar1 for these recipients:
 - 0x09674B0D7D0EDA9C - John <john.doe@abc.com>

Do you want to continue? [Y/n]: y
error: gpg failed to sign the data
fatal: failed to write commit object

Error: failed to committ files to git: exit status 128

@jamesboswell
Copy link

jamesboswell commented Feb 21, 2017

OSX 10.11.6 El Capitan

FYI, for anyone like me who didn't read the homebrew output of installing pinentry-mac as required in the FAQ

You need to create a gpg-agent.conf file and set the pinentry-program

vim ~/.gnupg/gpg-agent.conf
# insert
pinentry-program /usr/local/bin/pinentry-mac
# save 

This fixes a lot of errors, as by default GPG is trying to use the pinentry-ncurses and gopass can't use it as of 1.0.1. Setting the pinentry-program uses the Mac pop-up window to prompt for password
This cleared the show and insert (exit status 128) errors I was having.

gopass show bar

You need a passphrase to unlock the secret key for
user: "James Boswell <removed>@.com>"
2048-bit ELG key, ID <removed>, created 2017-02-21 (main key ID 4422B82B)

<pinentry-mac pop up happens outside terminal>
1234
 gopass insert foo
Enter password for foo:
Failed to restore terminal: errno 0
Retype password for foo:
Failed to restore terminal: errno 0
gopass: Encrypting foo for these recipients:
 - 0x<removed> - James Boswell <removed@com>

Do you want to continue? [Y/n]: y

You need a passphrase to unlock the secret key for
user: "James Boswell <removed@.com>"
2048-bit DSA key, ID <removed>, created 2017-02-21

<pinentry-mac pop up happens outside terminal>

[master 403299c] Save secret to foo: Inserted user supplied password
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 foo.gpg
Warning: git has not remote. Ignoring auto-push option
Run: gopass git remote add origin ...

@trongdong
Copy link

I can confirm @jamesboswell's comment, it fixed my issue. The only error now is: Failed to restore terminal: errno 0

@metalmatze
Copy link
Contributor

This issue was fixed in #85 and commented on in #80.

samuelnilsson pushed a commit to samuelnilsson/gopass that referenced this issue Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants