GVM versions
gsad: 20.08.0~git
gvmd: 20.08.0 (Manager DB revision 233)
openvas-scanner: 20.8.0
gvm-libs: 20.8.0
Environment
Operating system: Debian v10.7 (Buster)
Kernel: Linux openvas 4.19.0-13-amd64 #1 SMP Debian 4.19.160-2 (2020-11-28) x86_64 GNU/Linux
Installation method / source: Source install.
I have a mostly working system in place, except that the feed updates fail.
I see this continuously:
md manage:WARNING:2020-12-14 22h19.21 utc:12611: update_scap: No SCAP db present, rebuilding SCAP db from scratch
md manage: INFO:2020-12-14 22h19.21 utc:12611: update_scap: Updating data from feed
md manage: INFO:2020-12-14 22h19.21 utc:12611: Updating CPEs
md manage:WARNING:2020-12-14 22h21.25 utc:12611: sql_exec_internal: PQexec failed: ERROR: ON CONFLICT DO UPDATE command cannot affect row a second time
HINT: Ensure that no rows proposed for insertion within the same command have duplicate constrained values.
It is followed by a very large sql statement (I can paste if requested, but I’m not permitted to upload files) along the lines of:
SQL: INSERT INTO scap2.cpes (uuid, name, title, creation_time, modification_time, status, deprecated_by_id, nvd_id) VALUES ('cpe:/a:chef:chef:15.0.273', 'cpe:/a:chef:chef:15.0.273', 'Chef 15.0.273', 1574089089, 1574089089, 'FINAL', NULL, '634111'),
... (many such values) ...
ON CONFLICT (uuid) DO UPDATE SET name = EXCLUDED.name, title = EXCLUDED.title, creation_time = EXCLUDED.creation_time, modification_time = EXCLUDED.modification_time, status = EXCLUDED.status, deprecated_by_id = EXCLUDED.deprecated_by_id, nvd_id = EXCLUDED.nvd_id;
The table it is attempting to insert into, is empty:
gvmd=> select * from scap2.cpes
gvmd-> ;
id | uuid | name | comment | creation_time | modification_time | title | status | deprecated_by_id | max_cvss | cve_refs | nvd_id
----+------+------+---------+---------------+-------------------+-------+--------+------------------+----------+----------+--------
(0 rows)
Anyway, this causes the feed update to fail, and leaves a 468MB temp dir which it does not clean up. It immediately tries again, downloading and failing until my /tmp
folder is filled:
md manage:WARNING:2020-12-14 21h37.36 utc:11864: split_xml_file: Failed to make temp dir: No space left on device
md manage:WARNING:2020-12-14 21h37.36 utc:11864: update_scap_cpes: Failed to split CPEs, attempting with full file
I can only assume that this is not a widespread problem, or that there is a straightforward fix for this that I’ve not hit on. I’d really appreciate any ideas/suggestions you might have.