Discussion: GVM Release Version 21.4.4

Strange, I get this error:

root@f90f57717d70:~/sources/gsa-21.4.4# yarnpkg
internal/modules/cjs/loader.js:905
  throw err;
  ^

Error: Cannot find module '@babel/runtime/helpers/interopRequireWildcard'
Require stack:
- /usr/share/nodejs/yarn/lib/cli/index.js
- /usr/share/nodejs/yarn/bin/yarn.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:101:18)
    at Object.<anonymous> (/usr/share/nodejs/yarn/lib/cli/index.js:3:31)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Module.require (internal/modules/cjs/loader.js:974:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/usr/share/nodejs/yarn/lib/cli/index.js',
    '/usr/share/nodejs/yarn/bin/yarn.js'
  ]
}

I’m in this dir:

root@f90f57717d70:~/sources/gsa-21.4.4# ls
CHANGELOG.md  LICENSE  README.md  RELEASE.md  changelog  changelog.toml  jsconfig.json  package.json  public  scripts  src  yarn.lock

I suppose I’ve installed all dependencies:

root@f90f57717d70:~/sources/gsa-21.4.4# apt-file search /usr/share/nodejs/yarn/bin/yarn.js
yarnpkg: /usr/share/nodejs/yarn/bin/yarn.js

root@f90f57717d70:~/sources/gsa-21.4.4# apt-file search /usr/share/nodejs/yarn/lib/cli/index.js
yarnpkg: /usr/share/nodejs/yarn/lib/cli/index.js
yarnpkg: /usr/share/nodejs/yarn/lib/cli/index.js.map

root@f90f57717d70:~/sources/gsa-21.4.4# apt install yarnpkg
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
yarnpkg is already the newest version (1.22.10+~cs22.25.14-3).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

And also installed this one, since it complained about that file as well:

root@f90f57717d70:~/sources/gsa-21.4.4# dpkg -L node-babel7 | grep Wildcard
/usr/share/nodejs/@babel/runtime-corejs2/helpers/esm/interopRequireWildcard.js
/usr/share/nodejs/@babel/runtime-corejs2/helpers/interopRequireWildcard.js
/usr/share/nodejs/@babel/runtime-corejs3/helpers/esm/interopRequireWildcard.js
/usr/share/nodejs/@babel/runtime-corejs3/helpers/interopRequireWildcard.js
root@f90f57717d70:~/sources/gsa-21.4.4# dpkg -l yarnpkg 
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version               Architecture Description
+++-==============-=====================-============-=========================================
ii  yarnpkg        1.22.10+~cs22.25.14-3 all          Fast, reliable and secure npm alternative

It seems there is an already installed version of the python redis library. Can you try to run apt remove python3-redis and afterwards python3 -m pip install . --prefix=$INSTALL_PREFIX --root=$INSTALL_DIR --no-warn-script-location again?

1 Like

Just tested in a clean Debian container and followed the steps manually. There it works. So I guess I do something wrong in my Dockerfile. I’ll figure it out.

I found the problem, I followed this installation guide. Which instructs the user to install nodejs from a 3rd party repo. However, this installation guide does not give this instruction. When not upgrading nodejs, everything works.

Could someone please advice which documentation is leading and mostly maintained? I always follow the README docs in the GitHub projects. This causes issues more often, so maybe I’m just reading the wrong docs?

Did this. It resolved the error, but only for that package. It also errored out for python3-packaging, python3-lxml, python3-defusedxml, python3-paramiko, python3-redis in total.

I followed this guide: Building GVM 21.04 — Greenbone Documentation documentation

During the ospd-openvas compile and install section, it explicitly states to install these packages prior to pulling the GitHub code and compiling. If these packages don’t need to be installed prior to complation, I’m not sure why it requests this explicitly here:

Altogether, here are the adjustments I had to make to my installation script:

export OSPD_OPENVAS_VERSION=$GVM_VERSION

sudo apt install -y \
  python3 \
  python3-pip \
  python3-setuptools \
#  python3-packaging \
  python3-wrapt \
  python3-cffi \
  python3-psutil \
#  python3-lxml \
#  python3-defusedxml \
#  python3-paramiko \
#  python3-redis
  
curl -f -L https://github.com/greenbone/ospd-openvas/archive/refs/tags/v$OSPD_OPENVAS_VERSION.tar.gz -o $SOURCE_DIR/ospd-openvas-$OSPD_OPENVAS_VERSION.tar.gz
curl -f -L https://github.com/greenbone/ospd-openvas/releases/download/v$OSPD_OPENVAS_VERSION/ospd-openvas-$OSPD_OPENVAS_VERSION.tar.gz.asc -o $SOURCE_DIR/ospd-openvas-$OSPD_OPENVAS_VERSION.tar.gz.asc

