Possible Database corruption

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
rfc4711
Posts: 2
Joined: Mon Jan 07, 2019 5:45 pm

Possible Database corruption

Post by rfc4711 »

I've been trying to add a XML SNMP query for the LM sensors MIB and always getting below error message in my cacti.log, for some reason the graph never updates and does not generate an rrd file. I suspect the database has been corrupted on my graph templates, whatever have in there is working, though adding new graph templates is not. I tested my configuration on a new install and it is working there without a problem, how can I troubleshoot this further?

Below error are shows when I look the the device graphs, the "selected graph template" is blank and cannot be changed.

Code: Select all

2019/01/07 12:04:54 - DBCALL ERROR: SQL Assoc Failed!, Error:1064, SQL:'SELECT   snmp_query_graph_id, GROUP_CONCAT(snmp_field_name ORDER BY snmp_field_name) AS columns   FROM snmp_query_graph_rrd   GROUP BY snmp_query_graph_id   HAVING '
2019/01/07 12:04:54 - DBCALL ERROR: SQL Assoc Failed!, Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
2019/01/07 12:04:54 - CMDPHP SQL Backtrace: (/graphs.php: 104 graph_edit)(/graphs.php: 1351 get_common_graph_templates)(/graphs.php: 451 db_fetch_assoc_prepared)(/lib/database.php: 402 cacti_debug_backtrace)
2019/01/07 12:04:54 - CMDPHP SQL Backtrace: (/graphs.php: 104 graph_edit)(/graphs.php: 1351 get_common_graph_templates)(/graphs.php: 457 db_fetch_cell_prepared)(/lib/database.php: 281 cacti_debug_backtrace)
2019/01/07 12:04:54 - DBCALL ERROR: SQL Assoc Failed!, Error:1064, SQL:'SELECT CONCAT_WS('', graph_template_id, '_', id, '') AS id, name   FROM snmp_query_graph   WHERE (snmp_query_id = 21   AND id IN ()) OR graph_template_id IN () ORDER BY name'
2019/01/07 12:04:54 - DBCALL ERROR: SQL Assoc Failed!, Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')) OR graph_template_id IN () ORDER BY name' at line 1
2019/01/07 12:04:54 - CMDPHP SQL Backtrace: (/graphs.php: 104 graph_edit)(/graphs.php: 1403 draw_edit_form)(/lib/html_form.php: 112 draw_edit_control)(/lib/html_form.php: 269 db_fetch_assoc)(/lib/database.php: 361 db_fetch_assoc_prepared)(/lib/database.php: 402 cacti_debug_backtrace)

Code: Select all

Cacti Version	1.1.38
Cacti OS	unix
RSA Fingerprint	30:60:ce:09:de:10:83:b6:fa:29:24:df:f6:64:d1:d2
NET-SNMP Version	NET-SNMP version: 5.7.3
RRDtool Version	RRDtool 1.5.x
HP Version	7.0.32-0ubuntu0.16.04.1
PHP OS	Linux
PHP uname	Linux cacti 4.4.35-1-pve #1 SMP Fri Dec 9 11:09:55 CET 2016 x86_64
PHP SNMP	Installed
max_execution_time	30
memory_limit	128M
Attachments
Screen Shot 2019-01-07 at 5.54.37 PM.png
Screen Shot 2019-01-07 at 5.54.37 PM.png (69.08 KiB) Viewed 1710 times
User avatar
Osiris
Cacti Guru User
Posts: 1424
Joined: Mon Jan 05, 2015 10:10 am

Re: Possible Database corruption

Post by Osiris »

I would suggest trying to update to 1.2, but something is quite odd. Getting SQL errors warrants an issue in GitHub.
Before history, there was a paradise, now dust.
rfc4711
Posts: 2
Joined: Mon Jan 07, 2019 5:45 pm

Re: Possible Database corruption

Post by rfc4711 »

TY, opened https://github.com/Cacti/cacti/issues/2284 to track this issue.
ItzNota
Posts: 2
Joined: Wed Jan 09, 2019 12:27 pm

Re: Possible Database corruption

Post by ItzNota »

I did an update to the workstation and that is when I started getting that exact error. Tried to downgrade, but still did not work.
User avatar
Osiris
Cacti Guru User
Posts: 1424
Joined: Mon Jan 05, 2015 10:10 am

Re: Possible Database corruption

Post by Osiris »

Okay, the data base is not corrupted. The issue is with the Data Query XML export. The other issue, is a bug in Cacti when trying to get the graph templates. I'll be addressed, in the mean time import the following XML, which fixes the problem.
Attachments
cacti_data_query_net-snmp_-_get_temperature_sensors.xml
(15.31 KiB) Downloaded 58 times
Before history, there was a paradise, now dust.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest