Python redis & ospd-openvas

To hopefully save someone else the pain …

The current ( and many past ) versions of ospd-openvas do not work with the latest python-redis (7.2.0) installed by pip. The latest I’ve managed to have it work with is 7.1.0. Hard-code that version; otherwise, ospd-openas will crash with:

AttributeError: ‘UnixDomainSocketConnection’ object has no attribute ‘port’

If anyone is interested, please let me know, and I can paste the full stack trace.

-Scott

Here’s the trace just in case. Note, this comes up no matter what options I started with.

Traceback (most recent call last):

File “/usr/local/lib/python3.11/dist-packages/redis/client.py”, line 748, in _execute_command

server_port=conn.port,

            ^^^^^^^^^

AttributeError: ‘UnixDomainSocketConnection’ object has no attribute ‘port’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/usr/local/bin/ospd-openvas”, line 8, in

sys.exit(main())

         ^^^^^^

File “/usr/local/lib/python3.11/dist-packages/ospd_openvas/daemon.py”, line 1307, in main

daemon_main('OSPD - openvas', OSPDopenvas, NotusParser())

File “/usr/local/lib/python3.11/dist-packages/ospd/main.py”, line 114, in main

daemon = daemon_class(\*\*vars(args))

         ^^^^^^^^^^^^^^^^^^^^^^^^^^

File “/usr/local/lib/python3.11/dist-packages/ospd_openvas/daemon.py”, line 495, in _init_

self.main_db = MainDB()

               ^^^^^^^^

File “/usr/local/lib/python3.11/dist-packages/ospd_openvas/db.py”, line 609, in _init_

super().\__init_\_(self.DEFAULT_INDEX, ctx)

File “/usr/local/lib/python3.11/dist-packages/ospd_openvas/db.py”, line 431, in _init_

self.ctx = OpenvasDB.create_context(kbindex)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File “/usr/local/lib/python3.11/dist-packages/ospd_openvas/db.py”, line 110, in create_context

ctx.keys("test")

File “/usr/local/lib/python3.11/dist-packages/redis/commands/core.py”, line 2189, in keys

return self.execute_command("KEYS", pattern, \*\*kwargs)

       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File “/usr/local/lib/python3.11/dist-packages/redis/client.py”, line 716, in execute_command

return self.\_execute_command(\*args, \*\*options)

       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File “/usr/local/lib/python3.11/dist-packages/redis/client.py”, line 755, in _execute_command

server_port=conn.port,

            ^^^^^^^^^

AttributeError: ‘UnixDomainSocketConnection’ object has no attribute ‘port’

This is actually unrelated to ospd-openvas and a bug / regression recently introduced in that 3rd party library, see below and links included within it for more info.

1 Like