You are not logged in.

#1 2021-04-02 14:30:33

madrafa
Member
Registered: 2021-02-19
Posts: 34
Website

GPG not prompting for passphrase. [SOLVED]

So up until yesterday gpg was working all fine. But today, it doesn't prompt for passphrase, I just get an empty blinking command line.

I'm using gpg for signing git commits. I thought the problem was with git. But no, if I do echo "test" | gpg --clearsign I get the same than when doing git commit (empty command line not prompting for passphrase).

At first, the error I was getting when doing git commit was

error: gpg failed to sign the data
fatal: failed to write commit object

But in this thread they said to export GPG_TTY=$(tty) in your bashrc/zshrc
if you get that error. That stopped gpg from showing the error error: gpg failed to sign the data but it still doesn't prompt for passphrase.

I can't do anything related to prompting for passphrase, not listing my keys with gpg --list-secret-keys --keyid-format LONG or anything. I can see my public with no problem. I tried importing my private key again and I get:

gpg: key <KEYID>: "<NAME EMAIL" not changed

And then just a empty command line again.

I have pinentry installed just in case anyone asks.

I don't understand. It was all working fine yesterday! Does anyone knows how to solve this ?

Last edited by madrafa (2021-04-02 23:08:51)

Offline

#2 2021-04-02 14:53:48

tucuxi
Member
From: Switzerland
Registered: 2020-03-08
Posts: 291

Re: GPG not prompting for passphrase. [SOLVED]

Are you using a gpg agent? How is it configured?

Offline

#3 2021-04-02 15:22:36

madrafa
Member
Registered: 2021-02-19
Posts: 34
Website

Re: GPG not prompting for passphrase. [SOLVED]

tucuxi wrote:

Are you using a gpg agent? How is it configured?

Yes. I think it is pulled as a dependency for gpg.  I don't know how it is configured.

       --options file
              Reads configuration from file instead of from the default per-user  configuration
              file.   The  default configuration file is named ‘gpg-agent.conf’ and expected in
              the ‘.gnupg’ directory directly below the home directory of the user.   This  op‐
              tion is ignored if used in an options file.

I found this in the man page, but I don't have such file in ~/.gnupg , What do I have to put in that file ? Also, I've checked and gpg-agent is running. And to make sure I manually started the program and then tried echo "test" | gpg --clearsign but still... I don't get anything.

Offline

#4 2021-04-02 15:32:45

tucuxi
Member
From: Switzerland
Registered: 2020-03-08
Posts: 291

Re: GPG not prompting for passphrase. [SOLVED]

There you configure the pinentry program that you want to use. For example:

pinentry-program /usr/bin/pinentry

See https://wiki.archlinux.org/index.php/GnuPG#gpg-agent for other options.

What happens when you run `pinentry` in a terminal?

Offline

#5 2021-04-02 16:22:24

madrafa
Member
Registered: 2021-02-19
Posts: 34
Website

Re: GPG not prompting for passphrase. [SOLVED]

This is what happens, Just a little message and then an empty prompt.

Last edited by madrafa (2021-04-02 16:22:37)

Offline

#6 2021-04-02 16:57:28

madrafa
Member
Registered: 2021-02-19
Posts: 34
Website

Re: GPG not prompting for passphrase. [SOLVED]

So, I've testing the pinentry-program /usr/bin/pinentry option you told me, using different pinentry programs like pinentry-tty or pinentry-qt but none of them seem to solve my issue sad

Offline

#7 2021-04-02 20:33:19

tucuxi
Member
From: Switzerland
Registered: 2020-03-08
Posts: 291

Re: GPG not prompting for passphrase. [SOLVED]

What is the output of

journalctl --user -b -u gpg-agent

Listing secret keys should not depend on pinentry. What is the result of

gpg --list-secret-keys

Offline

#8 2021-04-02 23:07:56

madrafa
Member
Registered: 2021-02-19
Posts: 34
Website

Re: GPG not prompting for passphrase. [SOLVED]

I restarted my computer and it is working again. No idea what was wrong.

Doing:

journalctl --user -b -u gpg-agent

didn't show any error, just some output of fd 3 for browser socket bla bla bla and it was like 8 lines of that.

Offline

#9 2021-04-03 01:20:06

ryanobeirne
Member
From: NC/USA
Registered: 2019-11-02
Posts: 1
Website

Re: GPG not prompting for passphrase. [SOLVED]

I got this error yesterday on KDE/Plasma. Normally I get a popup to sign commits, or if I'm remote, I'll get the curses password prompt on the command line. Turns out pinentry-gtk-2 was locked up somehow. I did

killall pinentry-gtk-2

then it started working again.

Offline

Board footer

Powered by FluxBB