Failed to rebuild gvmd data: NVTs must be available while rebuilding configs

I am using kde NEON:

> neofetch      
             `..---+/---..`                step@sys 
         `---.``   ``   `.---.`            -------- 
      .--.`        ``        `-:-.         OS: KDE neon 5.27 x86_64 
    `:/:     `.----//----.`     :/-        Kernel: 6.2.0-34-generic 
   .:.    `---`          `--.`    .:`      Uptime: 8 mins 
  .:`   `--`                .:-    `:.     Packages: 2970 (dpkg), 13 (flatpak), 15 (snap) 
 `/    `:.      `.-::-.`      -:`   `/`    Shell: zsh 5.8.1 
 /.    /.     `:++++++++:`     .:    .:    Resolution: 1920x1080, 1920x1080 
`/    .:     `+++++++++++/      /`   `+`   DE: Plasma 5.27.8 
/+`   --     .++++++++++++`     :.   .+:   WM: KWin 
`/    .:     `+++++++++++/      /`   `+`   WM Theme: Glassy 
 /`    /.     `:++++++++:`     .:    .:    Theme: [Plasma], Breeze [GTK2/3] 
 ./    `:.      `.:::-.`      -:`   `/`    Icons: [Plasma], Papirus [GTK2/3] 
  .:`   `--`                .:-    `:.     Terminal: konsole 
   .:.    `---`          `--.`    .:`      CPU: AMD Ryzen 7 5700X (16) @ 3.600GHz 
    `:/:     `.----//----.`     :/-        GPU: NVIDIA RTX A4000 
      .-:.`        ``        `-:-.         Memory: 3002MiB / 31993MiB 
         `---.``   ``   `.---.`
             `..---+/---..`                                        
                                                                   


I build from source and done every step:
I still get this error

I tried to do every solution found here: failed-to-find-config

Here is my terminal:

> find /var/lib/gvm/data-objects/ -name "*33d0cd82-57c6-11e1-8ed1-406186ea4fc5*.xml"
/var/lib/gvm/data-objects/gvmd/22.04/port-lists/all-iana-assigned-tcp-33d0cd82-57c6-11e1-8ed1-406186ea4fc5.xml

~                                                                                                                                                   14:18:23
> sudo -u gvm greenbone-feed-sync --type GVMD_DATA
Trying to acquire lock on /var/lib/gvm/feed-update.lock
Acquired lock on /var/lib/gvm/feed-update.lock
⠸ Downloading gvmd data from rsync://feed.community.greenbone.net/community/data-feed/22.04/ to /var/lib/gvm/data-objects/gvmd/22.04
Releasing lock on /var/lib/gvm/feed-update.lock


~                                                                                                                                                   14:18:28
> sudo -u gvm gvmd --rebuild-gvmd-data=all
Failed to rebuild gvmd data: NVTs must be available while rebuilding configs.

As you can see, I have an error at the last step.

I also did this in hope it will work:

> find /var/lib/gvm/data-objects/ -name "*daba56c8-73ec-11df-a475-002264764cea*.xml"
/var/lib/gvm/data-objects/gvmd/22.04/scan-configs/full-and-fast-daba56c8-73ec-11df-a475-002264764cea.xml

~                                                                                                                                                   14:19:28
> sudo -u gvm greenbone-feed-sync --type gvmd-data
Trying to acquire lock on /var/lib/gvm/feed-update.lock
Acquired lock on /var/lib/gvm/feed-update.lock
⠸ Downloading gvmd data from rsync://feed.community.greenbone.net/community/data-feed/22.04/ to /var/lib/gvm/data-objects/gvmd/22.04
Releasing lock on /var/lib/gvm/feed-update.lock


~                                                                                                                                                   14:19:32
> sudo -u gvm greenbone-feed-sync --type nvt
Trying to acquire lock on /var/lib/openvas/feed-update.lock
Acquired lock on /var/lib/openvas/feed-update.lock
⠸ Downloading Notus files from rsync://feed.community.greenbone.net/community/vulnerability-feed/22.04/vt-data/notus/ to /var/lib/notus
⠦ Downloading NASL files from rsync://feed.community.greenbone.net/community/vulnerability-feed/22.04/vt-data/nasl/ to /var/lib/openvas/plugins
Releasing lock on /var/lib/openvas/feed-update.lock


~                                                                                                                                                3s 14:19:37
> gvmd --modify-setting 78eceaec-3385-11ea-b237-28d24461215b --value `gvmd --get-users --verbose | grep admin | awk '{print $2}'`

~                                                                                                                                                   14:19:42
> sudo -u gvm gvmd --rebuild-gvmd-data=all                                                                                       
Failed to rebuild gvmd data: NVTs must be available while rebuilding configs.

~                                                                                                                                                   14:19:54
> 


I think I found the problem but I still need help:

> sudo systemctl start ospd-openvas    

~                                                                                                                                               41s 14:51:29
> sudo systemctl status ospd-openvas
● ospd-openvas.service - OSPd Wrapper for the OpenVAS Scanner (ospd-openvas)
     Loaded: loaded (/etc/systemd/system/ospd-openvas.service; enabled; vendor preset: enabled)
     Active: activating (auto-restart) (Result: exit-code) since Thu 2023-12-14 14:55:30 CET; 38s ago
       Docs: man:ospd-openvas(8)
             man:openvas(8)
    Process: 13137 ExecStart=/usr/local/bin/ospd-openvas --foreground --unix-socket /run/ospd/ospd-openvas.sock --pid-file /run/ospd/ospd-openvas.pid --log->
   Main PID: 13137 (code=exited, status=1/FAILURE)
        CPU: 116ms
lines 1-8/8 (END)

here are the logs of it

> journalctl -u ospd-openvas
Dec 14 03:00:31 sys systemd[1]: Starting OSPd Wrapper for the OpenVAS Scanner (ospd-openvas)...
Dec 14 03:00:31 sys systemd[1]: Started OSPd Wrapper for the OpenVAS Scanner (ospd-openvas).
Dec 14 03:00:31 sys ospd-openvas[27476]: Traceback (most recent call last):
Dec 14 03:00:31 sys ospd-openvas[27476]:   File "/usr/local/bin/ospd-openvas", line 5, in <module>
Dec 14 03:00:31 sys ospd-openvas[27476]:     from ospd_openvas.daemon import main
Dec 14 03:00:31 sys ospd-openvas[27476]:   File "/usr/local/lib/python3.10/dist-packages/ospd_openvas/daemon.py", line 32, in <module>
Dec 14 03:00:31 sys ospd-openvas[27476]:     from ospd_openvas.notus import Cache, Notus, NotusParser, NotusResultHandler
Dec 14 03:00:31 sys ospd-openvas[27476]:   File "/usr/local/lib/python3.10/dist-packages/ospd_openvas/notus.py", line 15, in <module>
Dec 14 03:00:31 sys ospd-openvas[27476]:     from ospd_openvas.db import OpenvasDB, MainDB
Dec 14 03:00:31 sys ospd-openvas[27476]:   File "/usr/local/lib/python3.10/dist-packages/ospd_openvas/db.py", line 15, in <module>
Dec 14 03:00:31 sys ospd-openvas[27476]:     import redis
Dec 14 03:00:31 sys ospd-openvas[27476]:   File "/usr/local/lib/python3.10/dist-packages/redis/__init__.py", line 3, in <module>
Dec 14 03:00:31 sys ospd-openvas[27476]:     from redis import asyncio  # noqa
Dec 14 03:00:31 sys ospd-openvas[27476]:   File "/usr/local/lib/python3.10/dist-packages/redis/asyncio/__init__.py", line 1, in <module>
Dec 14 03:00:31 sys ospd-openvas[27476]:     from redis.asyncio.client import Redis, StrictRedis
Dec 14 03:00:31 sys ospd-openvas[27476]:   File "/usr/local/lib/python3.10/dist-packages/redis/asyncio/client.py", line 26, in <module>
Dec 14 03:00:31 sys ospd-openvas[27476]:     from redis._parsers.helpers import (
Dec 14 03:00:31 sys ospd-openvas[27476]:   File "/usr/local/lib/python3.10/dist-packages/redis/_parsers/__init__.py", line 1, in <module>
Dec 14 03:00:31 sys ospd-openvas[27476]:     from .base import BaseParser, _AsyncRESPBase
Dec 14 03:00:31 sys ospd-openvas[27476]:   File "/usr/local/lib/python3.10/dist-packages/redis/_parsers/base.py", line 9, in <module>
Dec 14 03:00:31 sys ospd-openvas[27476]:     from async_timeout import timeout as async_timeout
Dec 14 03:00:31 sys ospd-openvas[27476]: ModuleNotFoundError: No module named 'async_timeout'
Dec 14 03:00:31 sys systemd[1]: ospd-openvas.service: Main process exited, code=exited, status=1/FAILURE
Dec 14 03:00:31 sys systemd[1]: ospd-openvas.service: Failed with result 'exit-code'.
Dec 14 03:01:32 sys systemd[1]: ospd-openvas.service: Scheduled restart job, restart counter is at 1.
Dec 14 03:01:32 sys systemd[1]: Stopped OSPd Wrapper for the OpenVAS Scanner (ospd-openvas).
Dec 14 03:01:32 sys systemd[1]: Starting OSPd Wrapper for the OpenVAS Scanner (ospd-openvas)...
Dec 14 03:01:32 sys systemd[1]: Started OSPd Wrapper for the OpenVAS Scanner (ospd-openvas).
Dec 14 03:01:32 sys ospd-openvas[27897]: Traceback (most recent call last):
Dec 14 03:01:32 sys ospd-openvas[27897]:   File "/usr/local/bin/ospd-openvas", line 5, in <module>
Dec 14 03:01:32 sys ospd-openvas[27897]:     from ospd_openvas.daemon import main
Dec 14 03:01:32 sys ospd-openvas[27897]:   File "/usr/local/lib/python3.10/dist-packages/ospd_openvas/daemon.py", line 32, in <module>
Dec 14 03:01:32 sys ospd-openvas[27897]:     from ospd_openvas.notus import Cache, Notus, NotusParser, NotusResultHandler
Dec 14 03:01:32 sys ospd-openvas[27897]:   File "/usr/local/lib/python3.10/dist-packages/ospd_openvas/notus.py", line 15, in <module>
Dec 14 03:01:32 sys ospd-openvas[27897]:     from ospd_openvas.db import OpenvasDB, MainDB
Dec 14 03:01:32 sys ospd-openvas[27897]:   File "/usr/local/lib/python3.10/dist-packages/ospd_openvas/db.py", line 15, in <module>
Dec 14 03:01:32 sys ospd-openvas[27897]:     import redis

it says I don’t have a specific module even tho I have it ???

> pip3 install async_timeout
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: async_timeout in ./.local/lib/python3.10/site-packages (4.0.3)

“Solution” :

> python3.10 -m pip list | grep async_timeout

~                                                                                                                                           err 0|1 15:02:51
> sudo pip3.10 install async_timeout
Collecting async_timeout
  Downloading async_timeout-4.0.3-py3-none-any.whl (5.7 kB)
Installing collected packages: async_timeout
Successfully installed async_timeout-4.0.3
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

~                                                                                                                                                   15:03:01
> python3.10 -m pip list | grep async_timeout

~                                                                                                                                           err 0|1 15:03:08
> python3.10 -m pip install async_timeout

Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: async_timeout in ./.local/lib/python3.10/site-packages (4.0.3)

~                                                                                                                                                   15:04:03
> sudo python3.10 -m pip install async_timeout

Requirement already satisfied: async_timeout in /usr/local/lib/python3.10/dist-packages (4.0.3)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

~                                                                                                                                                   15:04:10
> sudo systemctl restart ospd-openvas


~                                                                                                                                                   15:04:13
> sudo systemctl status ospd-openvas

● ospd-openvas.service - OSPd Wrapper for the OpenVAS Scanner (ospd-openvas)
     Loaded: loaded (/etc/systemd/system/ospd-openvas.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2023-12-14 15:04:13 CET; 3s ago
       Docs: man:ospd-openvas(8)
             man:openvas(8)
   Main PID: 14040 (ospd-openvas)
      Tasks: 5 (limit: 38238)
     Memory: 35.8M
        CPU: 266ms
     CGroup: /system.slice/ospd-openvas.service
             ├─14040 /usr/bin/python3 /usr/local/bin/ospd-openvas --foreground --unix-socket /run/ospd/ospd-openvas.sock --pid-file /run/ospd/ospd-openvas.p>
             └─14049 /usr/bin/python3 /usr/local/bin/ospd-openvas --foreground --unix-socket /run/ospd/ospd-openvas.sock --pid-file /run/ospd/ospd-openvas.p>

Dec 14 15:04:13 sys systemd[1]: Starting OSPd Wrapper for the OpenVAS Scanner (ospd-openvas)...
Dec 14 15:04:13 sys systemd[1]: Started OSPd Wrapper for the OpenVAS Scanner (ospd-openvas).
Dec 14 15:04:14 sys ospd-openvas[14040]: OSPD[14040] 2023-12-14 14:04:14,051: INFO: (ospd.main) Starting OSPd OpenVAS version 22.6.1.
Dec 14 15:04:14 sys ospd-openvas[14040]: OSPD[14040] 2023-12-14 14:04:14,053: INFO: (ospd_openvas.messaging.mqtt) Successfully connected to MQTT broker


and then:

> sudo -u gvm gvmd --rebuild-gvmd-data=all
Failed to rebuild gvmd data: Feed locked.

so I did:

                                                  15:06:25
> find /var/lib/gvm/data-objects/ -name "*33d0cd82-57c6-11e1-8ed1-406186ea4fc5*.xml"
/var/lib/gvm/data-objects/gvmd/22.04/port-lists/all-iana-assigned-tcp-33d0cd82-57c6-11e1-8ed1-406186ea4fc5.xml

~                                                                                                                                                   15:07:50
> sudo -u gvm greenbone-feed-sync --type GVMD_DATA
Trying to acquire lock on /var/lib/gvm/feed-update.lock
/var/lib/gvm/feed-update.lock is locked by another process. Waiting 5 seconds before next try.

Oh yes I forgot to stop the server:

sudo systemctl stop gsad

so here We go again :slight_smile:

> sudo -u gvm greenbone-feed-sync --type GVMD_DATA                                  
Trying to acquire lock on /var/lib/gvm/feed-update.lock
Acquired lock on /var/lib/gvm/feed-update.lock
⠸ Downloading gvmd data from rsync://feed.community.greenbone.net/community/data-feed/22.04/ to /var/lib/gvm/data-objects/gvmd/22.04
Releasing lock on /var/lib/gvm/feed-update.lock


> sudo -u gvm gvmd --rebuild-gvmd-data=all

~                                                                                                                                                4s 15:11:10
> 

So far So good, let’s hope it works

                                                                                                                        15:11:45
> sudo systemctl start gsad          

AND IT WORKS !!!

I hope to help people with this

EDIT:

Interupted at 0%. I think i’ll KMS

1 Like