Unable to run scans after installation

Hi Team, I have followed the steps mentioned in the the Building 22.4 from Source - Greenbone Community Documentation since I am using Ubuntu 22.4 in a private cloud.

After the installation, the application is up and running fine. But when I try to run a scan using an IP address it does not work. The status is in Requested state without any progress. When I check the Feed Status, there is no list of Feed Status which I could see before. Attaching few snaps for reference. Please let me know if I have to provide any other details.


Thanks,
Suhas

If you don’t have a feed status you it is very likely you didn’t follow Building 22.4 from Source - Greenbone Community Documentation

1 Like

Hi sshastry,

Please check the logs located at /var/log/gvm, they will give you more information about the error. Based on the missing feeds, I’d recommend to run the commands for feed updates and see what happens:

sudo -u gvm greenbone-nvt-sync
sudo -u gvm greenbone-feed-sync --type SCAP
sudo -u gvm greenbone-feed-sync --type CERT
sudo -u gvm greenbone-feed-sync --type GVMD_DATA

Note that the feed synchronization can take a long time, especially on the first run.

1 Like

I was able to see the Feed Status before and I did stop service once and tried restarting it. And after that the Feed Status informations are empty.

We are seeing below errors at last during the execution of the command.

sudo -u gvm greenbone-nvt-sync
total size is 369,051,079 speedup is 22.85
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1819) [generator=3.2.3

sudo -u gvm greenbone-feed-sync --type SCAP
rsync: [receiver] mkstemp β€œ/var/lib/gvm/scap-data/.sha256sums.asc.q8Pjrg” failed: Permission denied (13)
833 100% 1.30kB/s 0:00:00 (xfr#25, to-chk=19/45)
rsync: [receiver] mkstemp β€œ/var/lib/gvm/scap-data/.timestamp.pWpqg6” failed: Permission denied (13)
13 100% 0.02kB/s 0:00:00 (xfr#26, to-chk=18/45)

sent 930,496 bytes received 473,204,104 bytes 796,195.80 bytes/sec
total size is 1,415,673,075 speedup is 2.99
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1819) [generator=3.2.3]

sudo -u gvm greenbone-feed-sync --type CERT
rsync: [receiver] mkstemp β€œ/var/lib/gvm/cert-data/.timestamp.Ssy5h4” failed: Permission denied (13)
13 100% 0.02kB/s 0:00:00 (xfr#30, to-chk=0/31)

sent 261,833 bytes received 1,164,102 bytes 10,149.00 bytes/sec
total size is 86,265,924 speedup is 60.50
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1819) [generator=3.2.3]

sudo -u gvm greenbone-feed-sync --type GVMD_DATA
scan-configs/policy_gaussdb_20200909_61327f09-8a54-4854-9e1c-16798285fb28.xml
572,606 100% 1.86MB/s 0:00:00 (xfr#25, to-chk=1/30)
scan-configs/system-discovery-bbca7412-a950-11e3-9109-406186ea4fc5.xml
5,191 100% 17.30kB/s 0:00:00 (xfr#26, to-chk=0/30)

sent 34,611 bytes received 2,641 bytes 281.15 bytes/sec
total size is 4,276,511 speedup is 114.80

Okay, good news first: It seems like your GVMD Data synced successfully. However, the rest failed at least partially due to permission errors (I’m only assuming this for the NVT sync since the actual error was not included in the log snippet). Are the permissions correctly set for the /var/lib/gvm/ folder and its children?

1 Like

Thanks. After updating the permission to sudo chmod -R g+srw /var/lib/gvm, the suggested commands synced without any error. But I still do not see the Feed Status with the information.

What should be the next step?

1 Like

Have you restarted the gvm, openvas and gsa services already?

Yes. And I see below error on restarting.

sudo systemctl start ospd-openvas

Job for ospd-openvas.service failed because the control process exited with error code.
See β€œsystemctl status ospd-openvas.service” and β€œjournalctl -xeu ospd-openvas.service” for details.

systemctl status ospd-openvas.service
● 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 Wed 2022-10-19 16:40:32 IST; 47s ago
Docs: man:ospd-openvas(8)
man:openvas(8)
Process: 3398085 ExecStart=/usr/local/bin/ospd-openvas --unix-socket /run/ospd/ospd-openvas.sock --pid-file /run/ospd/ospd-openvas.pid --log-file /var/log/gvm/ospd-openvas.log --lock-file-dir /var/l>
CPU: 420ms

On running journalctl -xeu ospd-openvas.service
init_logging: Can not open or create log file or directory. Please check permissions of log files listed in /etc/openvas/openvas_log.conf.
Traceback (most recent call last):
File β€œ/usr/local/bin/ospd-openvas”, line 8, in
sys.exit(main())
File β€œ/usr/local/lib/python3.10/dist-packages/ospd_openvas/daemon.py”, line 1255, in main
daemon_main(β€˜OSPD - openvas’, OSPDopenvas, NotusParser())
File β€œ/usr/local/lib/python3.10/dist-packages/ospd/main.py”, line 126, in main
daemon = daemon_class(**vars(args))
File β€œ/usr/local/lib/python3.10/dist-packages/ospd_openvas/daemon.py”, line 481, in init
self.main_db = MainDB()
File β€œ/usr/local/lib/python3.10/dist-packages/ospd_openvas/db.py”, line 589, in init
super().init(self.DEFAULT_INDEX, ctx)
File β€œ/usr/local/lib/python3.10/dist-packages/ospd_openvas/db.py”, line 411, in init
self.ctx = OpenvasDB.create_context(kbindex)
File β€œ/usr/local/lib/python3.10/dist-packages/ospd_openvas/db.py”, line 108, in create_context
ctx = redis.Redis.from_url(
File β€œ/usr/lib/python3/dist-packages/redis/client.py”, line 696, in from_url
connection_pool = ConnectionPool.from_url(url, db=db, **kwargs)
File β€œ/usr/lib/python3/dist-packages/redis/connection.py”, line 1051, in from_url
raise ValueError('Redis URL must specify one of the following ’
ValueError: Redis URL must specify one of the following schemes (redis://, rediss://, unix://)
systemd[1]: ospd-openvas.service: Control process exited, code=exited, status=1/FAILURE

Let’s ignore the issue that the OpenVAS logfile cannot be opened or created due to permission issues for now. It seems like there’s some issue with the Redis URL that gets passed to the Redis database to connect to. To me, this smells like extensive troubleshooting work.

I’d recommend a clean reinstall. Personally, I can recommend using the Community Containers as they are a lot more modular and can be maintained more easily.

1 Like

Is there a way to do this in the existing VM? I am sure we will have the conflict when it starts the server as the application port will throw an error.

What does it mean do reinstall, do we need a brand new VM? And should we be following Greenbone Community Containers 22.4 - Greenbone Community Documentation for installation?

Can you please confirm if below commands will be fine to uninstall the openvas installed using Soruce?

sudo apt purge openvas
sudo apt autoremove

Finally I could make out till getting the Feed Status info getting populated with latest sync that was done yesterday. But somehow when I try the scan It got interrupted. Any permission issue with the ospd? If so, can I know the path?


It seems like a lot has happened since yesterday :smile:

The error β€œCould not connect to Scanner” gives you more info if you click on it. To find more detailed information, take another look at /var/log/gvm, probably the error message will have changed.

1 Like

Thanks! as per ospd-openvas.log file, the issue that I see is
ERROR: (ospd_openvas.db) Redis Error: Not possible to connect to the kb.

Does it need a reinstallation of openVAS from scratch?

1 Like

You could just try to restart redis-openvas service.

2 Likes

After running sudo systemctl start redis-server@openvas.service and sudo systemctl enable redis-server@openvas.service I am seeing the below message. Can I know what is the issue here? Is there any additional command that I need to run to provide access to the root dir?

sudo systemctl status redis-server@openvas.service

● redis-server@openvas.service - Advanced key-value store (openvas)
Loaded: loaded (/lib/systemd/system/redis-server@.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2022-08-18 15:12:50 IST; 2 months 8 days ago
Docs: https://redis.io/docs/,
man:redis-server(1)
Main PID: 25785 (redis-server)
Status: β€œReady to accept connections”
Tasks: 5 (limit: 14284)
Memory: 99.5M
CPU: 2h 12min 55.284s
CGroup: /system.slice/system-redis\x2dserver.slice/redis-server@openvas.service
└─25785 β€œ/usr/bin/redis-server 127.0.0.1:0” β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ β€œβ€ ">

systemd[1]: Started Advanced key-value store (openvas).
redis[25785]: The server is now ready to accept connections at /run/redis-openvas/redis.sock
redis-server[25785]: 25785:M 18 Aug 2022 17:11:25.899 # Failed opening the RDB file dump.rdb (in server root dir /) for saving: Read-only file system
redis[25785]: Failed opening the RDB file dump.rdb (in server root dir /) for saving: Read-only file system
redis-server[25785]: 25785:M 19 Aug 2022 15:42:40.870 # Failed opening the RDB file dump.rdb (in server root dir /) for saving: Read-only file system
redis[25785]: Failed opening the RDB file dump.rdb (in server root dir /) for saving: Read-only file system
redis-server[25785]: 25785:M 19 Aug 2022 15:58:26.106 # Failed opening the RDB file dump.rdb (in server root dir /) for saving: Read-only file system
redis[25785]: Failed opening the RDB file dump.rdb (in server root dir /) for saving: Read-only file system
redis-server[25785]: 25785:M 19 Aug 2022 16:42:46.175 # Failed opening the RDB file dump.rdb (in server root dir /) for saving: Read-only file system
redis[25785]: Failed opening the RDB file dump.rdb (in server root dir /) for saving: Read-only file system

I think your system is total messed, up. You should invest some time to sysadmin your system.

2 Likes