-
Notifications
You must be signed in to change notification settings - Fork 159
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
Cannot start task on GSA with GVM 10. Error: sql_x_internal: sql_prepare failed #473
Comments
I'm experiencing the same problem. I'm running alpine edge in a docker container with the following package versions installed:
|
This issue is opened since 4 months and nobody answered? |
@fcolista @0x4c-code test code #include <glib.h>
#include <stdio.h>
// use centos or other linux
/*
void
test_glib(const char *format, ...)
{
gchar *formatted = NULL;
va_list args;
va_start (args, format);
formatted = g_strdup_vprintf(format, args);
printf("format: %d %s\n", len, formatted);
va_end(args);
}
*/
// use vasprintf
void
test_vasprintf(const char *format, ...)
{
gint len;
gchar *formatted = NULL;
va_list args;
va_start (args, format);
len = vasprintf (&formatted, format, args);
if (len < 0)
formatted = NULL;
printf("format: %d %s\n", len, formatted);
va_end(args);
}
void
main(void)
{
long long int config = 5;
gchar *t1 = "SERVER_PREFS";
gchar *t2 = "NOT LIKE '%[%]%'";
/**
simale test
**/
//test_glib("%llu, %s, %s, %llu\n", config, t1, t2, config);
test_vasprintf("%llu, %s, %s, %llu\n", config, t1, t2, config);
/*
origin sql code
results are different on alpine linux and centos
*/
const char *format = "SELECT config_preferences.name, config_preferences.value"
" FROM config_preferences, nvt_preferences"
" WHERE config_preferences.config = %llu"
" AND config_preferences.type = '%s'"
" AND (config_preferences.name = nvt_preferences.name"
" OR config_preferences.name LIKE 'timeout.%')"
" AND config_preferences.name != 'max_checks'"
" AND config_preferences.name != 'max_hosts'"
" UNION"
" SELECT nvt_preferences.name, nvt_preferences.value"
" FROM nvt_preferences"
" WHERE nvt_preferences.name %s"
" AND (SELECT COUNT(*) FROM config_preferences"
" WHERE config = %llu"
" AND config_preferences.name = nvt_preferences.name) = 0;\n\n";
//test_glib(format, config, t1, t2, config);
test_vasprintf(format, config, t1, t2, config); // It' ok on centos result, But it turns out to be null on alpine linux
/*
change 'timeout.%' to 'timeout.%%'
*/
const char *format1 = "SELECT config_preferences.name, config_preferences.value"
" FROM config_preferences, nvt_preferences"
" WHERE config_preferences.config = %llu"
" AND config_preferences.type = '%s'"
" AND (config_preferences.name = nvt_preferences.name"
" OR config_preferences.name LIKE 'timeout.%%')"
" AND config_preferences.name != 'max_checks'"
" AND config_preferences.name != 'max_hosts'"
" UNION"
" SELECT nvt_preferences.name, nvt_preferences.value"
" FROM nvt_preferences"
" WHERE nvt_preferences.name %s"
" AND (SELECT COUNT(*) FROM config_preferences"
" WHERE config = %llu"
" AND config_preferences.name = nvt_preferences.name) = 0;\n\n";
//test_glib(format1, config, t1, t2, config);
test_vasprintf(format1, config, t1, t2, config);// same result, on centos and alpine linux
} compiling: |
Merging the patch for the bug described in: greenbone/gvmd#473 and patched in greenbone/gvmd#758
Thanks, I've applied the patch, the first task started, the second one remain stucked at 1% with the following errors in the log:
This happens also when trying to open the report from the 1st completed target scan. |
@fcolista, on this issue:
This has to do with the difference in Musl-lib and Gliibc's strptime. I've opened a merge request on the aports repo and wanted to let the upstream (Greenbone) as well as any others having the same issue know about it. |
sqlite support has been dropped some versions ago. therefore closing this issue. |
Expected behavior
Running a task on GSA, the task is completed
Current behavior
Task does not run.
Steps to reproduce
I've made an How-To which describes the steps to install GVM on Alpine:
https://wiki.alpinelinux.org/wiki/Setting_up_GVM10
Basically, install the packages, run GSA (with or without signature is the same), create a task.
Task does not run.
GVM versions
gsa: (gsad --version)
Greenbone Security Assistant 8.0.0
gvm: (gvmd --version)
Greenbone Vulnerability Manager 8.0.0
Manager DB revision 205
openvas-scanner: (openvassd --version)
OpenVAS Scanner 6.0.0
gvm-libs:
gvm-libs-10.0.0
openvas-smb:
Not used
Environment
Operating system:
Alpine Linux edge on x86_64 arch.
Installation method / source: (packages, source installation)
Packages
I get these errors when I start a task on gsa:
This happens with the following packages installed:
What I've noticed (perhaps is linked to this problem), is that importing the nvt i got tons of these WARNING:
Please note that Alpine doesn't use /etc/TZ to set local time, rather tzdata
According with gvmd logs, seems that somehow I'm hitting a limit:
No more rows available.
But this is impossible, since the limit is 140Terabyte and SQLite documentation states:
SQlite on Alpine is built with the following options:
I've not tested with PostgreSQL as yet.
Also appears to be impossible to build gvmd supporting both postgres and sqlite since
-DBACKEND
takes only SQLITE3 or POSTGRESQL..: Francesco
The text was updated successfully, but these errors were encountered: