Comments (7)
This issue is opened since 4 months and nobody answered?
from gvmd.
Thanks, I've applied the patch, the first task started, the second one remain stucked at 1% with the following errors in the log:
md manage:WARNING:2019-09-30 12h10.26 UTC:9633: sql_prepare_internal: sqlite3_prepare failed: no more rows available
md manage:WARNING:2019-09-30 12h10.26 UTC:9633: sql_x_internal: sql_prepare failed
md manage:WARNING:2019-09-30 12h10.26 UTC:9633: sql_close: attempt to close db with open statement(s)
This happens also when trying to open the report from the 1st completed target scan.
Thanks.
from gvmd.
I'm experiencing the same problem. I'm running alpine edge in a docker container with the following package versions installed:
sqlite-3.29.0
gvmd-8.0.1
openvas-scanner-6.0.1
greenbone-security-assistant-8.0.1
from gvmd.
@fcolista @0x4c-code
this problem, you need change sql "%" to "%%", it's init_otp_pref_iterator function in manage_sql.c
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:
gcc $(pkg-config --cflags --libs glib-2.0) -o test test.c
from gvmd.
@fcolista
This same problem.
patch
from gvmd.
@fcolista, on this issue:
What I've noticed (perhaps is linked to this problem), is that importing the nvt i got tons of these WARNING:
md manage:WARNING:2019-04-09 19h27.24 utc:1035: parse_ctime: Failed to parse time '2018-02-27T19:15:33.110Z'
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.
https://gitlab.alpinelinux.org/alpine/aports/merge_requests/4427
Similar issue with gvm-libs:
https://gitlab.alpinelinux.org/alpine/aports/merge_requests/4426
from gvmd.
sqlite support has been dropped some versions ago. therefore closing this issue.
from gvmd.
Related Issues (20)
- schedules - date/time problems HOT 4
- Scans with custom nth day of month schedule fail at 0% when manually started HOT 4
- Stale global_current_report causes subsequent gvmd requests to fail HOT 2
- gvmd failed to save scan results in the new DB versions from 252 HOT 1
- Upgrader la version de gvm de 22.4.0 à 22.4.1 HOT 1
- sql_exec_internal failed in check_osp_result_exists() HOT 2
- gvmd fail to compile HOT 5
- gvmd@gvmd FATAL: remaining connection slots are reserved for non-replication superuser connections HOT 19
- Scan exits after one second and no result ouput HOT 2
- Support passing max-email-attachment-size parameter through docker-compose.yml file
- gvmd --delete-scanner does not remove tasks.
- CPE with wildcard not being matched HOT 1
- CentOS creates 0-byte PDF report HOT 3
- Email Alert message with `attach report` option does not allow use of $i for full report text HOT 1
- Get Errors when try to 'make' HOT 5
- gvmd randomly segfaults when viewing e.g. scan results hosts tab in gsa
- Http Alerts don't work HOT 2
- Gvmd creates a pidfile not owned by root
- `free(): invalid pointer` / `corrupted size vs. prev_size` when starting up gvmd HOT 1
- gvm-setup fails HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gvmd.