You are not logged in.

#1 2017-06-10 10:26:54

KarlP
Member
From: Vorderstoder, AUSTRIA
Registered: 2015-01-01
Posts: 31

[Solved] gpg-agent.service entered failed state

This morning I have encountered an error message during update.

"systemd-modules-load.service failed"

grep -i 2017-06-10 /var/log/pacman.log | grep -i scriptlet
[2017-06-10 09:48] [ALPM-SCRIPTLET] ==> dkms remove frandom/1.1 -k 4.9.30-1-lts
[2017-06-10 09:49] [ALPM-SCRIPTLET] Created symlink /etc/systemd/user/sockets.target.wants/dirmngr.socket → /usr/lib/systemd/user/dirmngr.socket.
[2017-06-10 09:49] [ALPM-SCRIPTLET] Created symlink /etc/systemd/user/sockets.target.wants/gpg-agent.socket → /usr/lib/systemd/user/gpg-agent.socket.
[2017-06-10 09:49] [ALPM-SCRIPTLET] Created symlink /etc/systemd/user/sockets.target.wants/gpg-agent-browser.socket → /usr/lib/systemd/user/gpg-agent-browser.socket.
[2017-06-10 09:49] [ALPM-SCRIPTLET] Created symlink /etc/systemd/user/sockets.target.wants/gpg-agent-extra.socket → /usr/lib/systemd/user/gpg-agent-extra.socket.
[2017-06-10 09:49] [ALPM-SCRIPTLET] Created symlink /etc/systemd/user/sockets.target.wants/gpg-agent-ssh.socket → /usr/lib/systemd/user/gpg-agent-ssh.socket.
[2017-06-10 09:51] [ALPM-SCRIPTLET] >>> Updating module dependencies. Please wait ...
[2017-06-10 09:52] [ALPM-SCRIPTLET] ==> dkms install frandom/1.1 -k 4.9.31-1-lts
[2017-06-10 09:53] [ALPM-SCRIPTLET] Job for systemd-modules-load.service failed because the control process exited with error code.
[2017-06-10 09:53] [ALPM-SCRIPTLET] See "systemctl status systemd-modules-load.service" and "journalctl -xe" for details.
[2017-06-10 09:53] [ALPM-SCRIPTLET] ==> Building image

Since then I get the error message "gpg-agent.service Unit entered failed state".

$ cat /var/log/pacman.log | grep -i service | grep -i fail
[2017-06-10 09:53] [ALPM-SCRIPTLET] Job for systemd-modules-load.service failed because the control process exited with error code.

$ journalctl -S 2017-06-10 | grep -i service | grep -i fail | head -n 5
Jun 10 09:53:54 evo063 systemd[1]: systemd-modules-load.service: Main process exited, code=exited, status=1/FAILURE
Jun 10 09:53:54 evo063 systemd[1]: systemd-modules-load.service: Unit entered failed state.
Jun 10 09:53:54 evo063 systemd[1]: systemd-modules-load.service: Failed with result 'exit-code'.
Jun 10 10:32:15 evo063 systemd[309]: gpg-agent.service: Unit entered failed state.
Jun 10 10:32:15 evo063 systemd[309]: gpg-agent.service: Failed with result 'timeout'.

$ journalctl -S 2017-06-10 | grep -i service | grep -i fail | tail -n 5
Jun 10 11:44:17 evo063 systemd[309]: gpg-agent.service: Failed with result 'timeout'.
Jun 10 11:45:48 evo063 systemd[309]: gpg-agent.service: Unit entered failed state.
Jun 10 11:45:48 evo063 systemd[309]: gpg-agent.service: Failed with result 'timeout'.
Jun 10 11:47:18 evo063 systemd[309]: gpg-agent.service: Unit entered failed state.
Jun 10 11:47:18 evo063 systemd[309]: gpg-agent.service: Failed with result 'timeout'.

