Ospd-openvas & gsad are inactive (dead)

Hi everyone !!

I’ve installed OpenVAS v23.8.2 on Ubuntu 22.04 using this guide and during the process I didn’t get any errors at all !

At the end of the process when I tried to start all 4 services I got the following errors for the two of them :

ubuntu@fb-openvas:/$ sudo systemctl status ospd-openvas
sudo systemctl status gsad
○ ospd-openvas.service - OSPd Wrapper for the OpenVAS Scanner (ospd-openvas)
     Loaded: loaded (/etc/systemd/system/ospd-openvas.service; enabled; vendor preset: enabled)
     Active: inactive (dead) since Wed 2024-09-11 16:40:51 UTC; 1min 4s ago
   Main PID: 84989 (code=exited, status=0/SUCCESS)
        CPU: 2.558s

Sep 11 16:40:47 fb-openvas systemd[1]: Started OSPd Wrapper for the OpenVAS Scanner (ospd-openvas).
Sep 11 16:40:49 fb-openvas ospd-openvas[85008]: OSPD[84989] INFO: (ospd.main) Starting OSPd OpenVAS version 22.7.1.
Sep 11 16:40:50 fb-openvas ospd-openvas[85008]: OSPD[84989] INFO: (ospd.main) Shutting-down server ...
Sep 11 16:40:51 fb-openvas systemd[1]: ospd-openvas.service: Deactivated successfully.
Sep 11 16:40:51 fb-openvas systemd[1]: ospd-openvas.service: Consumed 2.558s CPU time.
○ gsad.service - Greenbone Security Assistant daemon (gsad)
     Loaded: loaded (/etc/systemd/system/gsad.service; enabled; vendor preset: enabled)
     Active: inactive (dead) since Wed 2024-09-11 16:40:48 UTC; 1min 7s ago
   Main PID: 84998 (code=exited, status=0/SUCCESS)
        CPU: 101ms

Sep 11 16:40:48 fb-openvas systemd[1]: Started Greenbone Security Assistant daemon (gsad).
Sep 11 16:40:48 fb-openvas systemd[1]: gsad.service: Deactivated successfully.

I’ve tried almost everything but nothing seems to work or fix the issue.
Thanks in advanced for the helpers !!

You can use journalctl to troubleshoot why the services shutdown instead of continuing to run. Maybe caused by a misconfiguration or memory exhaustion.

journalctl -u ospd-openvas.service
journalctl -u gsad.service

If you having trouble managing the source-code install, you can try the Greenbone Free virtual machine, which will take some of the effort out of maintaining an instance of Greenbone.

2 Likes

Hi @rippledj, thanks for replying !!
It seems like the errors coming from ‘ospd-openvas.service’ are :

