Atomicorp / gvm

Greenbone Vulnerability Manager / Openvas packaging project
GNU Affero General Public License v3.0
74 stars 19 forks source link

[Vulnerabilities] An internal error occurred while getting resources list #42

Closed presianbg closed 3 years ago

presianbg commented 3 years ago

Hi,

Is anyone having this problem: image

Browser console shows this:

GET https://10.20.1.150/gmp?token=ecf6ac5e-ec98-430a-b4c2-a59d0751b264&cmd=get_vulns&filter=sort%3Dname%20first%3D1%20rows%3D15 500 (Internal Server Error)

If you try to visit the url manually: image

I couldn't find any clues in the system logs.

Any proposals ?

Kind regards, PY

presianbg commented 3 years ago

in the gvmd.log I can see few related SQL fails:

md manage:WARNING:2020-12-01 13h32.00 EET:1950729: sql_exec_internal: PQexec failed: ERROR:  relation "vulns" does not exist
LINE 1: ...         AND task = results.task)) AS newest FROM vulns , (S...
                                                             ^
 (7)
md manage:WARNING:2020-12-01 13h32.00 EET:1950729: sql_exec_internal: SQL: SELECT id AS id, uuid AS uuid, name AS name, '' AS comment, iso_time (creation_time), iso_time (modification_time), creation_time AS created, modification_time AS modified, cast (null AS text) AS _owner, '' AS owner, vuln_results (uuid, opts.task, opts.report, opts.host) AS results, (SELECT count(*) FROM  (SELECT results.host FROM results  WHERE nvt = vulns.uuid    AND (opts.report IS NULL OR results.report = opts.report)    AND (opts.task IS NULL OR results.task = opts.task)    AND (opts.host IS NULL OR results.host = opts.host)    AND (results.severity != -3.0)    AND (SELECT has_permission FROM permissions_get_tasks         WHERE "user"                = (SELECT id FROM users                   WHERE uuid                         = (SELECT current_setting                                    ('gvmd.user.uuid')))           AND task = results.task)      GROUP BY results.host) AS hosts_subquery) AS hosts, severity, qod, (SELECT iso_time (min (date)) FROM results  WHERE nvt = vulns.uuid    AND (opts.report IS NULL OR results.report = opts.report)    AND (opts.task IS NULL OR results.task = opts.task)    AND (opts.host IS NULL OR results.host = opts.host)    AND (results.severity != -3.0)    AND (SELECT has_permission FROM permissions_get_tasks         WHERE "user"                = (SELECT id FROM users                   WHERE uuid                         = (SELECT current_setting                                    ('gvmd.user.uuid')))           AND task = results.task)), (SELECT iso_time (max (date)) FROM results  WHERE nvt = vulns.uuid    AND (opts.report IS NULL OR results.report = opts.report)    AND (opts.task IS NULL OR results.task = opts.task)    AND (opts.host IS NULL OR results.host = opts.host)    AND (results.severity != -3.0)    AND (SELECT has_permission FROM permissions_get_tasks         WHERE "user"                = (SELECT id FROM users                   WHERE uuid                         = (SELECT current_setting                                    ('gvmd.user.uuid')))           AND task = results.task)), type, (SELECT min (date) FROM results  WHERE nvt = vulns.uuid    AND (opts.report IS NULL OR results.report = opts.report)    AND (opts.task IS NULL OR results.task = opts.task)    AND (opts.host IS NULL OR results.host = opts.host)    AND (results.severity != -3.0)    AND (SELECT has_permission FROM permissions_get_tasks         WHERE "user"                = (SELECT id FROM users                   WHERE uuid                         = (SELECT current_setting                                    ('gvmd.user.uuid')))           AND task = results.task)) AS oldest, (SELECT max (date) FROM results  WHERE nvt = vulns.uuid    AND (opts.report IS NULL OR results.report = opts.report)    AND (opts.task IS NULL OR results.task = opts.task)    AND (opts.host IS NULL OR results.host = opts.host)    AND (results.severity != -3.0)    AND (SELECT has_permission FROM permissions_get_tasks         WHERE "user"                = (SELECT id FROM users                   WHERE uuid                         = (SELECT current_setting                                    ('gvmd.user.uuid')))           AND task = results.task)) AS newest FROM vulns , (SELECT cast (null AS integer) AS task, cast (null AS integer) AS report, cast (null AS text) AS host, 70 AS min_qod) AS opts WHERE  t () AND (vuln_results (uuid, opts.task, opts.report,                    opts.host) > 0) AND (qod >= opts.min_qod) ORDER BY lower (name) ASC LIMIT 15 OFFSET 0;
md manage:WARNING:2020-12-01 13h32.00 EET:1950729: next: sql_exec_internal failed
md manage:WARNING:2020-12-01 13h32.01 EET:1950738: sql_exec_internal: PQexec failed: ERROR:  relation "vulns" does not exist
LINE 1: ...T (NULL AS TEXT) AS aggregate_subgroup_value FROM vulns, (SE...
                                                             ^
 (7)
md manage:WARNING:2020-12-01 13h32.01 EET:1950738: sql_exec_internal: SQL: SELECT sum(aggregate_count) AS outer_count, aggregate_group_value AS outer_group_column, aggregate_subgroup_value AS outer_subgroup_column  FROM (SELECT  count(*) AS aggregate_count, severity AS aggregate_group_value, CAST (NULL AS TEXT) AS aggregate_subgroup_value FROM vulns, (SELECT cast (null AS integer) AS task, cast (null AS integer) AS report, cast (null AS text) AS host, 70 AS min_qod) AS opts WHERE  t () AND (vuln_results (uuid, opts.task, opts.report,                    opts.host) > 0) AND (qod >= opts.min_qod)   GROUP BY severity  )      AS agg_sub GROUP BY outer_group_column, outer_subgroup_column ORDER BY outer_group_column ASC LIMIT ALL OFFSET 0;
md manage:WARNING:2020-12-01 13h32.01 EET:1950738: next: sql_exec_internal failed

Looks like same here: https://community.greenbone.net/t/pqexec-failed-error-relation-vulns-does-not-exist/6876/2