systemd now perpetuates to restart gpg-agent.service but fails.

Has somebody an idea what went wrong?

Last edited by KarlP (2017-06-10 13:32:01)

Offline

#2 2017-06-10 11:19:01

woodape
Member
Registered: 2015-03-25
Posts: 159

Re: [Solved] gpg-agent.service entered failed state

I think I've had the same issue, unfortunatly I haven't been able to find a fix either.

If anyone has had problems booting into X and configures gpg-agent to be the ssh-agent as per the wiki (here), my bashrc was hanging because of the gpg-connect-agent part and and stopped X from starting. I was able to get into X by commenting out the gpp part in another tty.

I have similar lines in my pacman log, but no dkms errors - I'm using the normal kernel not the lts:

[2017-06-09 22:24] [ALPM] upgraded gnupg (2.1.21-1 -> 2.1.21-2)
[2017-06-09 22:24] [ALPM-SCRIPTLET] Created symlink /etc/systemd/user/sockets.target.wants/dirmngr.socket → /usr/lib/systemd/user/dirmngr.socket.
[2017-06-09 22:24] [ALPM-SCRIPTLET] Created symlink /etc/systemd/user/sockets.target.wants/gpg-agent.socket → /usr/lib/systemd/user/gpg-agent.socket.
[2017-06-09 22:24] [ALPM-SCRIPTLET] Created symlink /etc/systemd/user/sockets.target.wants/gpg-agent-browser.socket → /usr/lib/systemd/user/gpg-agent-browser.socket.
[2017-06-09 22:24] [ALPM-SCRIPTLET] Created symlink /etc/systemd/user/sockets.target.wants/gpg-agent-extra.socket → /usr/lib/systemd/user/gpg-agent-extra.socket.
[2017-06-09 22:24] [ALPM-SCRIPTLET] Created symlink /etc/systemd/user/sockets.target.wants/gpg-agent-ssh.socket → /usr/lib/systemd/user/gpg-agent-ssh.socket.

I tried downgrading to a previous gnupg version as well:

[2017-06-10 12:27] [PACMAN] Running 'pacman -U gnupg-2.1.18-2-x86_64.pkg.tar.xz'
[2017-06-10 12:27] [ALPM] transaction started
[2017-06-10 12:27] [ALPM] downgraded gnupg (2.1.21-2 -> 2.1.18-2)
[2017-06-10 12:27] [ALPM] transaction completed
[2017-06-10 12:27] [ALPM] running 'systemd-update.hook'...
[2017-06-10 12:27] [ALPM] running 'texinfo-install.hook'...

But I get the same issue, which makes me suspect something else is going on. Here's my full pacman log from that same upgrade:

[2017-06-09 22:21] [PACMAN] Running 'pacman --color auto -S --noconfirm -u'
[2017-06-09 22:21] [PACMAN] starting full system upgrade
[2017-06-09 22:24] [ALPM] transaction started
[2017-06-09 22:24] [ALPM] upgraded npth (1.4-1 -> 1.5-1)
[2017-06-09 22:24] [ALPM] upgraded gnutls (3.5.12-1 -> 3.5.13-1)
[2017-06-09 22:24] [ALPM] upgraded sqlite (3.19.2-2 -> 3.19.3-1)
[2017-06-09 22:24] [ALPM] upgraded gnupg (2.1.21-1 -> 2.1.21-2)
[2017-06-09 22:24] [ALPM-SCRIPTLET] Created symlink /etc/systemd/user/sockets.target.wants/dirmngr.socket → /usr/lib/systemd/user/dirmngr.socket.
[2017-06-09 22:24] [ALPM-SCRIPTLET] Created symlink /etc/systemd/user/sockets.target.wants/gpg-agent.socket → /usr/lib/systemd/user/gpg-agent.socket.
[2017-06-09 22:24] [ALPM-SCRIPTLET] Created symlink /etc/systemd/user/sockets.target.wants/gpg-agent-browser.socket → /usr/lib/systemd/user/gpg-agent-browser.socket.
[2017-06-09 22:24] [ALPM-SCRIPTLET] Created symlink /etc/systemd/user/sockets.target.wants/gpg-agent-extra.socket → /usr/lib/systemd/user/gpg-agent-extra.socket.
[2017-06-09 22:24] [ALPM-SCRIPTLET] Created symlink /etc/systemd/user/sockets.target.wants/gpg-agent-ssh.socket → /usr/lib/systemd/user/gpg-agent-ssh.socket.
[2017-06-09 22:24] [ALPM] upgraded vim-runtime (8.0.0586-2 -> 8.0.0628-1)
[2017-06-09 22:24] [ALPM] upgraded gvim (8.0.0586-2 -> 8.0.0628-1)
[2017-06-09 22:24] [ALPM] upgraded lib32-alsa-lib (1.1.4-1 -> 1.1.4.1-1)
[2017-06-09 22:24] [ALPM] upgraded openal (1.17.2-2 -> 1.18.0-1)
[2017-06-09 22:24] [ALPM] upgraded lib32-openal (1.17.2-1 -> 1.18.0-1)
[2017-06-09 22:24] [ALPM] upgraded libtar (1.2.20-2 -> 1.2.20-3)
[2017-06-09 22:24] [ALPM] upgraded nodejs (8.0.0-1 -> 8.1.0-1)
[2017-06-09 22:24] [ALPM] installed pcre2 (10.23-1)
[2017-06-09 22:24] [ALPM] installed double-conversion (2.0.1-3)
[2017-06-09 22:24] [ALPM] upgraded qt5-base (5.8.0-12 -> 5.9.0-2)
[2017-06-09 22:24] [ALPM] upgraded pyqt5-common (5.8.2-2 -> 5.8.2-3)
[2017-06-09 22:24] [ALPM] upgraded python-chardet (3.0.3-1 -> 3.0.4-1)
[2017-06-09 22:24] [ALPM] upgraded python-pyqt5 (5.8.2-2 -> 5.8.2-3)
[2017-06-09 22:24] [ALPM] upgraded qt5-xmlpatterns (5.8.0-1 -> 5.9.0-1)
[2017-06-09 22:24] [ALPM] upgraded qt5-declarative (5.8.0-2 -> 5.9.0-1)
[2017-06-09 22:24] [ALPM] upgraded qt5-3d (5.8.0-1 -> 5.9.0-1)
[2017-06-09 22:24] [ALPM] upgraded qt5-location (5.8.0-1 -> 5.9.0-1)
[2017-06-09 22:24] [ALPM] upgraded qt5-multimedia (5.8.0-1 -> 5.9.0-1)
[2017-06-09 22:24] [ALPM] upgraded qt5-script (5.8.0-1 -> 5.9.0-1)
[2017-06-09 22:24] [ALPM] upgraded qt5-sensors (5.8.0-1 -> 5.9.0-1)
[2017-06-09 22:24] [ALPM] upgraded qt5-svg (5.8.0-1 -> 5.9.0-1)
[2017-06-09 22:24] [ALPM] upgraded qt5-tools (5.8.0-1 -> 5.9.0-1)
[2017-06-09 22:24] [ALPM] upgraded qt5-webchannel (5.8.0-1 -> 5.9.0-1)
[2017-06-09 22:25] [ALPM] upgraded qt5-webengine (5.8.0-9 -> 5.9.0-1)
[2017-06-09 22:25] [ALPM] upgraded qt5-webkit (5.8.0-3 -> 5.9.0-1)
[2017-06-09 22:25] [ALPM] upgraded qt5-x11extras (5.8.0-1 -> 5.9.0-1)
[2017-06-09 22:25] [ALPM] upgraded tint2 (0.14.4-1 -> 0.14.5-1)
[2017-06-09 22:25] [ALPM] upgraded wxgtk-common (3.0.3.1-3 -> 3.0.3.1-4)
[2017-06-09 22:25] [ALPM] upgraded wxgtk2 (3.0.3.1-3 -> 3.0.3.1-4)
[2017-06-09 22:25] [ALPM] upgraded xf86-video-intel (1:2.99.917+772+gc72bb27a-1 -> 1:2.99.917+777+g6babcf15-1)
[2017-06-09 22:25] [ALPM] transaction completed
[2017-06-09 22:25] [ALPM] running 'gtk-update-icon-cache.hook'...
[2017-06-09 22:25] [ALPM] running 'systemd-update.hook'...
[2017-06-09 22:25] [ALPM] running 'texinfo-install.hook'...
[2017-06-09 22:25] [ALPM] running 'update-desktop-database.hook'...
[2017-06-09 22:25] [ALPM] running 'update-mime-database.hook'...

