greenbone / gvmd

Greenbone Vulnerability Manager - The database backend for the Greenbone Community Edition
GNU Affero General Public License v3.0
281 stars 153 forks source link

[gvmd 9.0.0] task with conditional alert fails on insert report_counts #1000

Closed cliffcotino closed 4 years ago

cliffcotino commented 4 years ago

Expected behavior

We've created a scan task with an alert which should only trigger when there are issues with a severity level than a certain treshold.

  1. When we set the condition to Always, the alert email should be sent correctly
  2. When we set the condition to Severity at least=0.1 we expect alerts only when there are issues higher than the treshold.

Actual behavior

  1. When we set the condition to Always, the alert email is sent correctly
  2. When we set the condition to Severity at least=0.1 we get a failure in the logs, and no alert mail is sent

GVM versions

gsa: (gsad --version) gsad --version Greenbone Security Assistant 9.0

gvm: (gvmd --version) Greenbone Vulnerability Manager 9.0.0

openvas-scanner: (openvas --version) OpenVAS 7.0.0

gvm-libs: 11.0.0

Environment

Operating system: Ubuntu 18.04 (Docker) Linux greenbone 4.19.76-linuxkit #1 SMP Thu Oct 17 19:31:58 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Installation method / source: (packages, source installation)

Logfiles

==> /opt/gvm/var/log/gvm/gvmd.log <==
event task:MESSAGE:2020-03-03 12h20.06 UTC:5104: Status of task Scan Hosts 192.168.86.1 (6890bca3-0630-4a11-aac2-a275e8b9091c) has changed to Done
md manage:WARNING:2020-03-03 12h20.06 UTC:5104: sql_exec_internal: PQexec failed: ERROR:  integer out of range
 (7)
md manage:WARNING:2020-03-03 12h20.06 UTC:5104: sql_exec_internal: SQL: INSERT INTO report_counts (report, "user", override, min_qod, severity,  count, end_time) VALUES (94092163306816,         (SELECT id FROM users          WHERE users.uuid = '0c609ffd-86f4-4879-b40c-d611b3f03298'),         1, 70, -99.0,         0, 0);
md manage:WARNING:2020-03-03 12h20.06 UTC:5104: sqlv: sql_exec_internal failed
bjoernricks commented 4 years ago

Could you please retest with the release branches?

cliffcotino commented 4 years ago

I'll give it a try, we'll need to change our build scripts first, as it's more geared towards using the released tarball versions.

cliffcotino commented 4 years ago

It does not seem to work, it's failing with a similar error:

md manage:WARNING:2020-04-30 15h09.26 UTC:1071: sql_exec_internal: SQL: INSERT INTO report_counts (report, "user", override, min_qod, severity,  count, end_time) VALUES (94392588265712,         (SELECT id FROM users          WHERE users.uuid = 'e37ca521-a612-4c3c-bfc0-294970863cc5'),         1, 70, -99.0,         0, 0);
md manage:WARNING:2020-04-30 15h09.26 UTC:1071: sqlv: sql_exec_internal failed
cliffcotino commented 4 years ago

Closing due to the fact that I am no longer using the project