You are not logged in.

#1 2024-06-02 16:48:04

zpg443
Member
Registered: 2016-12-03
Posts: 300

[SOLVED] GnuPG log-socket Connection refused

When importing a public key, the resulting message is:

can't connect to 'socket:///home/lpc123/.gnupg/log-socket': Connection refused

So, after killing dirmngr.socket and restarting , it did not change anything. I did not find anything addressing this issue in the wiki for GnuPG under troubleshooting, and searched other forums, so not sure what to check for next. Even with debug flags, no other info is provided.

systemctl --user status dirmngr
● dirmngr.service - GnuPG network certificate management daemon
     Loaded: loaded (/usr/lib/systemd/user/dirmngr.service; static)
     Active: active (running) since Sun 2024-06-02 11:14:27 CDT; 19min ago
TriggeredBy: ● dirmngr.socket
       Docs: man:dirmngr(8)
   Main PID: 50609 (dirmngr)
      Tasks: 1 (limit: 18801)
     Memory: 18.5M (peak: 20.5M)
        CPU: 59ms
     CGroup: /user.slice/user-1000.slice/user@1000.service/app.slice/dirmngr.service
             └─50609 /usr/bin/dirmngr --supervised

Jun 02 11:14:27 archmain systemd[704]: Started GnuPG network certificate management daemon.
Jun 02 11:14:27 archmain dirmngr[50609]: dirmngr[50609]: enabled debug flags: x509 crypto cache ipc lookup

dirmngr.conf

keyserver hkp://pool.sks-keyservers.net
keyserver hkps://keys.openpgp.org
keyserver hkp://pgp.mit.edu:11371
keyserver hkp://jirk5u4osbsr34t5.onion

###+++--- GPGConf ---+++###
debug-level basic
log-file socket:///home/lpc123/.gnupg/log-socket

gpg-agent.conf

 disable-scdaemon

gpg.conf

default-key  ##############

keyserver hkp://pool.sks-keyservers.net
keyserver hkps://keys.openpgp.org
keyserver hkp://pgp.mit.edu:11371

###+++--- GPGConf ---+++###
utf8-strings
debug-level basic
log-file socket:///home/lpc123/.gnupg/log-socket

Last edited by zpg443 (2024-06-02 21:13:37)

Offline

#2 2024-06-02 21:13:06

zpg443
Member
Registered: 2016-12-03
Posts: 300

Re: [SOLVED] GnuPG log-socket Connection refused

I figured out using Chat-GPT, that logfile names in the .conf were not correct (should read .gnupg/gpg.log and .gnupg/dirmngr.log). It does does solve the key validation problem (I am taking it up with the owner), but it does fix this issue. Marking solved.

Last edited by zpg443 (2024-06-02 21:15:27)

Offline

#3 2024-07-11 01:07:27

scoronado
Member
Registered: 2020-06-13
Posts: 1

Re: [SOLVED] GnuPG log-socket Connection refused

zpg443 wrote:

I figured out using Chat-GPT, that logfile names in the .conf were not correct (should read .gnupg/gpg.log and .gnupg/dirmngr.log). It does does solve the key validation problem (I am taking it up with the owner), but it does fix this issue. Marking solved.


Can you please post the edits to the files you've made? I otherwise wouldn't know what fixed this issue.

Offline

#4 2024-08-16 13:30:31

jongeduard
Member
Registered: 2022-01-06
Posts: 16

Re: [SOLVED] GnuPG log-socket Connection refused

EDIT: Turns out the actual import succeeds anyway my case, even though it displays the error.

I have no idea how these things exactly work, I am using KDE Plasma and I have configured KGPG and KWallet stuff to store keys and and manage passwords safely.

After all that there is living a ton more stuff inside my ~/.gnupg/ directory, and I am also running into this same error.

There was a 0 bytes sized file called log-socket in the directory too, after removing it, and trying to run the `gpg --recv-keys` command again the error changed into another, error namely that log-socket did not exist.
Recreating this file manually makes it show the original error again.

I believe the problem is that the file is not an actual socket/pipe but just a regular empty file. So there's nobody listening to connect basically.
This same path to this logfile is configured in multipe *.conf files in the directory, by a line `log-file socket:///home/<user>/.gnupg/log-socket`

At least if I remove gpg.conf, one file which also contains it, the error goes away and the import finishes succesfully, so this file is clearly overriding defaults that otherwise don't cause a problem.

The problem: those files are autogenerated by the KDE software in my case, and KGPG generates an error on startup if it misses gpg.conf
So I am rather trying to find out where KDE has configured all this and what's the purpose of that log-socket file.
E.g. should another program have a pipe open and listen to logging messages?

Last edited by jongeduard (2024-08-16 13:45:02)

Offline

#5 2024-12-29 05:48:35

Analog Linux User
Member
Registered: 2024-11-28
Posts: 4

Re: [SOLVED] GnuPG log-socket Connection refused

I can confirm the workaround provided by user jongeduard:

Only if I delete - or in my case rename the file ~/.gnupg/gpg.conf to something like ~/.gnupg/gpg.conf_DISABLED - then the command

$ gpg --verify <file name>.asc|sig <file to be checked>

gets executed as expected if I execute this command directly after the deletion/disabling of the gpg.conf file, not anymore returning the error message:

can't connect to 'socket:///home/<User Name>/.gnupg/<any log file name>.log': Connection refused

I also have KDE installed on my Arch Linux system as the only Desktop Environment, but I haven´t installed the kwalletmanager package.

I did not check yet what will happen if I execute this command again after a re-login into KDE.

Update:

This happens directly after the next login into KDE - the following error message gets displayed in a window on the Desktop:

Error - KGpg:

An error occured while scanning your keyring.

Details:

gpg: option file '/home/<User Name>/.gnupg/gpg.conf': No such file or directory

So we do not have a solution for this problem yet, but "only" a workaround.

Last edited by Analog Linux User (2024-12-29 05:56:25)

Offline

Board footer

Powered by FluxBB