ValueError: Redis URL after installation

I just tried to install openvas on kali linux (VirtualBox).

I removed openvas completely and reinstalled it multiple times to see if this fixes it, but I always get the same result at the end of the day.

Ive done update and upgrade of linux than apt installed openvas. After that I ran sudo gvm-setup which took ages but worked completely fine.
BUT when trying to run sudo gvm-check-setup or sudo gvm-start erroring with the following message:

gvm-check-setup 22.4.1
  Test completeness and readiness of GVM-22.4.1
Step 1: Checking OpenVAS (Scanner)... 
        OK: OpenVAS Scanner is present in version 22.4.1.
        OK: Notus Scanner is present in version 22.4.4.
        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: redis-server is running and listening on socket: /var/run/redis-openvas/redis-server.sock.
        OK: redis-server configuration is OK and redis-server is running.
        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 84919 NVTs.
        OK: The notus directory /var/lib/notus/products contains 426 NVTs.
Checking that the obsolete redis database has been removed
        OK: No old Redis DB
        OK: ospd-OpenVAS is present in version 22.4.6.
Step 2: Checking GVMD Manager ... 
        OK: GVM Manager (gvmd) is present in version 22.4.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     | en_US.UTF-8 | en_US.UTF-8 |            | libc            | 
16439|pg-gvm|10|2200|f|22.4.0||
        OK: At least one user exists.
Step 6: Checking Greenbone Security Assistant (GSA) ... 
        OK: Greenbone Security Assistant is present in version 22.04.1~git.
Step 7: Checking if GVM services are up and running ... 
        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-22.4.1 installation is not yet complete!

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

The journalctl gives me:

Mar 30 18:09:07 kali ospd-openvas[459851]: Traceback (most recent call last):
Mar 30 18:09:07 kali ospd-openvas[459851]:   File "/usr/bin/ospd-openvas", line 8, in <module>
Mar 30 18:09:07 kali ospd-openvas[459851]:     sys.exit(main())
Mar 30 18:09:07 kali ospd-openvas[459851]:              ^^^^^^
Mar 30 18:09:07 kali ospd-openvas[459851]:   File "/usr/lib/python3/dist-packages/ospd_openvas/daemon.py", line 1264, in main
Mar 30 18:09:07 kali ospd-openvas[459851]:     daemon_main('OSPD - openvas', OSPDopenvas, NotusParser())
Mar 30 18:09:07 kali ospd-openvas[459851]:   File "/usr/lib/python3/dist-packages/ospd/main.py", line 126, in main
Mar 30 18:09:07 kali ospd-openvas[459851]:     daemon = daemon_class(**vars(args))
Mar 30 18:09:07 kali ospd-openvas[459851]:              ^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 30 18:09:07 kali ospd-openvas[459851]:   File "/usr/lib/python3/dist-packages/ospd_openvas/daemon.py", line 480, in __init__
Mar 30 18:09:07 kali ospd-openvas[459851]:     self.main_db = MainDB()
Mar 30 18:09:07 kali ospd-openvas[459851]:                    ^^^^^^^^
Mar 30 18:09:07 kali ospd-openvas[459851]:   File "/usr/lib/python3/dist-packages/ospd_openvas/db.py", line 615, in __init__
Mar 30 18:09:07 kali ospd-openvas[459851]:     super().__init__(self.DEFAULT_INDEX, ctx)
Mar 30 18:09:07 kali ospd-openvas[459851]:   File "/usr/lib/python3/dist-packages/ospd_openvas/db.py", line 437, in __init__
Mar 30 18:09:07 kali ospd-openvas[459851]:     self.ctx = OpenvasDB.create_context(kbindex)
Mar 30 18:09:07 kali ospd-openvas[459851]:                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 30 18:09:07 kali ospd-openvas[459851]:   File "/usr/lib/python3/dist-packages/ospd_openvas/db.py", line 108, in create_context
Mar 30 18:09:07 kali ospd-openvas[459851]:     ctx = redis.Redis.from_url(
Mar 30 18:09:07 kali ospd-openvas[459851]:           ^^^^^^^^^^^^^^^^^^^^^
Mar 30 18:09:07 kali ospd-openvas[459851]:   File "/usr/lib/python3/dist-packages/redis/client.py", line 897, in from_url
Mar 30 18:09:07 kali ospd-openvas[459851]:     connection_pool = ConnectionPool.from_url(url, **kwargs)
Mar 30 18:09:07 kali ospd-openvas[459851]:                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 30 18:09:07 kali ospd-openvas[459851]:   File "/usr/lib/python3/dist-packages/redis/connection.py", line 1275, in from_url
Mar 30 18:09:07 kali ospd-openvas[459851]:     url_options = parse_url(url)
Mar 30 18:09:07 kali ospd-openvas[459851]:                   ^^^^^^^^^^^^^^
Mar 30 18:09:07 kali ospd-openvas[459851]:   File "/usr/lib/python3/dist-packages/redis/connection.py", line 1212, in parse_url
Mar 30 18:09:07 kali ospd-openvas[459851]:     raise ValueError(
Mar 30 18:09:07 kali ospd-openvas[459851]: ValueError: Redis URL must specify one of the following schemes (redis://, rediss://, unix://)
Mar 30 18:09:07 kali systemd[1]: ospd-openvas.service: Control process exited, code=exited, status=1/FAILURE
β–‘β–‘ Subject: Unit process exited
β–‘β–‘ Defined-By: systemd
β–‘β–‘ Support: https://www.debian.org/support
β–‘β–‘ 
β–‘β–‘ An ExecStart= process belonging to unit ospd-openvas.service has exited.
β–‘β–‘ 
β–‘β–‘ The process' exit code is 'exited' and its exit status is 1.
Mar 30 18:09:07 kali systemd[1]: ospd-openvas.service: Failed with result 'exit-code'.
β–‘β–‘ Subject: Unit failed
β–‘β–‘ Defined-By: systemd
β–‘β–‘ Support: https://www.debian.org/support
β–‘β–‘ 
β–‘β–‘ The unit ospd-openvas.service has entered the 'failed' state with result 'exit-code'.
Mar 30 18:09:07 kali systemd[1]: Failed to start ospd-openvas.service - OSPd Wrapper for the OpenVAS Scanner (ospd-openvas).
β–‘β–‘ Subject: A start job for unit ospd-openvas.service has failed
β–‘β–‘ Defined-By: systemd
β–‘β–‘ Support: https://www.debian.org/support
β–‘β–‘ 
β–‘β–‘ A start job for unit ospd-openvas.service has finished with a failure.
β–‘β–‘ 
β–‘β–‘ The job identifier is 24322 and the job result is failed.

I also check the redis instance:

β”Œβ”€β”€(kaliγ‰Ώkali)-[~]
└─$ sudo systemctl status redis-server@openvas.service   
● redis-server@openvas.service - Advanced key-value store (openvas)
     Loaded: loaded (/lib/systemd/system/redis-server@.service; enabled; preset: disabled)
     Active: active (running) since Mon 2023-03-27 18:55:53 EDT; 2 days ago
       Docs: http://redis.io/documentation,
             man:redis-server(1)
   Main PID: 296804 (redis-server)
     Status: "Ready to accept connections"
      Tasks: 5 (limit: 19102)
     Memory: 10.1M
        CPU: 40.654s
     CGroup: /system.slice/system-redis\x2dserver.slice/redis-server@openvas.service
             └─296804 "/usr/bin/redis-server unixsocket:/run/redis-openvas/redis-server.sock"

Mar 27 18:55:53 kali systemd[1]: Starting redis-server@openvas.service - Advanced key-value store (openvas)...
Mar 27 18:55:53 kali redis-server[296804]: Supervised by systemd. Please make sure you set appropriate values for TimeoutStartSec and TimeoutStopSec in your service unit.
Mar 27 18:55:53 kali redis-server[296804]: oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
Mar 27 18:55:53 kali redis-server[296804]: Redis version=7.0.7, bits=64, commit=00000000, modified=0, pid=296804, just started
Mar 27 18:55:53 kali redis-server[296804]: Configuration loaded
Mar 27 18:55:53 kali redis[296804]: monotonic clock: POSIX clock_gettime
Mar 27 18:55:53 kali redis[296804]:                 _._                                                  
                                               _.-``__ ''-._                                             
                                          _.-``    `.  `_.  ''-._           Redis 7.0.7 (00000000/0) 64 bit
                                      .-`` .-```.  ```\/    _.,_ ''-._                                  
                                     (    '      ,       .-`  | `,    )     Running in standalone mode
                                     |`-._`-...-` __...-.``-._|'` _.-'|     Port: 0
                                     |    `-._   `._    /     _.-'    |     PID: 296804
                                      `-._    `-._  `-./  _.-'    _.-'                                   
                                     |`-._`-._    `-.__.-'    _.-'_.-'|                                  
                                     |    `-._`-._        _.-'_.-'    |           https://redis.io       
                                      `-._    `-._`-.__.-'_.-'    _.-'                                   
                                     |`-._`-._    `-.__.-'    _.-'_.-'|                                  
                                     |    `-._`-._        _.-'_.-'    |                                  
                                      `-._    `-._`-.__.-'_.-'    _.-'                                   
                                          `-._    `-.__.-'    _.-'                                       
                                              `-._        _.-'                                           
                                                  `-.__.-'
Mar 27 18:55:53 kali redis[296804]: Server initialized
Mar 27 18:55:53 kali redis[296804]: The server is now ready to accept connections at /run/redis-openvas/redis-server.sock
Mar 27 18:55:53 kali systemd[1]: Started redis-server@openvas.service - Advanced key-value store (openvas).

Check log file permissions /var/log/gvm/openvas.log
You probably ran β€œopenvas -s” for the first time as root, so this log file is created as owned by root.
In the systemctl service context, β€œopenvas -s” is executed as _gvm, preventing the system to get the configuration, i.e. the database address (db_address)

3 Likes

Even i am facing the same issue can someone please guide me here
kali ospd-openvas[36036]: ValueError: Redis URL must specify one of the following schemes (redis://, rediss://, unix://)