When I try and decrypt a file I previously encrypted I get the following in my terminal, plus a hang forever:

$ gpg --verbose -d file.gpg
gpg: skipped packet of type 12 in keybox #This 8 times and a hang

Running gpg-agent in a terminal, even with a verbose flag results in a hang that doesn't go away and no terminal output.  Journalctl only reports:

Jun 10 13:10:50 banana systemd[489]: Starting GnuPG private key agent...

And thats it.

Also looking for help. Thanks in advance.

Offline

#3 2017-06-10 11:45:41

woodape
Member
Registered: 2015-03-25
Posts: 159

Re: [Solved] gpg-agent.service entered failed state

I might have gotten to the bottom of my issue. Looks like I was starting gpg-agent in multiple places...(woops). I had an 'eval $(gpg-agent --daemon)' in my .xinitrc as well as the systemd user service. I commented out the .xinitrc part and rebooted and was able to use gpg again.

KarlP, how do you start the gpg-agent?

Last edited by woodape (2017-06-10 11:46:36)

Offline

#4 2017-06-10 12:25:19

KarlP
Member
From: Vorderstoder, AUSTRIA
Registered: 2015-01-01
Posts: 31

Re: [Solved] gpg-agent.service entered failed state

As far as I understand, this is done by ./.config/systemd/user/gpg-agent.service, correct?
There is no "eval" in my .xinitrc.


$ grep -v -i '#' ~/.xinitrc
exec startlxde


$ cat ./.config/systemd/user/gpg-agent.service
# ~/.config/systemd/user/gpg-agent.service

[Unit]
Description=GnuPG private key agent
IgnoreOnIsolate=true

[Service]
Type=forking
ExecStart=/usr/bin/gpg-agent --daemon
Restart=on-abort

[Install]
WantedBy=default.target

Offline

#5 2017-06-10 12:47:49

woodape
Member
Registered: 2015-03-25
Posts: 159

Re: [Solved] gpg-agent.service entered failed state

I had the same systemd user file. I should have mentioned that I also moved that file to "gpg-agent.service.bak" and disabled it with "systemctl --user disable gpg-agent.service". Looking at the pacman logs, I see that there are symlinks made to "/usr/lib/systemd/user" - I never noticed that they were there before this upgrade, and I'm not sure they were.

Maybe try backing up the gpg-agent.service file in your personal .config/systemd folder and disable it like I did, I think these new links are starting the daemon. Looking in /usr/lib/systemd/user/gpg-agent.service, it has:

ExecStart=/usr/bin/gpg-agent --supervised

and doing "systemctl --user status" I have:

           ├─gpg-agent.service
           │ └─773 /usr/bin/gpg-agent --supervised

in there, which is this new code, not the one you and I had in our ".config" folder. Maybe this is what caused the error?

Offline

#6 2017-06-10 13:31:03

KarlP
Member
From: Vorderstoder, AUSTRIA
Registered: 2015-01-01
Posts: 31