gpg --verify $SOURCE_DIR/ospd-openvas-$OSPD_OPENVAS_VERSION.tar.gz.asc $SOURCE_DIR/ospd-openvas-$OSPD_OPENVAS_VERSION.tar.gz

tar -C $SOURCE_DIR -xvzf $SOURCE_DIR/ospd-openvas-$OSPD_OPENVAS_VERSION.tar.gz

cd $SOURCE_DIR/ospd-openvas-$OSPD_OPENVAS_VERSION

# Removing dependency from gvmd. Causes ospd-openvas install to fail.
sudo apt remove -y \
  python3-lxml

# New command recommended from forum. Updates pip.
python3 -m pip install -U pip

python3 -m pip install . --prefix=$INSTALL_PREFIX --root=$INSTALL_DIR --no-warn-script-location

sudo cp -rv $INSTALL_DIR/* /

rm -rf $INSTALL_DIR/*

After those adjustments were made, ospd-openvas installs correctly and runs as expected after the Greenbone installation is all said and done. Perhaps the instructions I’ve found are outdated or not the correct set to follow. If so, I’d love to have an authoritative location for updated GSE install commands, as @AquaL1te mentioned.

Thank you again for your time, @bricks!

I’ve just tested the installation of ospd-openvas with Debian stable (Bullseye) because of opsd-openvas install failed · Issue #81 · greenbone/docs · GitHub

If I am right you are using Debian oldstable (Buster). In that case some python packages installed via the distribution (apt install) might be indeed to old for ospd-openvas.

2 Likes

I was indeed using Debian 10 Buster. I noticed the instructions have changed accordingly. I spun up a Debian 11 Bullseye VM from a Debian Bullseye netinst ISO and attempted running the updated instructions provided in the Greenbone Docs.

The postgresql-server-dev-11 package isn’t available in the Debian Bullseye repos. It results in the following message during the gvmd section:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package postgresql-server-dev-11
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done

It causes this further down the line when compiling:

user@Greenbone:~/build/gvmd$ cmake $SOURCE_DIR/gvmd-$GVMD_VERSION \
>   -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX \
>   -DCMAKE_BUILD_TYPE=Release \
>   -DLOCALSTATEDIR=/var \
>   -DSYSCONFDIR=/etc \
>   -DGVM_DATA_DIR=/var \
>   -DGVM_RUN_DIR=/run/gvm \
>   -DOPENVAS_DEFAULT_SOCKET=/run/ospd/ospd-openvas.sock \
>   -DGVM_FEED_LOCK_PATH=/var/lib/gvm/feed-update.lock \
>   -DSYSTEMD_SERVICE_DIR=/lib/systemd/system \
>   -DDEFAULT_CONFIG_DIR=/etc/default \
>   -DLOGROTATE_DIR=/etc/logrotate.d
-- Configuring Greenbone Vulnerability Manager...
-- The C compiler identification is GNU 10.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2")
-- Could NOT find Git (missing: GIT_EXECUTABLE)
-- Install prefix: /usr/local
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Checking for module 'libgvm_base>=21.4.1'
--   Found libgvm_base, version 21.4.4
-- Checking for module 'libgvm_util>=21.4.1'
--   Found libgvm_util, version 21.4.4
-- Checking for module 'libgvm_osp>=21.4.1'
--   Found libgvm_osp, version 21.4.4
-- Checking for module 'libgvm_gmp>=21.4.1'
--   Found libgvm_gmp, version 21.4.4
-- Checking for module 'gnutls>=3.2.15'
--   Found gnutls, version 3.7.1
-- Checking for module 'glib-2.0>=2.42'
--   Found glib-2.0, version 2.66.8
-- Checking for module 'libical>=1.00'
--   Found libical, version 3.0.9
-- Looking for PostgreSQL...
CMake Error at cmake/FindPackageHandleStandardArgs.cmake:165 (message):
  Could NOT find PostgreSQL (missing: PostgreSQL_TYPE_INCLUDE_DIR) (found
  version "13.5")
Call Stack (most recent call first):
  cmake/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
  cmake/FindPostgreSQL.cmake:247 (find_package_handle_standard_args)
  src/CMakeLists.txt:43 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/user/build/gvmd/CMakeFiles/CMakeOutput.log".
See also "/home/user/build/gvmd/CMakeFiles/CMakeError.log".
user@Greenbone:~/build/gvmd$

Another package changed names from python-impacket to python3-impacket:

Package python-impacket is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  python3-impacket

E: Package 'python-impacket' has no installation candidate

As the instructions are currently written, gvmd fails to compile on Debian 11 Bullseye (Stable) for me.

Thanks again for your efforts. Just trying to get this all sorted out. :slight_smile:

1 Like

Update: I changed the packages installed from postgresql-server-dev-11 to postgresql-server-dev-13 and from python-impacket to python3-impacket and everything seems to compile and operate correctly on Debian 11 Bullseye.

I had to modify the command from sudo systemctl start postgresql@11-main to sudo systemctl start postgresql@13-main accordingly for starting the database in a later step. I also noted that disabling the JIT feature on PostgreSQL 13 is needed as well due to performance issues.

No further issues so far. Thank you @bricks for your support!

1 Like

Sorry it seems we mixed that up and forgot to check some parts. I’ll try to update the docs this week.

2 Likes

I’ve just updated the docs accordingly. Thanks for letting me know about the issues!

2 Likes

I update to the latest version and i have a similar error:

Getting requirements to build wheel … done
Preparing wheel metadata … done
Requirement already satisfied: lxml in /usr/local/lib/python3.8/dist-packages (from ospd==21.4.4) (4.8.0)
Requirement already satisfied: deprecated in /usr/local/lib/python3.8/dist-packages (from ospd==21.4.4) (1.2.13)
Requirement already satisfied: psutil in /usr/lib/python3/dist-packages (from ospd==21.4.4) (5.5.1)
Requirement already satisfied: defusedxml in /usr/lib/python3/dist-packages (from ospd==21.4.4) (0.6.0)
Requirement already satisfied: paramiko in /home/testuser/.local/lib/python3.8/site-packages (from ospd==21.4.4) (2.9.2)
Requirement already satisfied: wrapt<2,>=1.10 in /usr/lib/python3/dist-packages (from deprecated->ospd==21.4.4) (1.11.2)
Requirement already satisfied: cryptography>=2.5 in /usr/lib/python3/dist-packages (from paramiko->ospd==21.4.4) (2.8)
Requirement already satisfied: bcrypt>=3.1.3 in /usr/lib/python3/dist-packages (from paramiko->ospd==21.4.4) (3.1.7)
Requirement already satisfied: pynacl>=1.0.1 in /usr/lib/python3/dist-packages (from paramiko->ospd==21.4.4) (1.3.0)
Building wheels for collected packages: ospd
Building wheel for ospd (PEP 517) … done
Created wheel for ospd: filename=ospd-21.4.4-py3-none-any.whl size=74796 sha256=f01cf6977c8340b52dd49814d85ff5fe9585b2417094e19ae04f7af201070829
Stored in directory: /home/testuser/.cache/pip/wheels/0c/cd/88/313447e5b7e57df13dc6a03e6a4fe96a56a7f0239f67c0cd11
Successfully built ospd
Installing collected packages: ospd
Attempting uninstall: ospd
Found existing installation: ospd 21.4.4
Uninstalling ospd-21.4.4:
ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: ‘/usr/local/lib/python3.8/dist-packages/ospd-21.4.4.dist-info/COPYING’
Consider using the --user option or check the permissions.

Hi, are you really sure using the latest docs? ospd has been removed from the latest release and docs.

2 Likes

where are latest docs?
I’m using this:
https://greenbone.github.io/docs/gvm-21.04/index.html

AFACIT those are the correct / recent docs which only contains the info to only install ospd-openvas and not ospd in addition which seems you are trying to do based on the previous posted output.

1 Like

The link to that documentation does not exist - " (Building GVM 21.04 — Greenbone Documentation documentation "

Just use the following URL https://greenbone.github.io/docs/

Hello,
When i try to install ospd-openvas v21.4.4 with the instruction given on https://greenbone.github.io/docs/21.04/index.html#ospd-openvas it ends in an error: Could not install packages due to an EnvironmentError: 404 Client Error: Not Found for url: https://pypi.org/simple/v21-4-4/

I have version 21.4.3, I need to update 21.4.4
I don’t know how to do.

If you build from source just do it again and override your previous installation. Otherwise see https://greenbone.github.io/docs/latest/faq.html#can-you-help-with-my-issue-on-kali-cent-os-xyz-distribution

And btw. I’ve written something about this already in this thread Discussion: GVM Release Version 21.4.4 - #2 by bricks

1 Like

Can you just try again. It seems to be an issue on pypi to me which is out of our influence.

1 Like

It still ends in the same Error. so i have to ask on pypi to fix the problem.
Thx for your help.