gpg-agent not running when needed by Déjà Dup

Bug #1700645 reported by James Budarz
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Déjà Dup
Invalid
Undecided
Unassigned
deja-dup (Ubuntu)
Invalid
Undecided
Unassigned
gnupg2 (Ubuntu)
New
Undecided
Unassigned

Bug Description

Some have reported problems before with repeated demands for encryption passwords, but mine gives a different error. I've deleted all my previous backups and reinstalled duplicity and deja-dup, but I still get the error:

DUPLICITY: . ===== Begin GnuPG log =====
DUPLICITY: . gpg: WARNING: "--no-use-agent" is an obsolete option - it has no effect
DUPLICITY: . gpg: invalid size of lockfile '/home/username/.gnupg/gnupg_spawn_agent_sentinel.lock'
DUPLICITY: . gpg: cannot read lockfile
DUPLICITY: . gpg: can't connect to the agent: Invalid argument
DUPLICITY: . gpg: problem with the agent: No agent running
DUPLICITY: . ===== End GnuPG log =====
DUPLICITY: .
DUPLICITY: .

DUPLICITY: ERROR 31 GPGError
DUPLICITY: . GPGError: GPG Failed, see log below:
DUPLICITY: . ===== Begin GnuPG log =====
DUPLICITY: . gpg: WARNING: "--no-use-agent" is an obsolete option - it has no effect
DUPLICITY: . gpg: invalid size of lockfile '/home/username/.gnupg/gnupg_spawn_agent_sentinel.lock'
DUPLICITY: . gpg: cannot read lockfile
DUPLICITY: . gpg: can't connect to the agent: Invalid argument
DUPLICITY: . gpg: problem with the agent: No agent running
DUPLICITY: . ===== End GnuPG log =====
DUPLICITY: .

System details:
Ubuntu 17.04
deja-dup 34.4-0ubuntu1
duplicity 0.7.06-2ubuntu3

Thank you in advance!

Tags: zesty
Revision history for this message
Vej (vej) wrote :

Hello James,

this problem might be related to your current installation of GPG.

So could you please give columns "Name" and "Version" from the output of "dpkg --list gpg*"?

Changed in deja-dup:
status: New → Incomplete
Revision history for this message
James Budarz (jimbudarz) wrote :

||/ Name Version Architecture Description
+++-==============-============-============-=================================
un gpg <none> <none> (no description available)
un gpg-agent <none> <none> (no description available)
un gpgsm <none> <none> (no description available)
ii gpgv 2.1.15-1ubun amd64 GNU privacy guard - signature ver
un gpgv1 <none> <none> (no description available)
un gpgv2 <none> <none> (no description available)

Thanks again.

Vej (vej)
Changed in deja-dup:
status: Incomplete → New
Revision history for this message
Vej (vej) wrote :

Hallo James.

Thanks for that output. There should be a background process running called gpg-agent.

Can you please check that using the command "ps x | grep gpg".

This should give you up to 3 lines of output.

The question is, if there is one including "gpg-agent --homedir /some/path/.gnupg --use-standard-socket --daemon". /some/path should be a path inside of the home directory of your user.

Best

Vej

Changed in deja-dup:
status: New → Incomplete
Revision history for this message
James Budarz (jimbudarz) wrote :

Hmm, no, my only output there is

24591 pts/1 S+ 0:00 grep --color=auto gpg

Thanks for following up.

James Budarz (jimbudarz)
description: updated
James Budarz (jimbudarz)
Changed in deja-dup:
status: Incomplete → New
Revision history for this message
Vej (vej) wrote :

Hello James,

that is interesting. It means, that your gpg-agent is not running.

So lets try to start it from a terminal and see if this gets Deja-Dup to work (please post every output of that command here for analysis – anonymised if needs be) :

     gpg-agent --daemon

If that does not throw an error message, please execute a verbose backup and provide us with the file /tmp/deja-dup.log

    DEJA_DUP_DEBUG=1 deja-dup --backup | tail -n 1000 > /tmp/deja-dup.log

Best Regards

Vej

Changed in deja-dup:
status: New → Incomplete
Vej (vej)
Changed in deja-dup (Ubuntu):
status: New → Incomplete
tags: added: zesty
Revision history for this message
James Budarz (jimbudarz) wrote :

The backup completed successfully once I manually started gpg-agent. I'm not sure if this is meant to be triggered by deja-dup. If so it remains a bug, otherwise I can close it and launch the daemon manually at boot.

Thanks for the help!

Revision history for this message
Vej (vej) wrote :

Hello James,

this should not be triggered by Déjà Dup, but by a combination of a file /etc/X11/Xsession.d/90gpg-agent together with an entry "use-agent" inside of ~/.gnupg/gpg.conf.

Can you check, if the file /etc/X11/Xsession.d/90gpg-agent does exist at your system and if your ~/.gnupg/gpg.conf does include use-agent please?

I will move this bug report over to the Downstream Triagers of the ubuntu package gnupg-agent, which may ask more questions about this.

Changed in deja-dup:
status: Incomplete → Invalid
Changed in deja-dup (Ubuntu):
status: Incomplete → Invalid
summary: - Encrypted backup repeatedly asks for password on first use
+ gnupg-agent not running when needed by Déjà Dup
summary: - gnupg-agent not running when needed by Déjà Dup
+ gpg-agent not running when needed by Déjà Dup
Revision history for this message
James Budarz (jimbudarz) wrote :

Thanks for everything, Vej.
To answer your questions, /etc/X11/Xsession.d/90gpg-agent does exist on my system and use-agent is enabled in ~/.gnupg/gpg.conf.

Revision history for this message
Tobias Barden (tobias+b) wrote :

Hello Vej,

I'm also affected from this bug.

System details:
Ubuntu 17.10
deja-dup 36.2-0ubuntu1
duplicity 0.7.12
gpgv 2.1.15-1ubuntu8

Same problem: gpg-agent was not running
But: ~/.gnupg/gpg.conf does not contain a use-agent statement (everything is commented out). As I was not able to find any reference on how the default gpg.conf file should look like, I'm note sure if this is supposed to or not.

Same solution: starting the agent manually solves the problem.

Kind regards

Revision history for this message
Josef Möllers (jmoellers) wrote :

'morning,
I'm also affected, I'm not sure since when as I only occasionally receive encrypted emails.

Ubuntu 16.04.5 LTS
gpgv 1.4.20-1ubuntu3.3
gnupg-agent 2.1.11-6ubuntu2.1

1) use-agent is active in ~/.gnupg/gpg.conf
2) gpg-agent fails to start due to a missing /run/usr/$UID/gnupg directory (/run/usr/$UID exists)
3) After repair ("mkdir /run/usr/$UID/gnupg"), gpg-agent starts automagically with these arguments: --homedir /home/josef/.gnupg --use-standard-socket --daemon, but still the socket is create in /run/user/UID/gnupg!
4) /etc/X11/Xsession.d/90gpg-agent exists
5) I use KDE (kde-baseapps-bin 4:15.12.3-0ubuntu1, though other KDE packages are 4:5.5.5-0ubuntu1).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.