Part 1
I upgraded today to using OpenVAS 10 (gvmd 8.0.0), using postgresql, and I’m getting this error repeatedly in gvmd.log when I try to delete a report:
sql_exec_internal: PQexec failed: ERROR: relation “reports_trash” does not exist
When I look in the database, lo and behold, it truly isn’t there. Looking into the source code, I find:
- There is no
CREATE TABLE
line for reports_trash find_trash_report_with_permission
is called at gvmd-8.0.0/src/manage_sql.c #26907, which (if I’m reading it correctly), eventually queries the reports_trash table, which doesn’t exist and so throws an error.
Part 2
So, being a tinkerer, I went ahead and created a reports_trash
table defined the same as the reports
table (including constraints, indexes, foreign keys, etc., but without adding references from other tables). Now, the first error disappears, but this one is in its place:
Report {name} - {timestamp} ({uuid}) could not be deleted by {user}
I’m pretty sure all the user permissions are correct, and that it’s not simply a privilege issue. I started trying to look through the source code for ideas as to what was causing this error, but I think I’m getting a little in over my head, without having any prior familiarity with the source.
One thing to note, in case it means anything to anyone, is that the kludged reports_trash
table is always empty, and the original reports
table truly does still contain the reports I’m trying to delete.
Does anyone have any insight into this issue, or debugging advice?
Thanks!