Problem with socket : Connection refused

Hello, I had the same message last few days:

can’t connect to ‘socket:///home/user/.gnupg/log-socket’: Connexion refusée

No real help found on the Internet

Since migration from Leap15.6 to Tumbleweed, I had not tested gpg

In my ~/.gnupg directory, I had a file:

srwx------.  1 user users      0  8 oct.   2017 log-socket=
( strange name \`log-socket=\` )

I deleted it.

In the ~/.gnupg/gpg.conf file, I had the line:

log-file socket:///home/user/.gnupg/log-socket

I deleted the line.

gpg -v still complained …
I added instead the line:

log-file ~/.gnupg/log-file

By the way, the --homedir didn’t help.

Now it seems that everything is working (at least I hope and maybe it will help someone)

greetings

1 Like

@ursh15, likewise:

RokeJulianLockhart@Beedell:~$ cd $HOME/.gnupg
RokeJulianLockhart@Beedell:~/.gnupg$ ls -la | grep log-socket
srwxr-xr-x. 1 RokeJulianLockhart RokeJulianLockhart    0 Jun  4  2025 log-socket
RokeJulianLockhart@Beedell:~/.gnupg$ file log-socket
log-socket: socket

Consequently, I replaced what you advise:

diff --git a/home/RokeJulianLockhart/.gnupg/gpg.conf b/home/RokeJulianLockhart/.gnupg/gpg.conf
index a3b9917..803e161 100644
--- a/home/RokeJulianLockhart/.gnupg/gpg.conf
+++ b/home/RokeJulianLockhart/.gnupg/gpg.conf
@@ -4,7 +4,7 @@ default-key  EBF4DB0C403C4B2E
 ###+++--- GPGConf ---+++###
 utf8-strings
 debug-level basic
-log-file socket:///home/RokeJulianLockhart/.gnupg/log-socket
+log-file $HOME/.gnupg/log-file
 ###+++--- GPGConf ---+++### Wed 04 Jun 2025 11:01:22 BST
 # GPGConf edited this configuration file.
 # It will disable options before this marked block, but it will

Based upon its content, I wonder whether kgpg-25.12.1-1.fc43 is the cause.


That remediated it for me, too, per gpg -v:

  1. Previously

    can't connect to 'socket:///home/RokeJulianLockhart/.gnupg/log-socket': Connection refused
    ^C
    gpg: signal Interrupt caught ... exiting
    
  2. Subsequently

    2026-01-29 16:36:52 gpg[118983] enabled debug flags: memstat
    2026-01-29 16:36:52 gpg[118983] enabled compatibility flags:
    2026-01-29 16:36:52 gpg[118983] WARNING: no command supplied.  Trying to guess what you mean ...
    2026-01-29 16:36:52 gpg[118983] Go ahead and type your message ...
    ^C
    gpg: signal Interrupt caught ... exiting
    

Thanks.