You are not logged in.

#1 2016-01-25 20:24:33

ralvez
Member
From: Canada
Registered: 2005-12-06
Posts: 1,694
Website

gpg: Sorry, we are in batchmode - can't get input [SOLVED]

I'm not very experienced with gpg and I'm sure this is a simple problem but I cannot figure out the reason for the error.
I'm using pass. If I type pass directory/targetitem (eg: pass google/login) it replies : "gpg: Sorry, we are in batchmode - can't get input"
However if I go to ~/.password-store and type "gpg --decrypt google/login" it will ask for the master password and it works. Thereafter, for a short period of time, I can once again use "pass google/login" and it will behave as expected.

What am I missing?! hmm


R.

Last edited by ralvez (2016-01-26 19:07:14)

Offline

#2 2016-01-26 17:19:53

ralvez
Member
From: Canada
Registered: 2005-12-06
Posts: 1,694
Website

Re: gpg: Sorry, we are in batchmode - can't get input [SOLVED]

The more I look into this problem the more it seems like is either:
1. pass not talking to gpg or vice-versa
2. pinentry settings

Any other ideas?

Last edited by ralvez (2016-01-26 19:00:20)

Offline

#3 2016-01-26 17:31:23

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: gpg: Sorry, we are in batchmode - can't get input [SOLVED]

Are you running an agent? If so, how do you start it? Paste your .gnupg/*.conf files.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#4 2016-01-26 19:06:56

ralvez
Member
From: Canada
Registered: 2005-12-06
Posts: 1,694
Website

Re: gpg: Sorry, we are in batchmode - can't get input [SOLVED]

@jasonwryan,

Yes, I am.
But I just fixed it.
In the wiki it is suggested to edit ~/.gnupg/gpg.conf and add:

allow-loopback-pinentry

It did work in the past but all of the sudden it did not like that anymore. hmm
I just commented that line and now it works again.

Thanks Jason!!

R.

Offline

#5 2016-01-26 19:52:19

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: gpg: Sorry, we are in batchmode - can't get input [SOLVED]

That was for unattended passphrases and, as it notes, it may break other usage...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#6 2016-01-26 23:44:04

ralvez
Member
From: Canada
Registered: 2005-12-06
Posts: 1,694
Website

Re: gpg: Sorry, we are in batchmode - can't get input [SOLVED]

Yup. It used to work, but after trying many different things I read the wiki again, so and decided to take it out ... smile

R.

Offline

#7 2016-01-28 04:25:55

charli3
Member
Registered: 2015-06-01
Posts: 45

Re: gpg: Sorry, we are in batchmode - can't get input [SOLVED]

Actually I'm having the same problem...

@ralvez, what did you do exactly that solved the problem? 

gpg.conf:

use-agent
require-cross-certification

gpg-agent.conf:

allow-loopback-pinentry
pinentry-program /usr/bin/pinentry-curses
no-grab

.zshrc;

GNUPGHOME=~/.gnupg
GPG_TTY=$(tty)
export GPG_TTY

Edit: Kind of a kludge but if I edit /usr/bin/pass and take out the "--batch" option it runs as intended.  Maybe this is a bug upstream with pass?

Last edited by charli3 (2016-01-28 04:40:48)

Offline

#8 2016-01-28 06:03:28

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: gpg: Sorry, we are in batchmode - can't get input [SOLVED]

You have the loopback entry in your agent.conf...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#9 2016-01-28 23:53:24

ralvez
Member
From: Canada
Registered: 2005-12-06
Posts: 1,694
Website

Re: gpg: Sorry, we are in batchmode - can't get input [SOLVED]

@charli3.

I had the line: "allow-loopback-pinentry" in ~/.gnupg/gpg.conf
That if you look in the wiki says that it may work but it may also cause problems.
So, I removed it and it worked.

Your case may be a different problem though, because you have the line in ~/.gnupg/gpg-agent.conf which is supposed to be OK.
Or at least that is what I get looking at the wiki.

First, edit the gpg-agent configuration to allow loopback pinentry mode:

~/.gnupg/gpg-agent.conf

allow-loopback-pinentry

R

Offline

#10 2016-01-29 00:16:54

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: gpg: Sorry, we are in batchmode - can't get input [SOLVED]

Rather than blindly copying from the wiki, read the man pages or official documentation: https://www.gnupg.org/documentation/man … PTION.html

loopback
Use a loopback pinentry. This fakes a pinentry by using inquiries back to the caller to ask for a passphrase. This option may only be set if the agent has been configured for that.

Neither of you want that.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#11 2016-01-29 00:24:25

ralvez
Member
From: Canada
Registered: 2005-12-06
Posts: 1,694
Website

Re: gpg: Sorry, we are in batchmode - can't get input [SOLVED]

@jasonwryan,

But would he not want that IF he is using something like a GUI interface? Like QTpass?

R,

Last edited by ralvez (2016-01-29 00:25:30)

Offline

#12 2016-01-29 00:34:03

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: gpg: Sorry, we are in batchmode - can't get input [SOLVED]

No, that is what --pinentry-program is for in the agent-conf


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#13 2016-01-29 02:48:23

charli3
Member
Registered: 2015-06-01
Posts: 45

Re: gpg: Sorry, we are in batchmode - can't get input [SOLVED]

@jasonwryan,

jasonwryan wrote:

Rather than blindly copying from the wiki, read the man pages or official documentation: https://www.gnupg.org/documentation/man … PTION.html

loopback
Use a loopback pinentry. This fakes a pinentry by using inquiries back to the caller to ask for a passphrase. This option may only be set if the agent has been configured for that.

Neither of you want that.

Actually, I do want loopback pinentry.  I'm using a script to handle a call to gpg from offlineimap per the wiki here: https://wiki.archlinux.org/index.php/Of … #Using_GPG

I think the "--batch" option problem in pass is unrelated to the "allow-loopback-pinentry" option in the gpg-agent.conf, though I could be wrong...

@ralvez,

Thanks for the response.  I saw that too in the wiki and didn't have "allow-loopback-pinentry" in gpg.conf but it still gave the same error.  The only fix that worked for me was to edit the actual /usr/bin/pass to omit the "--batch" option.

Last edited by charli3 (2016-01-29 02:52:18)

Offline

#14 2017-01-05 11:31:27

afwlehmann
Member
Registered: 2014-07-19
Posts: 3

Re: gpg: Sorry, we are in batchmode - can't get input [SOLVED]

charli3 wrote:

I saw that too in the wiki and didn't have "allow-loopback-pinentry" in gpg.conf but it still gave the same error.  The only fix that worked for me was to edit the actual /usr/bin/pass to omit the "--batch" option.

Same here.

Offline

Board footer

Powered by FluxBB