Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Redis error while container startup #335

Open
aadarsh79 opened this issue Feb 25, 2025 · 6 comments
Open

[BUG] Redis error while container startup #335

aadarsh79 opened this issue Feb 25, 2025 · 6 comments
Assignees

Comments

@aadarsh79
Copy link

Checking for existing DB
Running first start configuration...
CREATE_EMPTY_DATABASE=false
LOADDEFAULT=false
Checking DB Version
Current GVMd database version is 256
Migrate the database if needed.
Starting Greenbone Vulnerability Manager...
admin
Time to fixup the gvm accounts.
reset
set Report Lines to 1000
Starting Postfix for report delivery by email
.
Sleeping for mosquitto
Starting Open Scanner Protocol daemon for OpenVAS...
Traceback (most recent call last):
File "/usr/local/bin/ospd-openvas", line 5, in
from ospd_openvas.daemon import main
File "/usr/local/lib/python3.11/dist-packages/ospd_openvas/daemon.py", line 32, in
from ospd_openvas.notus import Cache, Notus, NotusParser, NotusResultHandler
File "/usr/local/lib/python3.11/dist-packages/ospd_openvas/notus.py", line 15, in
from ospd_openvas.db import OpenvasDB, MainDB
File "/usr/local/lib/python3.11/dist-packages/ospd_openvas/db.py", line 15, in
import redis
File "/usr/local/lib/python3.11/dist-packages/redis/init.py", line 3, in
from redis import asyncio # noqa
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/redis/asyncio/init.py", line 1, in
from redis.asyncio.client import Redis, StrictRedis
File "/usr/local/lib/python3.11/dist-packages/redis/asyncio/client.py", line 43, in
from redis.client import (
File "/usr/local/lib/python3.11/dist-packages/redis/client.py", line 17, in
from redis.commands import (
File "/usr/local/lib/python3.11/dist-packages/redis/commands/init.py", line 1, in
from .cluster import READ_COMMANDS, AsyncRedisClusterCommands, RedisClusterCommands
File "/usr/local/lib/python3.11/dist-packages/redis/commands/cluster.py", line 29, in
from .core import (
ModuleNotFoundError: No module named 'redis.commands.core'
Container stopped, performing shutdown
waiting for server to shut down.... done
server stopped

Container cce-vas-server is either stopped or restarting

@ScottKnauss
Copy link

Could you please provide more information about your environment?
How did you start the container? (full command or docker-compose.yaml)
What OS and Hardware is this running on?

@aadarsh79
Copy link
Author

aadarsh79 commented Feb 26, 2025

OS: Rocky 8.8
nproc : 4
4G Memory

Used Docker Compose to kick off container

services:
openvas:
ports:
- 9300:9392
environment:
- PASSWORD=admin
- USERNAME=admin
- RELAYHOST=172.17.0.1
- SMTPPORT=25
- REDISDBS=512
- QUIET=false
- NEWDB=false
- SKIPSYNC=true
- RESTORE=false
- DEBUG=false
- HTTPS=false
- GMP=9390
volumes:
- /home/adarsh/openvas/data:/data
container_name: openvas
image: immauss/openvas:latest

@aadarsh79
Copy link
Author

Using container: openvas
HEALTHECHECK FAILED !
These services failed:
redis

==> /usr/local/var/log/gvm/gvmd.log <==
md manage:WARNING:2025-02-28 06h31.28 utc:16696: osp_scanner_feed_version: failed to connect to /var/run/ospd/ospd-openvas.sock
md manage:WARNING:2025-02-28 06h31.38 utc:16698: osp_scanner_feed_version: failed to connect to /var/run/ospd/ospd-openvas.sock
md manage:WARNING:2025-02-28 06h31.49 utc:16701: osp_scanner_feed_version: failed to connect to /var/run/ospd/ospd-openvas.sock
md manage:WARNING:2025-02-28 06h32.07 utc:16722: osp_scanner_feed_version: failed to connect to /var/run/ospd/ospd-openvas.sock

md manage:WARNING:2025-02-28 06h32.17 utc:16725: osp_scanner_feed_version: failed to connect to /var/run/ospd/ospd-openvas.sock
md manage:WARNING:2025-02-28 06h32.27 utc:16727: osp_scanner_feed_version: failed to connect to /var/run/ospd/ospd-openvas.sock
md manage:WARNING:2025-02-28 06h32.37 utc:16729: osp_scanner_feed_version: failed to connect to /var/run/ospd/ospd-openvas.sock
md manage:WARNING:2025-02-28 06h32.47 utc:16732: osp_scanner_feed_version: failed to connect to /var/run/ospd/ospd-openvas.sock

@immauss
Copy link
Owner

immauss commented Feb 28, 2025

@aadarsh79

Do you see the same problem with
The image set to immauss/openvas:latest?

@aadarsh79
Copy link
Author

Yes this issue is with the latest image.
Here is what I got to see in the logs -
$ tail -100 /var/log/gvm/ospd-openvas.log

File "/usr/local/lib/python3.11/dist-packages/redis/client.py", line 567, 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 571, in
lambda error: self._disconnect_raise(conn, error),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/redis/client.py", line 555, 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 568, in
lambda: self._send_command_parse_response(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/redis/client.py", line 542, 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 584, in parse_response
response = connection.read_response()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/redis/connection.py", line 600, in read_response
raise ConnectionError(
redis.exceptions.ConnectionError: Error while reading from /run/redis/redis.sock : (104, 'Connection reset by peer')
OSPD[321] 2025-02-28 04:44:56,706: WARNING: (ospd.ospd) Error sending data to the client while executing a scan fee74277-ceee-45bb-b30c-cceb137fdb74.
OSPD[128] 2025-02-28 05:26:19,774: INFO: (ospd.main) Starting OSPd OpenVAS version 22.8.0.
OSPD[128] 2025-02-28 05:26:19,953: INFO: (ospd_openvas.messaging.mqtt) Successfully connected to MQTT broker
OSPD[128] 2025-02-28 05:26:29,951: INFO: (ospd_openvas.daemon) Loading VTs. Scans will be [requested|queued] until VTs are loaded. This may take a few minu tes, please wait...
OSPD[128] 2025-02-28 05:26:32,506: INFO: (ospd_openvas.notus) hashsum verification is disabled
OSPD[128] 2025-02-28 05:30:40,569: INFO: (ospd_openvas.daemon) VTs were up to date. Feed version is 202502270926.
OSPD[128] 2025-02-28 05:30:42,589: INFO: (ospd.command.command) Scan fe88049e-cf42-49fb-8d7a-0778a7bc90b6 added to the queue in position 2.
OSPD[128] 2025-02-28 05:33:20,893: INFO: (ospd.ospd) Currently 1 queued scans.
OSPD[128] 2025-02-28 05:33:21,634: INFO: (ospd.ospd) Starting scan fe88049e-cf42-49fb-8d7a-0778a7bc90b6.
OSPD[128] 2025-02-28 06:01:14,013: ERROR: (ospd.ospd) fe88049e-cf42-49fb-8d7a-0778a7bc90b6: 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 592, 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 2679, in lindex
return self.execute_command("LINDEX", name, index, keys=[name])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/redis/client.py", line 559, in execute_command
return self._execute_command(*args, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/redis/client.py", line 567, 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 571, in
lambda error: self._disconnect_raise(conn, error),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/redis/client.py", line 555, 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 568, in
lambda: self._send_command_parse_response(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/redis/client.py", line 542, 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 584, in parse_response
response = connection.read_response()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/redis/connection.py", line 600, in read_response
raise ConnectionError(
redis.exceptions.ConnectionError: Error while reading from /run/redis/redis.sock : (104, 'Connection reset by peer')

@immauss
Copy link
Owner

immauss commented Feb 28, 2025

All of those errors are because redis it’s not running. But your doctor compose file is not referencing my image. The image that it is referencing is clearly based on mine, but I have no way to know if anything was changed in it.

Has this installation worked before or is this the first time?

Is SELiunx enforcing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants