Ospd-openvas does not start with Kali Linux install

Continuing the discussion from Latest version on kali fails to start:

I have a similar problem, I think is a bit different. Please anyone can help me to solve it? I am a new practitioner. Thanks

sudo systemctl restart ospd-openvas
[sudo] password for kali:
Job for ospd-openvas.service failed because the control process exited with error code.
See “systemctl status ospd-openvas.service” and “journalctl -xeu ospd-openvas.service” for details.
❯ journalctl -xeu ospd-openvas.service -o cat
File “/usr/lib/python3/dist-packages/ospd/parser.py”, line 302, in parse_arguments
self._set_defaults(_args.config)
File “/usr/lib/python3/dist-packages/ospd/parser.py”, line 269, in _set_defaults
self._config = self._load_config(configfilename)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/ospd/parser.py”, line 290, in _load_config
raise RuntimeError(
RuntimeError: Error while parsing config file /etc/gvm/ospd-openvas.conf. Error was While reading from '/etc/gvm/ospd-openvas.co>
ospd-openvas.service: Control process exited, code=exited, status=1/FAILURE
ospd-openvas.service: Failed with result ‘exit-code’.
Failed to start ospd-openvas.service - OSPd Wrapper for the OpenVAS Scanner (ospd-openvas).
ospd-openvas.service: Scheduled restart job, restart counter is at 38.
Starting ospd-openvas.service - OSPd Wrapper for the OpenVAS Scanner (ospd-openvas)…
Traceback (most recent call last):
File “/usr/bin/ospd-openvas”, line 8, in
sys.exit(main())
^^^^^^
File “/usr/lib/python3/dist-packages/ospd_openvas/daemon.py”, line 1264, in main
daemon_main(‘OSPD - openvas’, OSPDopenvas, NotusParser())
File “/usr/lib/python3/dist-packages/ospd/main.py”, line 86, in main
args = parser.parse_arguments()
^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/ospd/parser.py”, line 302, in parse_arguments
self._set_defaults(_args.config)
File “/usr/lib/python3/dist-packages/ospd/parser.py”, line 269, in _set_defaults
self._config = self._load_config(configfilename)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/ospd/parser.py”, line 290, in _load_config
raise RuntimeError(
RuntimeError: Error while parsing config file /etc/gvm/ospd-openvas.conf. Error was While reading from '/etc/gvm/ospd-openvas.co>
ospd-openvas.service: Control process exited, code=exited, status=1/FAILURE
ospd-openvas.service: Failed with result ‘exit-code’.
Failed to start ospd-openvas.service - OSPd Wrapper for the OpenVAS Scanner (ospd-openvas).

I have moved this to a new topic since your error is different than the topic posted under.

Regarding your issue, I have just tested the Kali Linux installation following the instructions from the Greenbone Community documentation guides.
The version of Kali:

uname -a
Linux kali 6.6.9-amd64 #1 SMP PREEMPT_DYNAMIC Kali 6.6.9-1kali1 (2024-01-08) x86_64 GNU/Linux

I first did a full apt update -y && apt upgrade -y.

The installation was successfull and all reports OK.

# gvm-check-setup
gvm-check-setup 23.11.0
  Test completeness and readiness of GVM-23.11.0
Step 1: Checking OpenVAS (Scanner)... 
        OK: OpenVAS Scanner is present in version 23.0.1.
        OK: Notus Scanner is present in version 22.6.3.
        OK: Server CA Certificate is present as /var/lib/gvm/CA/servercert.pem.
Checking permissions of /var/lib/openvas/gnupg/*
        OK: _gvm owns all files in /var/lib/openvas/gnupg
        OK: redis-server is present.
        OK: scanner (db_address setting) is configured properly using the redis-server socket: /var/run/redis-openvas/redis-server.sock
        OK: the mqtt_server_uri is defined in /etc/openvas/openvas.conf
        OK: _gvm owns all files in /var/lib/openvas/plugins
        OK: NVT collection in /var/lib/openvas/plugins contains 90442 NVTs.
        OK: The notus directory /var/lib/notus/products contains 457 NVTs.
Checking that the obsolete redis database has been removed
Could not connect to Redis at /var/run/redis-openvas/redis-server.sock: No such file or directory
        OK: No old Redis DB
        Starting ospd-openvas service
        Waiting for ospd-openvas service
        OK: ospd-openvas service is active.
        OK: ospd-OpenVAS is present in version 22.7.1.
Step 2: Checking GVMD Manager ... 
        OK: GVM Manager (gvmd) is present in version 23.5.2.
Step 3: Checking Certificates ... 
        OK: GVM client certificate is valid and present as /var/lib/gvm/CA/clientcert.pem.
        OK: Your GVM certificate infrastructure passed validation.
Step 4: Checking data ... 
        OK: SCAP data found in /var/lib/gvm/scap-data.
        OK: CERT data found in /var/lib/gvm/cert-data.
Step 5: Checking Postgresql DB and user ... 
        OK: Postgresql version and default port are OK.
 gvmd      | _gvm     | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | 
16436|pg-gvm|10|2200|f|22.6||
        OK: At least one user exists.
Step 6: Checking Greenbone Security Assistant (GSA) ... 
        OK: Greenbone Security Assistant is present in version 22.9.1~git.
Step 7: Checking if GVM services are up and running ... 
        Starting gvmd service
        Waiting for gvmd service
        OK: gvmd service is active.
        Starting gsad service
        Waiting for gsad service
        OK: gsad service is active.
Step 8: Checking few other requirements...
        OK: nmap is present.
        OK: ssh-keygen found, LSC credential generation for GNU/Linux targets is likely to work.
        OK: nsis found, LSC credential package generation for Microsoft Windows targets is likely to work.
        OK: xsltproc found.
        WARNING: Your password policy is empty.
        SUGGEST: Edit the /etc/gvm/pwpolicy.conf file to set a password policy.
Step 9: Checking greenbone-security-assistant...
        OK: greenbone-security-assistant is installed

It seems like your GVM-23.11.0 installation is OK.

Can you please describe your installation method, version of Kali Linux, and any other relevant details? Please post the output of the command gvm-check-setup.

2 Likes

These steps worked to me!! thank you Very Much.

I would suggest if you run OpenVAS have: Administration->FeedStatus == Current . The process to get Current Status may take a while.

uname -a
Linux kali 6.6.15-amd64 #1 SMP PREEMPT_DYNAMIC Kali 6.6.15-2kali1 (2024-05-17) x86_64 GNU/Linux

and right now the reuslt after run command is gvm-check-setup is:
Checking that the obsolete redis database has been removed
Could not connect to Redis at /var/run/redis-openvas/redis-server.sock: No such file or directory
OK: No old Redis DB
Starting ospd-openvas service
Job for ospd-openvas.service failed because the control process exited with error code.
See “systemctl status ospd-openvas.service” and “journalctl -xeu ospd-openvas.service” for details.
Waiting for ospd-openvas service
ERROR: ospd-openvas service did not start.
Please check journalctl -xe

ERROR: Your GVM-23.11.0 installation is not yet complete!

Please follow the instructions marked with FIX above and run this
script again.

From a first glance both issues (Malformed ospd-openvas.conf and not started / running redis server) looks more Kali packaging / gvm-setup (this is not maintained by Greenbone) related and might require a new issue / bug report over here:

https://bugs.kali.org

I have the same issue and i have been looking for solution to no avail. I think perhaps it has to do with Mac arm architecture because that is what my own is running on, spent two days trying to fix it but all to no avail

from the initial message this is cause of the issue. The mentioned config file is broken and can’t be parsed. I don’t have a clue why it is broken. If you don’t see the same traceback you have a different issue.

I have the same problem, with kali

┌──(kali㉿kali)-[~]
└─$ uname -a
Linux kali 6.6.15-amd64 #1 SMP PREEMPT_DYNAMIC Kali 6.6.15-2kali1 (2024-05-17) x86_64 GNU/Linux

i get this error:

                                                                                                                    
┌──(kali㉿kali)-[~]
└─$ sudo gvm-check-setup                                                                     

gvm-check-setup 23.11.0
  Test completeness and readiness of GVM-23.11.0
Step 1: Checking OpenVAS (Scanner)... 
        OK: OpenVAS Scanner is present in version 23.0.1.
        OK: Notus Scanner is present in version 22.6.3.
        OK: Server CA Certificate is present as /var/lib/gvm/CA/servercert.pem.
Checking permissions of /var/lib/openvas/gnupg/*
        OK: _gvm owns all files in /var/lib/openvas/gnupg
        OK: redis-server is present.
        OK: scanner (db_address setting) is configured properly using the redis-server socket: /var/run/redis-openvas/redis-server.sock
        OK: the mqtt_server_uri is defined in /etc/openvas/openvas.conf
        OK: _gvm owns all files in /var/lib/openvas/plugins
        OK: NVT collection in /var/lib/openvas/plugins contains 90475 NVTs.
        OK: The notus directory /var/lib/notus/products contains 459 NVTs.
Checking that the obsolete redis database has been removed
        OK: No old Redis DB
        Starting ospd-openvas service
        Waiting for ospd-openvas service
        OK: ospd-openvas service is active.
        OK: ospd-OpenVAS is present in version 22.7.1.
Step 2: Checking GVMD Manager ... 
        OK: GVM Manager (gvmd) is present in version 23.5.2.
Step 3: Checking Certificates ... 
        OK: GVM client certificate is valid and present as /var/lib/gvm/CA/clientcert.pem.
        OK: Your GVM certificate infrastructure passed validation.
Step 4: Checking data ... 
        OK: SCAP data found in /var/lib/gvm/scap-data.
        OK: CERT data found in /var/lib/gvm/cert-data.
Step 5: Checking Postgresql DB and user ... 
        OK: Postgresql version and default port are OK.
WARNING:  database "postgres" has a collation version mismatch
DETAIL:  The database was created using collation version 2.37, but the operating system provides version 2.38.
HINT:  Rebuild all objects in this database that use the default collation and run ALTER DATABASE postgres REFRESH COLLATION VERSION, or build PostgreSQL with the right library version.
        ERROR: The Postgresql DB does not exist.
        FIX: Run 'sudo runuser -u postgres -- /usr/share/gvm/create-postgresql-database'

 ERROR: Your GVM-23.11.0 installation is not yet complete!

Please follow the instructions marked with FIX above and run this

i tried to do this :

        FIX: Run 'sudo runuser -u postgres -- /usr/share/gvm/create-postgresql-database'

but that dosent help