You are not logged in.
When I run gpg, or any depended process (mutt/pass etc.), password prompt is not displayed and the process hangs indefinately.
For an example,
┌─[sharad] (09:14 PM)-(Wed Jun 21) !6706! [~]
└───▶ gpg --verbose -r <my_mail_id> .password-store/net/IT.gpg
gpg: public key is B9A162B328E94140
^C
gpg: signal Interrupt caught ... exitingThis issue is started after recent update, gpg was working fine before that.
Last edited by Docbroke (2017-06-23 03:44:24)
Arch is home!
https://github.com/Docbroke
Offline
Is there another process (agent) running?
Offline
No. I am not starting gpg-agent manually (or through systemd). It is called when required. Killing gpg-agent doesn't help either.
Another thing I just noticed is that I am not able to kill gpg-agent once it starts.
EDIT: spell correction "ones to once"
Last edited by Docbroke (2017-06-22 02:29:15)
Arch is home!
https://github.com/Docbroke
Offline
It appears that no process were able to connect with gpg-agent, and when I kill gpg-agent it reloads itself.
┌─[sharad] (07:35 AM)-(Thu Jun 22) !6748! [~]
└───▶ pgrep gpg-agent
2717
┌─[sharad] (07:35 AM)-(Thu Jun 22) [~]
└───▶ pkill gpg-agent
┌─[sharad] (07:35 AM)-(Thu Jun 22) [~]
└───▶ pgrep gpg-agent
3077To kill this defective agent from relaoding itself I have to add error(few random words) in config file (.gnupg/gpg-agent.conf)
┌─[sharad] (07:38 AM)-(Thu Jun 22) [~]
└───▶ cat .gnupg/gpg-agent.conf
dkfjlkdj dfjlkdfjl
pinentry-program /usr/bin/pinentryNow I can kill the agent
┌─[sharad] (07:39 AM)-(Thu Jun 22) !6749! [~]
└───▶ gpg --verbose -r <my_mail_id> -d .password-store/net/IT.gpg
gpg: public key is B9A162B328E94140
gpg: no running gpg-agent - starting '/usr/bin/gpg-agent'
gpg: waiting for the agent to come up ... (5s)
gpg: waiting for the agent to come up ... (4s)
gpg: waiting for the agent to come up ... (3s)
gpg: waiting for the agent to come up ... (2s)
gpg: waiting for the agent to come up ... (1s)
gpg: can't connect to the agent: IPC connect call failed
gpg: using subkey B9A162B328E94140 instead of primary key 4EBCA5607B3290F9
gpg: encrypted with 2048-bit RSA key, ID B9A162B328E94140, created 2016-05-29
"<user_id> <my_mail_id>"
gpg: decryption failed: No secret key
┌─[sharad] (07:40 AM)-(Thu Jun 22) !6749! [~]
└───▶ gpg-agent
gpg-agent[7535]: /home/sharad/.gnupg/gpg-agent.conf:1: invalid option Next I remove the error from conf file. Now If I start any process needing gpg-agent it starts correctly.
┌─[sharad] (07:43 AM)-(Thu Jun 22) [~]
└───▶ cat .gnupg/gpg-agent.conf
pinentry-program /usr/bin/pinentry
┌─[sharad] (07:43 AM)-(Thu Jun 22) !6749! [~]
└───▶ gpg --verbose -r <mail_id> -d .password-store/net/IT.gpg
gpg: public key is B9A162B328E94140
gpg: no running gpg-agent - starting '/usr/bin/gpg-agent'
gpg: waiting for the agent to come up ... (5s)
gpg: connection to agent established
gpg: using subkey B9A162B328E94140 instead of primary key 4EBCA5607B3290F9
gpg: pinentry launched (8942 gtk2 1.0.0 ? ? ?)
gpg: using subkey B9A162B328E94140 instead of primary key 4EBCA5607B3290F9
gpg: encrypted with 2048-bit RSA key, ID B9A162B328E94140, created 2016-05-29
"<user_id> <mail_id>"
gpg: AES256 encrypted data
gpg: original file name='ojP0s-net-IT.txt'
incometaxindiaefiling.gov.inSo why gpg-agent doesn't start correctly first time, and why it start behving well after I introduce and correct the error in it's config file just so that I can stop it from reloading itself.
Arch is home!
https://github.com/Docbroke
Offline
Based on above post now, I am running this ugly hack.
┌─[sharad] (11:57 AM)-(Thu Jun 22) [~]
└───▶ cat .gnupg/gpg-agent.conf
#default-cache-ttl 60480000
#max-cache-ttl 604840000
# pinentry-program /usr/bin/pinentry-gtk-2
pinentry-program /usr/bin/pinentry
dfkj .dfmlkj.dflkj
┌─[sharad] (11:57 AM)-(Thu Jun 22) [~]
└───▶ cat .gnupg/gpg-agent2.conf
#default-cache-ttl 60480000
#max-cache-ttl 604840000
# pinentry-program /usr/bin/pinentry-gtk-2
pinentry-program /usr/bin/pinentrythis line goes in .bash_profile
gpg-agent --daemon >/dev/null 2>&1this line goes in my pass wrapper, so whenever I run pass it start gpg-agent with good config
pgrep gpg-agent >/dev/null || gpg-agent --options .gnupg/gpg-agent2.conf --daemonThough I fully fail to understand why gpg-agent doesn't run properly on first attempt.
Arch is home!
https://github.com/Docbroke
Offline
@Docbroke, that worked for me too. Encountered this yesterday afternoon and I was totally stumped. All I could find was the gpg-agent journal entries which show gpg-agent attempting to start over and over again, only to time out every time.
I use gopass as my password manager, so I was up a certain creek until I came across your post. Thanks for sharing your work around, saved me a lot of headache today.
Jun 22 08:39:40 ffprime systemd[2471]: Starting GnuPG private key agent...
Jun 22 08:41:10 ffprime systemd[2471]: gpg-agent.service: Start operation timed out. Terminating.
Jun 22 08:41:10 ffprime systemd[2471]: Failed to start GnuPG private key agent.
Jun 22 08:41:10 ffprime systemd[2471]: gpg-agent.service: Unit entered failed state.
Jun 22 08:41:10 ffprime systemd[2471]: gpg-agent.service: Failed with result 'timeout'.
Jun 22 08:41:10 ffprime systemd[2471]: Starting GnuPG private key agent...
Jun 22 08:42:41 ffprime systemd[2471]: gpg-agent.service: Start operation timed out. Terminating.
Jun 22 08:42:41 ffprime systemd[2471]: Failed to start GnuPG private key agent.
Jun 22 08:42:41 ffprime systemd[2471]: gpg-agent.service: Unit entered failed state.
Jun 22 08:42:41 ffprime systemd[2471]: gpg-agent.service: Failed with result 'timeout'.
Jun 22 08:42:41 ffprime systemd[2471]: Starting GnuPG private key agent...
Jun 22 08:42:41 ffprime systemd[2471]: gpg-agent.service: Control process exited, code=exited status=2
Jun 22 08:42:41 ffprime systemd[2471]: Failed to start GnuPG private key agent.
Jun 22 08:42:41 ffprime systemd[2471]: gpg-agent.service: Unit entered failed state.
Jun 22 08:42:41 ffprime systemd[2471]: gpg-agent.service: Failed with result 'exit-code'.
Jun 22 08:42:41 ffprime systemd[2471]: Starting GnuPG private key agent...
Jun 22 08:42:41 ffprime systemd[2471]: gpg-agent.service: Control process exited, code=exited status=2
Jun 22 08:42:41 ffprime systemd[2471]: Failed to start GnuPG private key agent.
Jun 22 08:42:41 ffprime systemd[2471]: gpg-agent.service: Unit entered failed state.
Jun 22 08:42:41 ffprime systemd[2471]: gpg-agent.service: Failed with result 'exit-code'.
Jun 22 08:42:41 ffprime systemd[2471]: Starting GnuPG private key agent...
Jun 22 08:42:41 ffprime systemd[2471]: gpg-agent.service: Control process exited, code=exited status=2
Jun 22 08:42:41 ffprime systemd[2471]: Failed to start GnuPG private key agent.
Jun 22 08:42:41 ffprime systemd[2471]: gpg-agent.service: Unit entered failed state.
Jun 22 08:42:41 ffprime systemd[2471]: gpg-agent.service: Failed with result 'exit-code'.
Jun 22 08:42:41 ffprime systemd[2471]: Starting GnuPG private key agent...
Jun 22 08:42:41 ffprime systemd[2471]: gpg-agent.service: Control process exited, code=exited status=2
Jun 22 08:42:41 ffprime systemd[2471]: Failed to start GnuPG private key agent.
Jun 22 08:42:41 ffprime systemd[2471]: gpg-agent.service: Unit entered failed state.
Jun 22 08:42:41 ffprime systemd[2471]: gpg-agent.service: Failed with result 'exit-code'.
Jun 22 08:42:41 ffprime systemd[2471]: Starting GnuPG private key agent...
Jun 22 08:42:41 ffprime systemd[2471]: gpg-agent.service: Control process exited, code=exited status=2
Jun 22 08:42:41 ffprime systemd[2471]: Failed to start GnuPG private key agent.Offline
Glad to know that I am not the sole victim.
Arch is home!
https://github.com/Docbroke
Offline
Is gpg-agent not being started as a user service? This is the default as of a recent update, check here. Check the output of "systemctl --user status gpg-agent". I had problems a little while ago because I was also starting gpg-agent separatly from this service - which I hadn't realized had been put in place.
Offline
Starting gpg-agent as user service causes the same problem. The status command hangs, even stop/start commands of systemctl hangs.
Arch is home!
https://github.com/Docbroke
Offline
gpg-agent is starting as a user service. I was viewing the logs using
journalctl --user --user-unit=gpg-agent.serviceOutput of systemctl --user status gpg-agent.service:
● gpg-agent.service - GnuPG private key agent
Loaded: loaded (/home/travis/.config/systemd/user/gpg-agent.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2017-06-22 08:42:41 EDT; 5h 55min ago
Process: 11740 ExecStart=/usr/bin/gpg-agent --daemon (code=exited, status=2)
Jun 22 08:42:41 ffprime systemd[2471]: Starting GnuPG private key agent...
Jun 22 08:42:41 ffprime systemd[2471]: gpg-agent.service: Control process exited, code=exited status=2
Jun 22 08:42:41 ffprime systemd[2471]: Failed to start GnuPG private key agent.
Jun 22 08:42:41 ffprime systemd[2471]: gpg-agent.service: Unit entered failed state.
Jun 22 08:42:41 ffprime systemd[2471]: gpg-agent.service: Failed with result 'exit-code'.
Jun 22 08:42:41 ffprime systemd[2471]: gpg-agent.service: Start request repeated too quickly.
Jun 22 08:42:41 ffprime systemd[2471]: Failed to start GnuPG private key agent.
Jun 22 08:42:41 ffprime systemd[2471]: gpg-agent.service: Failed with result 'exit-code'.So gpg-agent is running, as I can encrypt/decrypt, but not currently as a systemd service.
It also appears that of all the .sockets listed in the wiki, only dirmngr.socket is actually running. I may do more troubleshooting tomorrow, but I'm out of time today.
Offline
ls ~/.config/systemd/user/Online
Thanks seth for pointing to the link.
Removing gpg-agent.service from .config/systemd/user solved the issue. The service was not even enabled but still it intereferes with /usr/lib/systemd/user/gpg-agent.service, which has probably appeared recently.
EDIT: I guess that as service file in home directory gets preference over one in the /usr/lib/systemd/user/, it lead to all this trouble. I am getting some idea why my hack was working, thanks again.
Last edited by Docbroke (2017-06-23 03:47:31)
Arch is home!
https://github.com/Docbroke
Offline