gvm.errors.GvmError: Socket /var/run/gvmd.sock does not exist

Hello,

I’ve installed the gvm-tools (with pip3) but when I try to run the gvm-pyshell in socket mode I get this error:

gvm.errors.GvmError: Socket /var/run/gvmd.sock does not exist

Any hint about how to fix it?

"/opt/gvm/.local/bin/gvm-pyshell", line 10, in <module> sys.exit(main()) File "/opt/gvm/.local/lib/python3.7/site-packages/gvmtools/pyshell.py", line 134, in main with protocol_class(connection, transform=transform) as protocol: File "/opt/gvm/.local/lib/python3.7/site-packages/gvm/protocols/gmp.py", line 79, in __enter__ self.connect() File "/opt/gvm/.local/lib/python3.7/site-packages/gvm/protocols/base.py", line 107, in connect self._connection.connect() File "/opt/gvm/.local/lib/python3.7/site-packages/gvm/connections.py", line 353, in connect ) from None gvm.errors.GvmError: Socket /var/run/gvmd.sock does not exist

There is no gvmd.sock in the whole system. I can only see the ospd.sock:

root@8b480bba09e3:/# ls -l /opt/gvm/var/run/
total 12

-rw-r--r-- 1 root root 4 Jan  8 15:45 gsad.pid
-rw------- 1 gvm  gvm  0 Jan  2 11:56 gvm-checking
-rw------- 1 gvm  gvm  0 Jan  2 11:56 gvm-create-functions
-rw------- 1 gvm  gvm  0 Jan  2 11:56 gvm-helping
-rw------- 1 gvm  gvm  0 Jan  2 11:56 gvm-migrating
-rw------- 1 gvm  gvm  0 Jan  2 11:57 gvm-serving
-rw------- 1 gvm  gvm  4 Jan  8 15:46 gvmd.pid
-rw-r--r-- 1 gvm  gvm  3 Jan  8 15:45 ospd-openvas.pid
srwx------ 1 gvm  gvm  0 Jan  8 15:47 ospd.sock

It seems gvmd is running in some way:

root@8b480bba09e3:/# ps axjf
 PPID   PID  PGID   SID TTY      TPGID STAT   UID   TIME COMMAND
    0 25012 25012 25012 pts/0    26533 Ss       0   0:00 /bin/bash
25012 26533 26533 25012 pts/0    26533 R+       0   0:00  \_ ps axjf
    0     1     1     1 ?           -1 Ss       0   0:00 /bin/sh -c /entrypoint.sh
    1     6     1     1 ?           -1 S        0   0:00 /bin/bash /entrypoint.sh
    6   120     1     1 ?           -1 S        0   0:00  \_ tail -F /opt/gvm/var/log/gvm/gsad.log /opt/gvm/var/log/gvm/gvmd.log /opt/gvm/v
    1    26    26    26 ?           -1 Ssl    103   9:13 /usr/bin/redis-server 127.0.0.1:0
    1    58    55    55 ?           -1 S      104   0:12 /usr/lib/postgresql/11/bin/postgres -D /var/lib/postgresql/11/main -c config_file=
   58    60    60    60 ?           -1 Ss     104   0:11  \_ postgres: 11/main: checkpointer
   58    61    61    61 ?           -1 Ss     104   0:01  \_ postgres: 11/main: background writer
   58    62    62    62 ?           -1 Ss     104   0:22  \_ postgres: 11/main: walwriter
   58    63    63    63 ?           -1 Ss     104   0:01  \_ postgres: 11/main: autovacuum launcher
   58    64    64    64 ?           -1 Ss     104   0:19  \_ postgres: 11/main: stats collector
   58    65    65    65 ?           -1 Ss     104   0:00  \_ postgres: 11/main: logical replication launcher
   58   148   148   148 ?           -1 SLs    104   0:23  \_ postgres: 11/main: gvm gvmd [local] idle
   58 26530 26530 26530 ?           -1 Ss     104   0:00  \_ postgres: 11/main: gvm gvmd [local] idle
    1   101    99    99 ?           -1 S     1000   0:45 gvmd: Waiting for incoming connections
  101 26525    99    99 ?           -1 S     1000   0:00  \_ gvmd: Reloading NVTs
26525 26527    99    99 ?           -1 S     1000   0:00      \_ gvmd: OSP: Updating NVT cache

but the log refers only to ospd.sock:

root@8b480bba09e3:/# cat ./opt/gvm/var/log/gvm/gvmd.log | grep .sock
md manage:WARNING:2020-01-02 10h01.18 utc:217: manage_update_nvt_cache_osp: failed to connect to /opt/gvm/var/run/ospd.sock       
md manage:WARNING:2020-01-02 11h57.02 utc:195: manage_update_nvt_cache_osp: failed to connect to /opt/gvm/var/run/ospd.sock
md manage:WARNING:2020-01-02 11h57.12 utc:206: manage_update_nvt_cache_osp: failed to connect to /opt/gvm/var/run/ospd.sock
md manage:WARNING:2020-01-02 11h57.22 utc:211: manage_update_nvt_cache_osp: failed to connect to

Did you check other locations? it depends on your installation (check: https://readthedocs.org/projects/gvm-tools/downloads/pdf/latest/). Is your manager up and running?

1 Like

Yes it’s up and running. There is something I don’t understand: When is usually the socket created? During the installation? Or When the process starts?

My understanding is that the manager is responsible for creating it, depending on whether you use unix socket or tls authentication.

1 Like

Where the socket is created depends on your build parameters and settings for gvmd. If you want to adjust the socket location you can use

-c, --unix-socket=<filename>                  Listen on UNIX socket at <filename>.

The unix socket is created by gvmd after startup automatically.

2 Likes