Re: [Solved] gpg-agent.service entered failed state

That was it!
:-)

Thanks a lot.

Offline

#7 2017-06-10 13:38:59

woodape
Member
Registered: 2015-03-25
Posts: 159

Re: [Solved] gpg-agent.service entered failed state

No prob! It looks like the wiki just got an update in the systemd section as well.

Offline

#8 2017-06-11 18:51:26

fermi
Member
Registered: 2017-03-16
Posts: 6

Re: [Solved] gpg-agent.service entered failed state

I'm having a similar issue, which appeared after upgrading to gnupg 2.1.21-2 (same with 2.1.21-3) [https://bugs.archlinux.org/task/54396].
I see the following errors:
"pam_systemd(sshd:session): Failed to create session: Connection timed out",
"user@1000.service: Failed with result 'timeout'", ...

I only have one service in  ~/.config/systemd/user/ which is totally unrelated to the gnupg service.

It's an intermittent issue, during several reboots my user service starts fine, no errors, during other attempts, the errors pop up, and the user service isn't started.
What I also see is in case the service isn't started the log file is flooded with:
systemd-resolved[265]: Switching to DNS server ... for interface wlan0 messages ...

The fact that this is intermittent: race condition?
Are we looking at the same issue here? Or do I have to explore in another direction?

Thanks,

/fermi

Last edited by fermi (2017-06-11 18:54:45)

Offline

#9 2017-06-12 11:21:14

woodape
Member
Registered: 2015-03-25
Posts: 159

Re: [Solved] gpg-agent.service entered failed state

I think this is a separate issue, this thread is was about the gpg-agent having changed the way it starts up per user. I didn't get any DNS server issues. If your issue is totally unrelated to starting gnupg as a systemd user service as you say, you should start a new thread. When you make a new thread, you might want to post the pacman log showing which packages were also upgraded with gnupg. Good luck!

Offline

#10 2017-06-12 11:39:53

DaveJ
Member
Registered: 2015-08-26
Posts: 6

Re: [Solved] gpg-agent.service entered failed state

nice. that actually helped.

I presume, systemd cannot handle the same service filename twice? because of the broken bus (logind fails as of timeout), i was not able to actually disable the service, but moving my custom script allowed systemd to use the /etc/... one. still, one would think, that systemd should be able to handle multiple occurences of the same filename...

Offline

#11 2017-06-13 03:29:02

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: [Solved] gpg-agent.service entered failed state

Thank you. This was why I could not log in to my system as myself. (That I solved, but only by disabling the SSH agent I use.)

I got into my system by deleting a file in /etc/profile.d which ran

if [ `whoami` != "root" ]
then
        /usr/bin/gpg-connect-agent /bye
fi

To get GPG/SSH working again, I needed to delete the link to the user .service file, as others have said.

Maybe note, too, that if you used a customised .service file, you need to make sure that gpg-agent.conf includes the equivalent lines. This was already true for me, because - I think - GPG on Arch used to be configured this way and then I needed to switch to the user .service. So not everyone may have this. For example, I was using the following .service file:

.gnupg/gpg-agent.service
[Unit]
Description=GnuPG private key agent
IgnoreOnIsolate=true

[Service]
Type=forking
ExecStart=/usr/bin/gpg-agent --daemon --homedir=%h/.gnupg -s --enable-ssh-support --pinentry-program /usr/bin/pinentry-qt
ExecStop=/usr/bin/pkill gpg-agent
Restart=on-abort

[Install]
WantedBy=multi-user.target

# vim: set nospell:

The following lines in gpg-agent.conf seem to be doing the trick, just as they did before I switched to the user .service file.

pinentry-program /usr/bin/pinentry-qt
enable-ssh-support

I figure I'll hang onto the custom .service file for next time they change the way this is done!

Last edited by cfr (2017-06-13 03:31:58)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

Board footer

Powered by FluxBB