GVMD: PQexec failed: ERROR: syntax error at or near "and"

Hello!

I’m using Greenbone Community Containers 22.4 on ubuntu and recently often experience the same error:
In GUI the scan progress freezes on some value while based on htop and ospd logs info the testing is still on.

In Gvmd logs there is an error with sql syntax:

md manage:WARNING:2023-06-28 22h25.58 UTC:73207: sql_exec_internal: PQexec failed: ERROR:  syntax error at or near "and"
LINE 1: ....'    and port = 'general/tcp' and severity =     and qod = ...
                                                             ^
 (7)
md manage:WARNING:2023-06-28 22h25.58 UTC:73207: sql_exec_internal: SQL: SELECT EXISTS (SELECT * FROM results   WHERE report = 31 and hash_value = '62e3499eca6fd17109284988bb529270'    and host = '10.10.10.10' and hostname = ''    and type = 'Error Message' and description = 'NVT timed out after 600 seconds.'    and port = 'general/tcp' and severity =     and qod =  and path = '' );
md manage:WARNING:2023-06-28 22h25.58 UTC:73207: sql_x: sql_exec_internal failed
md manage:WARNING:2023-06-28 22h25.58 UTC:73207: manage_cleanup_process_error: Error exit, setting running task to Interrupted
md manage:WARNING:2023-06-28 22h25.58 UTC:73207: sql_exec_internal: PQexec failed: ERROR:  current transaction is aborted, commands ignored until end of transaction block
 (7)
md manage:WARNING:2023-06-28 22h25.58 UTC:73207: sql_exec_internal: SQL: UPDATE reports SET scan_run_status = 13 WHERE id = 31;
md manage:WARNING:2023-06-28 22h25.58 UTC:73207: sqlv: sql_exec_internal failed

The scan settings “Add results to Assets no”
Could it be that there is a syntax error in the code for sql query checking report for duplicates for ‘NVT timed out after 600 seconds.’ with this type of scan?

A restart of the scan helps till the next error but maybe there is a way to completely get rid of this type of error?

I think you will be asked to open an issue in Github, then wait.

sql_exec_internal failed in check_osp_result_exists() · Issue #2006 · greenbone/gvmd (github.com)