greenbone / openvas-scanner

This repository contains the scanner component for Greenbone Community Edition.
https://greenbone.github.io/docs/
GNU General Public License v2.0
3.38k stars 623 forks source link

ospd.errors.OspdCommandError: A vts_version parameter is required #745

Closed wneessen closed 3 years ago

wneessen commented 3 years ago

After https://github.com/greenbone/openvas-scanner/issues/733 was successfully fixed, openvas fails with the following error: ospd.errors.OspdCommandError: A vts_version parameter is required. I saw a ticket that had a similar issue already, but the suggest "update to latest gvm-lib" did not fix it (as 733 required me to update to the latest gvm-lib anyways)

Expected behavior

osdp-openvas executes openvas-scanner as normally

Actual behavior

ospd-openvas fails with an openvas-scanner error:

$ /usr/bin/python3 /usr/pkg/openvas/bin/ospd-openvas -s /usr/pkg/openvas/.config/ospd.conf -f -L DEBUG
OSPD[218137] 2021-05-21 07:05:41,468: INFO: (ospd.main) Starting OSPd OpenVAS version 21.4.0.
OSPD[218137] 2021-05-21 07:05:41,538: DEBUG: (ospd_openvas.lock) Created lock file /usr/pkg/openvas/var/run/feed-update.lock.
OSPD[218137] 2021-05-21 07:05:47,202: DEBUG: (ospd.server) New request from /usr/pkg/openvas/var/run/ospd.sock
OSPD[218137] 2021-05-21 07:05:47,205: DEBUG: (ospd.ospd) Handling get_vts command request.
OSPD[218137] 2021-05-21 07:05:51,550: DEBUG: (ospd_openvas.openvas) Loading VTs into Redis DB...
OSPD[218137] 2021-05-21 07:05:51,580: ERROR: (ospd_openvas.openvas) OpenVAS Scanner failed to load VTs. Command '['openvas', '--update-vt-info']' returned non-zero exit status 1.
OSPD[218137] 2021-05-21 07:05:51,648: DEBUG: (ospd_openvas.lock) Removed lock from file /usr/pkg/openvas/var/run/feed-update.lock.
Traceback (most recent call last):
  File "/usr/pkg/openvas/bin/ospd-openvas", line 33, in <module>
    sys.exit(load_entry_point('ospd-openvas==21.4.0', 'console_scripts', 'ospd-openvas')())
  File "/usr/lib/python3.9/site-packages/ospd_openvas-21.4.0-py3.9.egg/ospd_openvas/daemon.py", line 1388, in main
  File "/usr/lib/python3.9/site-packages/ospd/main.py", line 161, in main
    daemon.init(server)
  File "/usr/lib/python3.9/site-packages/ospd_openvas-21.4.0-py3.9.egg/ospd_openvas/daemon.py", line 485, in init
  File "/usr/lib/python3.9/site-packages/ospd/ospd.py", line 253, in set_vts_version
    raise OspdCommandError(
ospd.errors.OspdCommandError: A vts_version parameter is required
OSPD[218137] 2021-05-21 07:05:51,655: DEBUG: (ospd.main) Performing exit clean up
OSPD[218137] 2021-05-21 07:05:51,655: DEBUG: (ospd.ospd) All scans stopped and daemon clean and ready to exit
OSPD[218137] 2021-05-21 07:05:51,655: INFO: (ospd.main) Shutting-down server ...
OSPD[218137] 2021-05-21 07:05:51,709: DEBUG: (ospd.main) Finishing daemon process

Steps to reproduce

Used OS: Arch Linux (rolling)

  1. Download sources for 21.4.0
  2. Download the latest gvm-lib sources from git
  3. Build everything and install it
  4. Run gvmd -m to migrate the database to 242
  5. Execute ospd-openvas (or openvas directly)
  6. It will core dump with different errors

GVM versions

gsa: (gsad --version)

$ gsad --version
Greenbone Security Assistant 21.04.0

gvm: (gvmd --version)

$ gvmd --version
Greenbone Vulnerability Manager 21.4.0
Manager DB revision 242
Copyright (C) 2009-2021 Greenbone Networks GmbH
License: AGPL-3.0-or-later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

openvas: (openvas --version)

$ openvas --version
OpenVAS 21.10.0~dev1
gvm-libs 21.10.0~dev1
Most new code since 2005: (C) 2021 Greenbone Networks GmbH
Nessus origin: (C) 2004 Renaud Deraison <deraison@nessus.org>
License GPLv2: GNU GPL version 2
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

gvm-libs: Latest Git branch

openvas-smb: Not installed

ospd-openvas: (ospd-openvas --version)

$ ospd-openvas --version
OSP Server for openvas: 21.4.0
OSP: 21.4.0
OSPd OpenVAS: 21.4.0

Copyright (C) 2014-2021 Greenbone Networks GmbH
License GPLv2+: GNU GPL version 2 or later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Environment

Operating system:

cat /etc/lsb-release
LSB_VERSION=1.4
DISTRIB_ID=Arch
DISTRIB_RELEASE=rolling
DISTRIB_DESCRIPTION="Arch Linux"

Installation method / source: (packages, source installation) Sources

cfi-gb commented 3 years ago

OSP Server for openvas: 21.4.0

vs.

OpenVAS 21.10.0~dev1 gvm-libs 21.10.0~dev1

Looks like a mixture of a development branch of the openvas-scanner 21.10 with the stable 20.04 branches was done here which is AFAIK unsupported and most likely the source of this problem.

wneessen commented 3 years ago

Same error occurs with openvas 21.4.0

cfi-gb commented 3 years ago

Make sure that you haven't mixed additional versions of other components (at least gvm-libs is/was also at 21.10).

wneessen commented 3 years ago

As described due to https://github.com/greenbone/openvas-scanner/issues/733 I have to use gvm-libs from the git master branch.

cfi-gb commented 3 years ago

Yes, and that won't work as you can't mix stable / release branches like 21.04 with master / development branches like 21.10. :-)

Please see the following community portal posting for more information:

https://community.greenbone.net/t/frequently-asked-questions-faq/5558#heading--mixing-components-from-different-versions