gopasspw / gopass

The slightly more awesome standard unix password manager for teams
https://www.gopass.pw/
MIT License
5.83k stars 485 forks source link

Able to store secrets, but with errors #13

Closed mrcrilly closed 7 years ago

mrcrilly commented 7 years ago

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:

metalmatze commented 7 years ago

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

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

ksophocleous commented 7 years ago

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

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

metalmatze commented 7 years ago

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 commented 7 years ago

The bug is the same i discover on #17

Change the .git/config solve the probleme

hartzell commented 7 years ago

[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 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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

metalmatze commented 7 years ago

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