Sep 09 16:31:30 fb-openvas systemd[1]: Failed to start OSPd Wrapper for the OpenVAS Scanner (ospd-openvas).
Sep 09 16:31:30 fb-openvas systemd[1]: ospd-openvas.service: Consumed 1.546s CPU time.
Sep 09 16:32:30 fb-openvas systemd[1]: ospd-openvas.service: Scheduled restart job, restart counter is at 3.
Sep 09 16:32:30 fb-openvas systemd[1]: Stopped OSPd Wrapper for the OpenVAS Scanner (ospd-openvas).
Sep 09 16:32:30 fb-openvas systemd[1]: ospd-openvas.service: Consumed 1.546s CPU time.
Sep 09 16:32:32 fb-openvas systemd[1]: Starting OSPd Wrapper for the OpenVAS Scanner (ospd-openvas)...
Sep 09 16:32:59 fb-openvas systemd[1]: ospd-openvas.service: Control process exited, code=exited, status=1/FAILURE
Sep 09 16:32:59 fb-openvas systemd[1]: ospd-openvas.service: Failed with result 'exit-code'.
-------------------------------------------------------
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]: Traceback (most recent call last):
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]:   File "/usr/lib/python3/dist-packages/redis/connection.py", line 1198, in get_connection
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]:     if connection.can_read():
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]:   File "/usr/lib/python3/dist-packages/redis/connection.py", line 734, in can_read
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]:     return self._parser.can_read(timeout)
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]:   File "/usr/lib/python3/dist-packages/redis/connection.py", line 321, in can_read
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]:     return self._buffer and self._buffer.can_read(timeout)
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]:   File "/usr/lib/python3/dist-packages/redis/connection.py", line 230, in can_read
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]:     self._read_from_socket(timeout=timeout,
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]:   File "/usr/lib/python3/dist-packages/redis/connection.py", line 201, in _read_from_socket
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]:     raise ConnectionError(SERVER_CLOSED_CONNECTION_ERROR)
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]: redis.exceptions.ConnectionError: Connection closed by server.
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]: During handling of the above exception, another exception occurred:
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]: Traceback (most recent call last):
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]:   File "/usr/lib/python3/dist-packages/redis/connection.py", line 559, in connect
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]:     sock = self._connect()
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]:   File "/usr/lib/python3/dist-packages/redis/connection.py", line 911, in _connect
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]:     sock.connect(self.path)
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]: FileNotFoundError: [Errno 2] No such file or directory
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]: During handling of the above exception, another exception occurred:
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]: Traceback (most recent call last):
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]:   File "/usr/bin/ospd-openvas", line 8, in <module>
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]:     sys.exit(main())
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]:   File "/usr/lib/python3/dist-packages/ospd_openvas/daemon.py", line 1264, in main
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]:     daemon_main('OSPD - openvas', OSPDopenvas, NotusParser())
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]:   File "/usr/lib/python3/dist-packages/ospd/main.py", line 165, in main
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]:     daemon.run()
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]:   File "/usr/lib/python3/dist-packages/ospd/ospd.py", line 1115, in run
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]:     self.scheduler()
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]:   File "/usr/lib/python3/dist-packages/ospd_openvas/daemon.py", line 723, in scheduler
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]:     self.check_feed()
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]:   File "/usr/lib/python3/dist-packages/ospd_openvas/daemon.py", line 697, in check_feed
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]:     current_feed = self.nvti.get_feed_version()
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]:   File "/usr/lib/python3/dist-packages/ospd_openvas/nvticache.py", line 84, in get_feed_version
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]:     return OpenvasDB.get_single_item(self.ctx, NVTI_CACHE_NAME)
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]:   File "/usr/lib/python3/dist-packages/ospd_openvas/db.py", line 274, in get_single_item
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]:     return ctx.lindex(name, index)
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]:   File "/usr/lib/python3/dist-packages/redis/client.py", line 1939, in lindex
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]:     return self.execute_command('LINDEX', name, index)
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]:   File "/usr/lib/python3/dist-packages/redis/client.py", line 898, in execute_command
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]:     conn = self.connection or pool.get_connection(command_name, **options)
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]:   File "/usr/lib/python3/dist-packages/redis/connection.py", line 1202, in get_connection
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]:     connection.connect()
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]:   File "/usr/lib/python3/dist-packages/redis/connection.py", line 563, in connect
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]:     raise ConnectionError(self._error_message(e))
Sep 09 17:57:44 fb-openvas ospd-openvas[33198]: redis.exceptions.ConnectionError: Error 2 connecting to unix socket: /run/redis/redis.sock. No such file or d>
Sep 09 17:57:45 fb-openvas ospd-openvas[33198]: Exception ignored in atexit callback: <function exit_cleanup at 0x7f2a9d950040>
Sep 09 17:57:45 fb-openvas ospd-openvas[33198]: Traceback (most recent call last):
Sep 09 17:57:45 fb-openvas ospd-openvas[33198]:   File "/usr/lib/python3/dist-packages/ospd/main.py", line 86, in exit_cleanup
Sep 09 17:57:45 fb-openvas ospd-openvas[33198]:     sys.exit()
Sep 09 17:57:45 fb-openvas ospd-openvas[33198]: SystemExit:

while the service gsad.service has no errors.

Also, I’m currently trying the OVA if thats gonna work that might be even better than fixing the server !

The logs indicate that OSPd is trying to connect to Redis through a Unix socket (/run/redis/redis.sock), but the socket file is missing (No such file or directory). This suggests that the Redis service, which OSPd relies on, is either not running or is misconfigured.

Sure, I recommend running the virtual machine for ease of use. :slight_smile:

1 Like

Geez bruh, it worked !
I had to the same thing pretty much to the rest of the errors popped out and it fixed the issue !!

Much much much appreciated !