Host process failure (Redis Error: Not possible to set GVM.__GlobalDBIndex.)

Good morning, I have installed GVM on my gentoo laptop, following the Greenbone_Vulnerability_Management Wiki Guide on gentoo wiki
During installation I found some problems in the ebuilds and I posted patches on bugs.gentoo.org:
Bugs: 905264 and 905411

Now the system seems to be up and running with:

Greenbone Vulnerability Manager 21.4.5
Manager DB revision 242

Greenbone Security Assistant 21.4.4
OpenVAS 21.4.4
gvm-libs 21.4.4

OSP Server for openvas: 21.4.4
OSP: 21.4.5.dev1
OSPd OpenVAS: 21.4.5.dev1

redis 7.0.10

I have read these topics:

but I am still unable to run a scan.

Everytime I try to start a task, the process stops showing these errors in report:
Host process failure (Redis Error: Not possible to set GVM.__GlobalDBIndex.).
Scan process Failure
Scan process Failure
Task interrupted unexpectedly

In /var/log/gvm/ospd-openvas.log I can read:

OSPD[9297] 2023-05-02 08:12:16,375: INFO: (ospd.command.command) Scan 3eb5bdd0-a46d-46ef-83bf-8562b30611b2 added to the queue in position 1.
OSPD[9297] 2023-05-02 08:13:21,532: INFO: (ospd.ospd) Currently 1 queued scans.
OSPD[9297] 2023-05-02 08:13:21,540: INFO: (ospd.ospd) Starting scan 3eb5bdd0-a46d-46ef-83bf-8562b30611b2.
OSPD[9297] 2023-05-02 08:13:21,543: ERROR: (ospd.ospd) 3eb5bdd0-a46d-46ef-83bf-8562b30611b2: Exception Redis Error: Not possible to set GVM.__GlobalDBIndex. while scanning
Traceback (most recent call last):
File “/usr/lib/python3.10/site-packages/ospd/ospd.py”, line 522, in start_scan
self.exec_scan(scan_id)
File “/usr/lib/python3.10/site-packages/ospd_openvas/daemon.py”, line 1242, in exec_scan
kbdb = self.main_db.get_new_kb_database()
File “/usr/lib/python3.10/site-packages/ospd_openvas/db.py”, line 620, in get_new_kb_database
if self.try_database(index):
File “/usr/lib/python3.10/site-packages/ospd_openvas/db.py”, line 611, in try_database
raise OspdOpenvasError(
ospd_openvas.errors.OspdOpenvasError: Redis Error: Not possible to set GVM.__GlobalDBIndex.
OSPD[9297] 2023-05-02 08:13:21,547: INFO: (ospd.ospd) 3eb5bdd0-a46d-46ef-83bf-8562b30611b2: Host scan got interrupted. Progress: 0, Status: RUNNING
OSPD[9297] 2023-05-02 08:13:21,547: INFO: (ospd.ospd) 3eb5bdd0-a46d-46ef-83bf-8562b30611b2: Scan interrupted.
OSPD[9297] 2023-05-02 08:13:26,562: INFO: (ospd.ospd) 3eb5bdd0-a46d-46ef-83bf-8562b30611b2: Scan process is dead and its progress is 0
OSPD[9297] 2023-05-02 08:13:26,563: INFO: (ospd.ospd) 3eb5bdd0-a46d-46ef-83bf-8562b30611b2: Scan interrupted.
OSPD[9297] 2023-05-02 08:13:26,569: INFO: (ospd.ospd) 3eb5bdd0-a46d-46ef-83bf-8562b30611b2: Scan process is dead and its progress is 0
OSPD[9297] 2023-05-02 08:13:26,570: INFO: (ospd.ospd) 3eb5bdd0-a46d-46ef-83bf-8562b30611b2: Scan interrupted.
OSPD[9297] 2023-05-02 08:13:26,600: INFO: (ospd.ospd) 3eb5bdd0-a46d-46ef-83bf-8562b30611b2: Scan process is dead and its progress is 0
OSPD[9297] 2023-05-02 08:13:26,601: INFO: (ospd.ospd) 3eb5bdd0-a46d-46ef-83bf-8562b30611b2: Scan interrupted.
OSPD[9297] 2023-05-02 08:13:26,616: INFO: (ospd.ospd) 3eb5bdd0-a46d-46ef-83bf-8562b30611b2: Scan process is dead and its progress is 0
OSPD[9297] 2023-05-02 08:13:26,616: INFO: (ospd.ospd) 3eb5bdd0-a46d-46ef-83bf-8562b30611b2: Scan interrupted.

the redis.sock is writable and readable to gvm user, via ACL:
~# getfacl /run/redis/redis.sock
getfacl: Removing leading ‘/’ from absolute path names
~# file: run/redis/redis.sock
~# owner: redis
~# group: redis
user::rwx
user:gvm:rw-
group::rwx
mask::rwx
other::—

Querying redis via redis-cli with gvm user I can see:

redis-cli -s /var/run/redis/redis.sock
redis /var/run/redis/redis.sock> Keys *

  1. “GVM.__GlobalDBIndex”
    redis /var/run/redis/redis.sock> TYPE GVM.__GlobalDBIndex
    hash
    redis /var/run/redis/redis.sock> HGETALL GVM.__GlobalDBIndex
  2. “1”
  3. “1”
    redis /var/run/redis/redis.sock>

I don’t have a disk space issue and hardware seems to work fine.
I tried to flush all redis cache, and the problem is still there.

Any help appreciated.

I investigated more in dept.
It seems the problem is the exit status of this call:
https://github.com/greenbone/gvm-libs/blob/ef8b6f3112eea24b3cd411d56073562f62bd1668/util/kb.c#LL99C46-L99C59
I tried to set the index value via redis-cli and I got the exception:

redis /run/redis/redis.sock> HSETNX GVM.__GlobalDBIndex 0 1
(error) OOM command not allowed when used memory > ‘maxmemory’.

so the problem is the value of maxmemory set in /etc/redis/redis.conf (it was set to 64MB).

Reading here:
https://ma.ttias.be/redis-oom-command-not-allowed-used-memory-maxmemory/#1-increase-redis-memory
I increased maxmemory value to 1GB and now scans works.

1 Like

Hello and welcome to this community forum.

A few (more or less) important notes:

  1. The 21.04 versions of the Greenbone software stack components have reached their end of life and it is strongly recommended to install 22.04 instead
  2. There is a example redis config available at https://github.com/greenbone/openvas-scanner/blob/v22.6.1/config/redis-openvas.conf
  3. When following the official guide at https://greenbone.github.io/docs/latest/22.4/source-build/index.html that config is getting installed and thus following the official installation guide (if possible for Gentoo) should not have such problems
1 Like

Thanks for your reply, @cfi .
To create ebuilds for 22.04 we have a problem because Greenbone does not publish node tarballs anymore:

This is why on Gentoo the only Greenbone version available is 21.04.
I will try a manual compile on next days.

2 Likes

This reply is just to fix that now Greenbone is publishing a dist tarball for GSA.
Thanks to Greenbone guys.

2 Likes

Yesterday I just send a PR on gentoo to add 22.04 in the gentoo repository. I don’t know when and if it will be merged:
https://github.com/gentoo/gentoo/pull/31106
I didn’t include openvas-smb because it depends on heimdal and it doesn’t build with mit-krb5 (on gentoo we have a virtual package for krb5 because both implementations are supported, but forcing one of them can create dependencies problems with other packages).
Is there a possibility you will implement the use of both libs in openvas-smb (i.e. as in https://github.com/mariadb-corporation/mariadb-connector-c)?

1 Like

Starting today, the 22.4 version of GVM is in the Gentoo repository

4 Likes