My issue is I scan a target with openvas from: https://greenbone.github.io/docs/latest/22.4/container/index.html
I get Stopped at 99% on a task of this target. When I look the logs, ospd-openvas
stopped to run. The logs has:
get_redis_ctx: redis connection error to /run/redis/redis.sock: Connection refused
The redis is still running tough.
When I restarted ospd-openvas
I got libgvm util: get_redis_ctx: connected to redis:///run/redis/redis.sock/2
and not redis:///run/redis/redis.sock/
This issue only happens when I am scanning a specific target.
More logs:
Traceback (most recent call last):
File "/usr/local/lib/python3.11/dist-packages/redis/connection.py", line 512, in read_response
response = self._parser.read_response(disable_decoding=disable_decoding)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/redis/_parsers/resp2.py", line 15, in read_response
result = self._read_response(disable_decoding=disable_decoding)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/redis/_parsers/resp2.py", line 25, in _read_response
raw = self._buffer.readline()
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/redis/_parsers/socket.py", line 115, in readline
self._read_from_socket()
File "/usr/local/lib/python3.11/dist-packages/redis/_parsers/socket.py", line 65, in _read_from_socket
data = self._sock.recv(socket_read_size)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ConnectionResetError: [Errno 104] Connection reset by peer
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/ospd-openvas", line 8, in <module>
sys.exit(main())
^^^^^^
File "/usr/local/lib/python3.11/dist-packages/ospd_openvas/daemon.py", line 1264, in main
daemon_main('OSPD - openvas', OSPDopenvas, NotusParser())
File "/usr/local/lib/python3.11/dist-packages/ospd/main.py", line 153, in main
daemon.run()
File "/usr/local/lib/python3.11/dist-packages/ospd/ospd.py", line 1103, in run
self.scheduler()
File "/usr/local/lib/python3.11/dist-packages/ospd_openvas/daemon.py", line 708, in scheduler
self.check_feed()
File "/usr/local/lib/python3.11/dist-packages/ospd_openvas/daemon.py", line 682, in check_feed
current_feed = self.nvti.get_feed_version()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/ospd_openvas/nvticache.py", line 70, in get_feed_version
return OpenvasDB.get_single_item(self.ctx, NVTI_CACHE_NAME)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/ospd_openvas/db.py", line 268, in get_single_item
return ctx.lindex(name, index)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/redis/commands/core.py", line 2677, in lindex
return self.execute_command("LINDEX", name, index)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/redis/client.py", line 548, in execute_command
return conn.retry.call_with_retry(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/redis/retry.py", line 65, in call_with_retry
fail(error)
File "/usr/local/lib/python3.11/dist-packages/redis/client.py", line 552, in <lambda>
lambda error: self._disconnect_raise(conn, error),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/redis/client.py", line 538, in _disconnect_raise
raise error
File "/usr/local/lib/python3.11/dist-packages/redis/retry.py", line 62, in call_with_retry
return do()
^^^^
File "/usr/local/lib/python3.11/dist-packages/redis/client.py", line 549, in <lambda>
lambda: self._send_command_parse_response(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/redis/client.py", line 525, in _send_command_parse_response
return self.parse_response(conn, command_name, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/redis/client.py", line 565, in parse_response
response = connection.read_response()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/redis/connection.py", line 520, in read_response
raise ConnectionError(
redis.exceptions.ConnectionError: Error while reading from /run/redis/redis.sock : (104, 'Connection reset by peer')
OSPD[2] 2024-10-20 19:06:33,543: ERROR: (ospd.ospd) f3df7005-0e24-4e09-810f-945fec56e161: Exception Error while reading from /run/redis/redis.sock : (104, 'Connection reset by peer') while scanning
Traceback (most recent call last):
File "/usr/local/lib/python3.11/dist-packages/redis/connection.py", line 512, in read_response
response = self._parser.read_response(disable_decoding=disable_decoding)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/redis/_parsers/resp2.py", line 15, in read_response
result = self._read_response(disable_decoding=disable_decoding)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/redis/_parsers/resp2.py", line 25, in _read_response
raw = self._buffer.readline()
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/redis/_parsers/socket.py", line 115, in readline
self._read_from_socket()
File "/usr/local/lib/python3.11/dist-packages/redis/_parsers/socket.py", line 65, in _read_from_socket
data = self._sock.recv(socket_read_size)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ConnectionResetError: [Errno 104] Connection reset by peer
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.11/dist-packages/ospd/ospd.py", line 583, in start_scan
self.exec_scan(scan_id)
File "/usr/local/lib/python3.11/dist-packages/ospd_openvas/daemon.py", line 1194, in exec_scan
target_is_finished = kbdb.target_is_finished(scan_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/ospd_openvas/db.py", line 576, in target_is_finished
status = self._get_single_item(f'internal/{scan_id}')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/ospd_openvas/db.py", line 470, in _get_single_item
return OpenvasDB.get_single_item(self.ctx, name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/ospd_openvas/db.py", line 268, in get_single_item
return ctx.lindex(name, index)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/redis/commands/core.py", line 2677, in lindex
return self.execute_command("LINDEX", name, index)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/redis/client.py", line 548, in execute_command
return conn.retry.call_with_retry(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/redis/retry.py", line 65, in call_with_retry
fail(error)
File "/usr/local/lib/python3.11/dist-packages/redis/client.py", line 552, in <lambda>
lambda error: self._disconnect_raise(conn, error),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/redis/client.py", line 538, in _disconnect_raise
raise error
File "/usr/local/lib/python3.11/dist-packages/redis/retry.py", line 62, in call_with_retry
return do()
^^^^
File "/usr/local/lib/python3.11/dist-packages/redis/client.py", line 549, in <lambda>
lambda: self._send_command_parse_response(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/redis/client.py", line 525, in _send_command_parse_response
return self.parse_response(conn, command_name, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/redis/client.py", line 565, in parse_response
response = connection.read_response()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/redis/connection.py", line 520, in read_response
raise ConnectionError(
redis.exceptions.ConnectionError: Error while reading from /run/redis/redis.sock : (104, 'Connection reset by peer')
OSPD[2] 2024-10-20 19:06:33,591: WARNING: (ospd.ospd) Error sending data to the client while executing a scan f3df7005-0e24-4e09-810f-945fec56e161.
Exception ignored in atexit callback: <function exit_cleanup at 0x7f8039e19760>
Traceback (most recent call last):
File "/usr/local/lib/python3.11/dist-packages/ospd/main.py", line 69, in exit_cleanup
daemon.daemon_exit_cleanup()
File "/usr/local/lib/python3.11/dist-packages/ospd/ospd.py", line 447, in daemon_exit_cleanup
self.scan_collection.clean_up_pickled_scan_info()
File "/usr/local/lib/python3.11/dist-packages/ospd/scan.py", line 251, in clean_up_pickled_scan_info
if self.get_status(scan_id) == ScanStatus.QUEUED:
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/ospd/scan.py", line 352, in get_status
status = self.scans_table.get(scan_id, {}).get('status', None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<string>", line 2, in get
File "/usr/lib/python3.11/multiprocessing/managers.py", line 818, in _callmethod
self._connect()
File "/usr/lib/python3.11/multiprocessing/managers.py", line 805, in _connect
conn = self._Client(self._token.address, authkey=self._authkey)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/multiprocessing/connection.py", line 501, in Client
c = SocketClient(address)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/multiprocessing/connection.py", line 629, in SocketClient
s.connect(address)
FileNotFoundError: [Errno 2] No such file or directory