SCAP Database required

Hello,

My gvmd is having trouble communicating with the PostgreSQL database it seems. I have determined that the NVTs table exists with around ~63k entries. The database admin is correctly set to my user too.

However, as the image suggests, the SCAP database is not correctly generated. This is the gvmd log:

md manage: WARNING: 2021-03-05 15h23.05 utc:15584: split _xml_ file: system failed with ret 512, 1 (2), xml_split -s40Mb split.xml && head -n 2 split-00.xml > head.xml && echo '</cpe-list>' > tail.xml && for F in split-*.xml; do awk 'NR>3 {print last} {last=$0}' $F > body .xml && cat head.xml body.xml tail.xml > $F; done
md manage: WARNING: 2021-03-05 15h23.05 utc:15584: split_xml_ file: and failed to chdir back
md manage:WARNING: 2021-03-05 15h23.05 utc:15584: update scap cpes: Failed to split CPEs, attempting with full file
-- (a reboot happened here) --
md main:MESSAGE:2021-03-05 15h24.59 utc:823: Greenbone Vulnerability Manager version 20.08.1~git-cda16138-HEAD (GIT revision cda16138-HEAD) (DB revision 233)
md manage: MESSAGE: 2021-03-05 15h25.00 utc:824: No SCAP database found
util gpgme:MESSAGE : 2021-03-05 15h25.00 utc:824: Setting GnuPG dir to 'opt/gvm/var/lib/gvm/gvmd/gnupg'
util gpgme:MESSAGE: 2021-03-05 15h25.01 utc:824: Using OpenPGP engine version '2.2.12'
md manage: WARNING: 2021-03-05 15h25.04 utc:850: update scap: No SCAP db present, rebuilding SCAP db from scratch
md manage: INFO: 2021-03-05 15h25.04 utc:850: update scap: Updating data from feed
md manage: INFO: 2021-03-05 15h25.04 utc:850: Updating CPEs
md manage:WARNING: 2021-03-05 15h26.02 utc:850: update scap cpes from file: CPE dictionary missing CPE-LIST
md manage: WARNING: 2021-03-05 15h26.04 utc:950: update scap: No SCAP db present, rebuilding SCAP db from scratch
md manage: INFO: 2021-03-05 15h26.04 utc:950: update scap: Updating data from feed
md manage: INFO: 2021-03-05 15h26.04 utc:950: Updating CPEs
md manage: WARNING: 2021-03-05 15h26.57 utc:950: update scap cpes from file: CPE dictionary missing CPE-LIST
md manage:WARNING: 2021-03-05 15h27.06 utc:1083: update scap: No SCAP db present, rebuilding SCAP db from scratch
md manage: INFO: 2021-03-05 15h27.07 utc:1083: update scap: Updating data from feed
md manage: INFO: 2021-03-05 15h27.07 utc:1083: Updating CPEs

It goes on like this forever, there are hundreds of lines in the log from 10am, when the service was first started.

I also took a look at the log’s head and found this:

sql_exec_internal: PQexec failed: ERROR: relation "public.meta" does not exist
LINE 1: SELECT value FROM public.meta WHERE name = 'database_version...

Any clues on how I may debug this?
Thanks in advance :slight_smile:


GVM versions

gsad: Greenbone Security Assistant 20.08.1~git-fc9e55140
gvmd: Greenbone Vulnerability Manager 20.08.1~git~cda16138-HEAD
GIT revision cda16138-HEAD
Manager DB revision 233
openvas-scanner: OpenVAS 20.08.1
gvm-libs: gvm-libs 20.8.1~git~2712b4d-HEAD

PostgreSQL

psql --version

psql (PostgreSQL) 11.10 (Debian 11.10-0+deb10u1)

(dpkg -l | grep postgresql)

ii postgresql 11+200+deb10u4 all
ii postgresql-11 11.10-0+deb10u1 amd64
ii postgresql-client-11 11.10-0+deb10u1 amd64
ii postgresql-client-common 200+deb10u4 all
ii postgresql-common 200+deb10u4 all
ii postgresql-contrib 11+200+deb10u4 all
ii postgresql-server-dev-11 11.10-0+deb10u1 amd64
ii postgresql-server-dev-all 200+deb10u4 all

Environment

Operating system: Debian 10 ‘Buster’
Kernel: Linux dcvx-secvas-p1 4.19.0-14-amd64 #1 SMP Debian 4.19.171-2 (2021-01-30) x86_64 GNU/Linux
Installation method / source: ISO

I managed to solve this on my own.

By chance, amidst some thought process, I ran df, the Linux command to display disk fragmentation and space allocation. I noticed the disk partition that contained /tmp was at 98%, then going back to 1%, then approaching 98%, and doing this nonstop.

Suspiciously, the moment of this transition (somewhat) coincided with the “No scap dp present” in the log. I’m unsure what the original size of the partition was, but, after increasing it by 5 GB, the errors in the log stopped. A few minutes afterwards, GSA (the web interface) had been rid of the red flag “The SCAP database is required” and displayed NVTs correctly.

2 Likes