Page MenuHome GnuPG

dirmngr fails when started from gpg2 --homedir <something>
Closed, ResolvedPublic

Description

When using gpg2 to download a key from a keyserver, it autostarts dirmngr if not running.

If you pass in --homedir <something> to gpg2, gpg2 respects that, but not dirmngr which tries to use the default ~/.gnupg (which may not exist).

Eventually things fail with an IPC connect call failed.

Example:

/usr/local/bin/gpg2 --homedir /Users/mmucklo/somewhere --verbose --keyserver keys.gnupg.net --recv-keys ABCD1233
gpg: no running Dirmngr - starting '/usr/local/bin/dirmngr'
gpg: waiting for the dirmngr to come up ... (5s)
gpg: waiting for the dirmngr to come up ... (4s)
gpg: waiting for the dirmngr to come up ... (3s)
gpg: waiting for the dirmngr to come up ... (2s)
gpg: waiting for the dirmngr to come up ... (1s)
gpg: connecting dirmngr at '/Users/mmucklo/.gnupg/S.dirmngr' failed: IPC connect call failed
gpg: keyserver receive failed: No dirmngr
Can't import key for ABCD1234 from keyserver keys.gnupg.net

Now if you do the following:

mkdir ~/.gnupg; chmod 700 ~/.gnupg

  1. And rerun the command, it starts to work

Details

Version
2.1.9

Event Timeline

mmucklo set Version to 2.1.9.
mmucklo added a subscriber: mmucklo.

A workaround is to use

GNUPGHOME=<something> gpg2 ...

so that Dirmngr also seen GNUPGHOME. I'll look into this bug. Thanks for
reporting.

marcus claimed this task.
marcus added a subscriber: marcus.

This works now, there have been many changes in how homedir is handled since then. For example 70a8584ec4389209762eb65bb77f20f7881577be and aab8a0b05292b0d06e3001a0b289224cb7156dbd, among many others.