Description | Hi,
I hope this is the correct location to report this.
I have had problems with GVM / OpenVAS on fresh installs of Kali and Kali Purple ISOs 2024.1. After completing the initial setup for gvm, I complete a 'gvm-check-setup' to ensure everything is installed properly. Lately, it fails during the setup check because it cannot start 'ospd-openvas.service' and 'notus-scanner.service.' The root cause for this appears to be related to 2 python files returning this error :
AttributeError: 'MQTTClient' object has no attribute '_sock'
Installation:
sudo apt-get update -y && sudo apt full-upgrade -y
sudo apt install gvm
sudo gvm-setup
sudo gvm-check-setup
ospd jorunelctl error output:
Apr 20 17:46:38 kali systemd[1]: Starting ospd-openvas.service - OSPd Wrapper for the OpenVAS Scanner (ospd-openvas)...
░░ Subject: A start job for unit ospd-openvas.service has begun execution
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ A start job for unit ospd-openvas.service has begun execution.
░░
░░ The job identifier is 12939.
Apr 20 17:46:39 kali ospd-openvas[115031]: Traceback (most recent call last):
Apr 20 17:46:39 kali ospd-openvas[115031]: File "/usr/bin/ospd-openvas", line 8, in <module>
Apr 20 17:46:39 kali ospd-openvas[115031]: sys.exit(main())
Apr 20 17:46:39 kali ospd-openvas[115031]: ^^^^^^
Apr 20 17:46:39 kali ospd-openvas[115031]: File "/usr/lib/python3/dist-packages/ospd_openvas/daemon.py", line 1245, in main
Apr 20 17:46:39 kali ospd-openvas[115031]: daemon_main('OSPD - openvas', OSPDopenvas, NotusParser())
Apr 20 17:46:39 kali ospd-openvas[115031]: File "/usr/lib/python3/dist-packages/ospd/main.py", line 152, in main
Apr 20 17:46:39 kali ospd-openvas[115031]: daemon.init(server)
Apr 20 17:46:39 kali ospd-openvas[115031]: File "/usr/lib/python3/dist-packages/ospd_openvas/daemon.py", line 501, in init
Apr 20 17:46:39 kali ospd-openvas[115031]: client = MQTTClient(
Apr 20 17:46:39 kali ospd-openvas[115031]: ^^^^^^^^^^^
Apr 20 17:46:39 kali ospd-openvas[115031]: File "/usr/lib/python3/dist-packages/ospd_openvas/messaging/mqtt.py", line 39, in init
Apr 20 17:46:39 kali ospd-openvas[115031]: super().init(client_id=client_id, protocol=mqtt.MQTTv5)
Apr 20 17:46:39 kali ospd-openvas[115031]: TypeError: Client.init() missing 1 required positional argument: 'callback_api_version'
Apr 20 17:46:39 kali ospd-openvas[115031]: Exception ignored in atexit callback: <function exit_cleanup at 0x7fcf27f4cf40>
Apr 20 17:46:39 kali ospd-openvas[115031]: Traceback (most recent call last):
Apr 20 17:46:39 kali ospd-openvas[115031]: File "/usr/lib/python3/dist-packages/ospd/main.py", line 74, in exit_cleanup
Apr 20 17:46:39 kali ospd-openvas[115031]: sys.exit()
Apr 20 17:46:39 kali ospd-openvas[115031]: SystemExit:
Apr 20 17:46:39 kali ospd-openvas[115031]: Exception ignored in: <function Client.del at 0x7fcf26c49620>
Apr 20 17:46:39 kali ospd-openvas[115031]: Traceback (most recent call last):
Apr 20 17:46:39 kali ospd-openvas[115031]: File "/usr/lib/python3/dist-packages/paho/mqtt/client.py", line 874, in del
Apr 20 17:46:39 kali ospd-openvas[115031]: self._reset_sockets()
Apr 20 17:46:39 kali ospd-openvas[115031]: File "/usr/lib/python3/dist-packages/paho/mqtt/client.py", line 1133, in _reset_sockets
Apr 20 17:46:39 kali ospd-openvas[115031]: self._sock_close()
Apr 20 17:46:39 kali ospd-openvas[115031]: File "/usr/lib/python3/dist-packages/paho/mqtt/client.py", line 1119, in _sock_close
Apr 20 17:46:39 kali ospd-openvas[115031]: if not self._sock:
Apr 20 17:46:39 kali ospd-openvas[115031]: ^^^^^^^^^^
Apr 20 17:46:39 kali ospd-openvas[115031]: AttributeError: 'MQTTClient' object has no attribute '_sock'
Apr 20 17:46:39 kali systemd[1]: ospd-openvas.service: Can't open PID file /run/ospd/ospd-openvas.pid (yet?) after start: No such file or directory
Apr 20 17:46:39 kali systemd[1]: ospd-openvas.service: Failed with result 'protocol'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ The unit ospd-openvas.service has entered the 'failed' state with result 'protocol'
notus journalctl error output:
Apr 20 17:49:07 kali systemd[1]: Starting notus-scanner.service - Notus Scanner...
░░ Subject: A start job for unit notus-scanner.service has begun execution
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ A start job for unit notus-scanner.service has begun execution.
░░
░░ The job identifier is 13210.
Apr 20 17:49:07 kali notus-scanner[116543]: Traceback (most recent call last):
Apr 20 17:49:07 kali notus-scanner[116543]: File "/usr/bin/notus-scanner", line 8, in <module>
Apr 20 17:49:07 kali notus-scanner[116543]: sys.exit(main())
Apr 20 17:49:07 kali notus-scanner[116543]: ^^^^^^
Apr 20 17:49:07 kali notus-scanner[116543]: File "/usr/lib/python3/dist-packages/notus/scanner/daemon.py", line 130, in main
Apr 20 17:49:07 kali notus-scanner[116543]: run_daemon(
Apr 20 17:49:07 kali notus-scanner[116543]: File "/usr/lib/python3/dist-packages/notus/scanner/daemon.py", line 86, in run_daemon
Apr 20 17:49:07 kali notus-scanner[116543]: client = MQTTClient(
Apr 20 17:49:07 kali notus-scanner[116543]: ^^^^^^^^^^^
Apr 20 17:49:07 kali notus-scanner[116543]: File "/usr/lib/python3/dist-packages/notus/scanner/messaging/mqtt.py", line 35, in init
Apr 20 17:49:07 kali notus-scanner[116543]: super().init(client_id=client_id, protocol=mqtt.MQTTv5)
Apr 20 17:49:07 kali notus-scanner[116543]: TypeError: Client.init() missing 1 required positional argument: 'callback_api_version'
Apr 20 17:49:07 kali notus-scanner[116543]: Exception ignored in atexit callback: <function exit_cleanup at 0x7fac6af100e0>
Apr 20 17:49:07 kali notus-scanner[116543]: Traceback (most recent call last):
Apr 20 17:49:07 kali notus-scanner[116543]: File "/usr/lib/python3/dist-packages/notus/scanner/utils.py", line 104, in exit_cleanup
Apr 20 17:49:07 kali notus-scanner[116543]: sys.exit()
Apr 20 17:49:07 kali notus-scanner[116543]: SystemExit:
Apr 20 17:49:07 kali notus-scanner[116543]: Exception ignored in: <function Client.del at 0x7fac6aeeb240>
Apr 20 17:49:07 kali notus-scanner[116543]: Traceback (most recent call last):
Apr 20 17:49:07 kali notus-scanner[116543]: File "/usr/lib/python3/dist-packages/paho/mqtt/client.py", line 874, in del
Apr 20 17:49:07 kali notus-scanner[116543]: self._reset_sockets()
Apr 20 17:49:07 kali notus-scanner[116543]: File "/usr/lib/python3/dist-packages/paho/mqtt/client.py", line 1133, in _reset_sockets
Apr 20 17:49:07 kali notus-scanner[116543]: self._sock_close()
Apr 20 17:49:07 kali notus-scanner[116543]: File "/usr/lib/python3/dist-packages/paho/mqtt/client.py", line 1119, in _sock_close
Apr 20 17:49:07 kali notus-scanner[116543]: if not self._sock:
Apr 20 17:49:07 kali notus-scanner[116543]: ^^^^^^^^^^
Apr 20 17:49:07 kali notus-scanner[116543]: AttributeError: 'MQTTClient' object has no attribute '_sock'
Apr 20 17:49:08 kali systemd[1]: notus-scanner.service: Can't open PID file /run/notus-scanner/notus-scanner.pid (yet?) after start: No such file or direc>
Apr 20 17:50:37 kali systemd[1]: notus-scanner.service: start operation timed out. Terminating.
Apr 20 17:50:37 kali systemd[1]: notus-scanner.service: Failed with result 'timeout'.
I found a thread on freebsd.org which fixed this issue:
./usr/lib/python3/dist-packages/ospd_openvas/messaging/mqtt.py
https://bugs.freebsd.org/bugzilla/attachment.cgi?id=249565&action=edit
diff
- super().init(client_id=client_id, protocol=mqtt.MQTTv5)
- super().init(mqtt.CallbackAPIVersion.VERSION1, client_id=client_id, protocol=mqtt.MQTTv5)
./usr/lib/python3/dist-packages/notus/scanner/messaging/mqtt.py
https://bugs.freebsd.org/bugzilla/attachment.cgi?id=249564&action=edit
diff
- super().init(client_id=client_id, protocol=mqtt.MQTTv5)
- super().init(mqtt.CallbackAPIVersion.VERSION1, client_id=client_id, protocol=mqtt.MQTTv5).
Once those have been updated, run:
sudo gvm-stop
sudo gvm-check-setup
This should then complete the setup checks without issue.
Thanks |
---|