Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gvmd failed to save scan results in the new DB versions from 252 #1990

Closed
dvppvd opened this issue May 23, 2023 · 1 comment · Fixed by #1991
Closed

gvmd failed to save scan results in the new DB versions from 252 #1990

dvppvd opened this issue May 23, 2023 · 1 comment · Fixed by #1991
Labels
bug Something isn't working

Comments

@dvppvd
Copy link
Contributor

dvppvd commented May 23, 2023

Expected behavior

gvmd properly save scan results.

Actual behavior

The column hash_value is added to the results and report_host_details tables when the gvmd DB is migrated from the version 251 to version 252 and from the version 252 to version 253 accordingly, but is not created when the tables are newly created. This makes gvmd failed to save scan results, as shown in the following logs:

md manage:WARNING:2023-05-22 09h05.01 UTC:986: sql_exec_internal: PQexec failed: ERROR:  column "hash_value" does not exist
LINE 1: ...ISTS (SELECT * FROM results  WHERE report = 1 and hash_value...
                                                             ^
 (7)
md manage:WARNING:2023-05-22 09h05.01 UTC:986: sql_exec_internal: SQL: SELECT EXISTS (SELECT * FROM results  WHERE report = 1 and 
hash_value = '...');
md manage:WARNING:2023-05-22 09h05.01 UTC:986: sql_x: sql_exec_internal failed
md manage:WARNING:2023-05-22 09h05.01 UTC:986: manage_cleanup_process_error: Error exit, setting running task to Interrupted
md manage:WARNING:2023-05-22 09h05.01 UTC:986: sql_exec_internal: PQexec failed: ERROR:  current transaction is aborted, commands 
ignored until end of transaction block
 (7)
md manage:WARNING:2023-05-22 09h05.01 UTC:986: sql_exec_internal: SQL: UPDATE reports SET scan_run_status = 13 WHERE id = 1;
md manage:WARNING:2023-05-22 09h05.01 UTC:986: sqlv: sql_exec_internal failed
LINE 1: ...OM report_host_details  WHERE report_host = 9 and hash_value...
                                                             ^
 (7)
md manage:WARNING:2023-05-22 10h10.14 UTC:6511: sql_exec_internal: SQL: SELECT EXISTS (SELECT * FROM report_host_details  WHERE report_host = 9 and hash_value = '...');
md manage:WARNING:2023-05-22 10h10.14 UTC:6511: sql_x: sql_exec_internal failed
md manage:WARNING:2023-05-22 10h10.14 UTC:6511: manage_cleanup_process_error: Error exit, setting running task to Interrupted
md manage:WARNING:2023-05-22 10h10.14 UTC:6511: sql_exec_internal: PQexec failed: ERROR:  current transaction is aborted, commands ignored until end of transaction block
 (7)
md manage:WARNING:2023-05-22 10h10.14 UTC:6511: sql_exec_internal: SQL: UPDATE reports SET scan_run_status = 13 WHERE id = 3;
md manage:WARNING:2023-05-22 10h10.14 UTC:6511: sqlv: sql_exec_internal failed

Steps to reproduce

  1. Install a new gvmd version using the latest main/stable source.
  2. Launch a scan.
  3. Observer the error in the log file.
@cfi-gb
Copy link
Member

cfi-gb commented May 23, 2023

For the reference, the new column got introduced in #1938 / #1945

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants