CMDPHP: Poller[0] ERROR: SQL Assoc Failed

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

mistery
Posts: 3
Joined: Tue May 02, 2006 1:03 am

CMDPHP: Poller[0] ERROR: SQL Assoc Failed

Post by mistery »

Hello,

I have upgraded Cacti to 0.8.6i and now when I run the rebuild poller cache script I get the following error in the log:

10/21/2006 10:41:14 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed "select snmp_query_graph_rrd.snmp_field_name, data_template_rrd.id as data_template_rrd_id from (snmp_query_graph_rrd,data_template_rrd) where snmp_query_graph_rrd.data_template_rrd_id=data_template_rrd.local_data_template_rrd_id and snmp_query_graph_rrd.snmp_query_graph_id= and snmp_query_graph_rrd.data_template_id=41 and data_template_rrd.local_data_id=90"

Does anyone know how to fix this issue ?

Thanks
A.
User avatar
TheWitness
Developer
Posts: 17004
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Can you verify you MySQL version please?

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
mistery
Posts: 3
Joined: Tue May 02, 2006 1:03 am

Post by mistery »

TheWitness wrote:Can you verify you MySQL version please?

TheWitness
# rpm -q mysql
mysql-4.1.20-1.RHEL4.1

Thanks
A.
User avatar
TheWitness
Developer
Posts: 17004
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

I suspect a damaged database.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
trattos
Posts: 5
Joined: Thu Sep 28, 2006 4:36 pm
Location: Marseille (France)

Post by trattos »

TheWitness wrote:I suspect a damaged database.

TheWitness
I have MySQL 5 and there is the same problem with an remote host.

I can't join it (
SNMP Error
) but on locale machine there isn't problem.
User avatar
mgothard
Posts: 3
Joined: Wed Oct 25, 2006 11:05 am
Location: Houston, TX

Same problem

Post by mgothard »

We're running mysql-5.0.18-20.4 and having the exact same problem, where all errors are related to a graph id of "In/Out Errors/Discarded Packets" as shown below.

Code: Select all

10/25/2006 11:53:41 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed "select   snmp_query_graph_rrd.snmp_field_name,   data_template_rrd.id as data_template_rrd_id   from (snmp_query_graph_rrd,data_template_rrd)   where snmp_query_graph_rrd.data_template_rrd_id=data_template_rrd.local_data_template_rrd_id   and snmp_query_graph_rrd.snmp_query_graph_id=In/Out Errors/Discarded Packets   and snmp_query_graph_rrd.data_template_id=38   and data_template_rrd.local_data_id=646"
I first dicovered this when I noticed that many of my router graphs were displaying "nan" in the Current, Average, and Maximum fields. I have verified that SNMP is getting the data, but it is apparently not getting in the database or RRD files.

I'm running Cacti 0.8.6h, MySQL 5.0.18-20.4

If it is a database problem, how would I go about correcting it?

UPDATE: After upgrading to cacti 0.8.6i I'm still receiving these messages in the log, and my problematic .rrd files are still not getting updated.
jhoffert
Posts: 4
Joined: Thu Oct 26, 2006 10:34 am
Location: Columbia, MD

Add me to the list

Post by jhoffert »

I'm getting the error as well. Basically due to the portion of the SQL statement "snmp_query_graph_rrd.snmp_query_graph_id= and", the errors are being thrown. I've reinstalled cacti, v0.8.6i, and I'm running MySQL v mysql-4.1.20-1.RHEL4.1. Any solutions yet???

Here's my cacti log:

10/26/2006 11:01:02 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed "select snmp_query_graph_rrd.snmp_field_name, data_template_rrd.id as data_template_rrd_id from (snmp_query_graph_rrd,data_template_rrd) where snmp_query_graph_rrd.data_template_rrd_id=data_template_rrd.local_data_template_rrd_id and snmp_query_graph_rrd.snmp_query_graph_id= and snmp_query_graph_rrd.data_template_id=49 and data_template_rrd.local_data_id=10"
10/26/2006 11:00:40 AM - SYSTEM STATS: Time:1.1552 Method:cmd.php Processes:1 Threads:N/A Hosts:3 HostsPerProcess:3 DataSources:5 RRDsProcessed:5
10/26/2006 11:00:32 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed "select snmp_query_graph_rrd.snmp_field_name, data_template_rrd.id as data_template_rrd_id from (snmp_query_graph_rrd,data_template_rrd) where snmp_query_graph_rrd.data_template_rrd_id=data_template_rrd.local_data_template_rrd_id and snmp_query_graph_rrd.snmp_query_graph_id= and snmp_query_graph_rrd.data_template_id=49 and data_template_rrd.local_data_id=10"
10/26/2006 11:00:32 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed "select snmp_query_graph_rrd.snmp_field_name, data_template_rrd.id as data_template_rrd_id from (snmp_query_graph_rrd,data_template_rrd) where snmp_query_graph_rrd.data_template_rrd_id=data_template_rrd.local_data_template_rrd_id and snmp_query_graph_rrd.snmp_query_graph_id= and snmp_query_graph_rrd.data_template_id=49 and data_template_rrd.local_data_id=10"
10/26/2006 10:59:55 AM - SYSTEM STATS: Time:1.2058 Method:cmd.php Processes:1 Threads:N/A Hosts:3 HostsPerProcess:3 DataSources:5 RRDsProcessed:5
10/26/2006 10:57:19 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed "select snmp_query_graph_rrd.snmp_field_name, data_template_rrd.id as data_template_rrd_id from (snmp_query_graph_rrd,data_template_rrd) where snmp_query_graph_rrd.data_template_rrd_id=data_template_rrd.local_data_template_rrd_id and snmp_query_graph_rrd.snmp_query_graph_id= and snmp_query_graph_rrd.data_template_id=49 and data_template_rrd.local_data_id=9"
10/26/2006 10:57:19 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed "select snmp_query_graph_rrd.snmp_field_name, data_template_rrd.id as data_template_rrd_id from (snmp_query_graph_rrd,data_template_rrd) where snmp_query_graph_rrd.data_template_rrd_id=data_template_rrd.local_data_template_rrd_id and snmp_query_graph_rrd.snmp_query_graph_id= and snmp_query_graph_rrd.data_template_id=49 and data_template_rrd.local_data_id=9"
User avatar
mgothard
Posts: 3
Joined: Wed Oct 25, 2006 11:05 am
Location: Houston, TX

Not a great solution, but the errors are gone.

Post by mgothard »

I've managed to fix my problems but at the cost of loosing my historical data. I'm not very happy about it, but we needed current data. I ended up re-creating every data source that was having problems and deleting the old ones. :(

I know this won't help anybody else out there. I just didn't have the time to dink with it to determine exactly what the problem was.
jhoffert
Posts: 4
Joined: Thu Oct 26, 2006 10:34 am
Location: Columbia, MD

Post by jhoffert »

I solved my issue by following three steps:

1) don't use CACTID; use CMD.PHP
2) Turn on full degugging for POLLER
3) Setup log rotation to delete the POLLER event log every week so it doesn't get too big.

This fixed all my issues.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please check my "NaN Debugging" HosTo linked in my signature and feel free to comment or extend
Reinhard
sylaan
Posts: 2
Joined: Thu Dec 07, 2006 10:42 am

Post by sylaan »

I have the same issue and no idea how to solve it. I have several hosts configured and they are working fine but when I tried adding a new one, several days later, I get the error below:
12/11/2006 09:18:48 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed "select graph_local.graph_template_id from (graph_local,host_graph) where graph_local.graph_template_id=host_graph.graph_template_id and graph_local.host_id=host_graph.host_id and graph_local.host_id= group by graph_local.graph_template_id
Note the bolded part, that's why the SQL query fails. Mind you, in cacti I see the host ok, I can add graphs, etc. I just dont see them, the RRD is not created at all. I get that error When I click the "New graphs" link, after I define the device.

I am running this on a SuSE 9.2 system, mysql 4.0.21, cacti 0.8.6i. Any ideas ?
sylaan
Posts: 2
Joined: Thu Dec 07, 2006 10:42 am

Post by sylaan »

Anyone ?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Again, this looks like a damaged database. Try repairing tables
Reinhard
macfreek
Posts: 3
Joined: Mon Jul 23, 2007 10:27 am

Post by macfreek »

I encountered the same problem after I created a custom script and host.
gandalf wrote:Again, this looks like a damaged database. Try repairing tables
Reinhard
As expected, "mysqlcheck -u cacti -p cacti" showed that all tables are OK. That was expected as the error is of course in the faulty SQL generated by Cacti. ("where x=" is incorrect SQL, you MUST add a value, like: "where x=3" as sylaan correctly pointed out.

However, I found no tool in either the command line or the GUI where Cacti repairs the inconsistent database. Am I overlooking something?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Of course the SQL is wrong! But the data that should show up after the equal sign should be read from the DB!
Please open a new thread and post your current debug info
Reinhard
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests