Errors from PIA when adding items to graph tree

Support for the Plugin Architecture

Moderators: Developers, Moderators

Post Reply
djnono17
Posts: 21
Joined: Tue Aug 18, 2009 1:44 am

Errors from PIA when adding items to graph tree

Post by djnono17 »

Hi,

Okay, here's one i can't get my head arround, everytime i add a device to graph tree (or header, or graph), i get those errors

Code: Select all

11/17/2011 07:54:14 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'1100', SQL:"select user_auth_realm.realm_id from user_auth_realm where user_auth_realm.user_id='1' and user_auth_realm.realm_id='113'"
11/17/2011 07:54:14 AM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1100', SQL:"INSERT INTO plugin_realms (plugin, file, display) VALUES ('superlinks', 'superlinks-mgmt.php', 'Plugin -> SuperLinks: Manage Pages')'
11/17/2011 07:54:14 AM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1100', SQL:"INSERT INTO plugin_realms (plugin, file, display) VALUES ('superlinks', 'superlinks.php', 'Plugin -> SuperLinks: View Pages')'
11/17/2011 07:54:14 AM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1100', SQL:"INSERT INTO plugin_realms (plugin, file, display) VALUES ('weathermap', 'weathermap-cacti-plugin-mgmt.php', 'Plugin -> Weathermap: Configure/Manage')'
11/17/2011 07:54:14 AM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1100', SQL:"INSERT INTO plugin_realms (plugin, file, display) VALUES ('weathermap', 'weathermap-cacti-plugin.php', 'Plugin -> Weathermap: View')'
11/17/2011 07:54:14 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'1100', SQL:"SELECT 1 AS id, ph.name, ph.file, ph.function FROM plugin_hooks AS ph LEFT JOIN plugin_config AS pc ON pc.directory=ph.name WHERE ph.status = 1 AND hook = 'config_arrays' AND ph.name IN ('settings', 'boost', 'dsstats') UNION SELECT pc.id, ph.name, ph.file, ph.function FROM plugin_hooks AS ph LEFT JOIN plugin_config AS pc ON pc.directory=ph.name WHERE ph.status = 1 AND hook = 'config_arrays' AND ph.name NOT IN ('settings', 'boost', 'dsstats') ORDER BY id ASC" 
I have a fresh install (0.87h) with PIA 3.0 (using prepatched files).

the two select works fine when i exec them in mysql (from command line, as cactiuser)

I also checked the api_plugin_regiter_realm function,

Code: Select all

function api_plugin_register_realm ($plugin, $file, $display, $admin = false) {
	$exists = db_fetch_assoc("SELECT id FROM plugin_realms WHERE plugin = '$plugin' AND file = '$file'", false);
	print_r($exists); //TEST
	if (!count($exists)) {
		db_execute("INSERT INTO plugin_realms (plugin, file, display) VALUES ('$plugin', '$file', '$display')");
		if ($admin) {
			$realm_id = db_fetch_assoc("SELECT id FROM plugin_realms WHERE plugin = '$plugin' AND file = '$file'", false);
			$realm_id = $realm_id[0]['id'] + 100;
			$user_id = db_fetch_assoc("SELECT id FROM user_auth WHERE username = 'admin'", false);
			if (count($user_id)) {
				$user_id = $user_id[0]['id'];
				$exists = db_fetch_assoc("SELECT realm_id FROM user_auth_realm WHERE user_id = $user_id and realm_id = $realm_id", false);
				if (!count($exists)) {
					db_execute("INSERT INTO user_auth_realm (user_id, realm_id) VALUES ($user_id, $realm_id)");
				}
			}
		}
	}
}
i tested the result from the initial select ($exists) and i do get a result for the set of conditions that would create those inserts. not really a huge problem, but advising you anyway.

I have no errors in httpd/error_log
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Errors from PIA when adding items to graph tree

Post by TheWitness »

This seems to be tied to a MySQL release. We have many users who don't have issues with this. If you can take the user and account you have in mysql and execute the following, let us know if it corrects the problem. If not, please open a ticket with Oracle and keep us posed as to what is going on.

Code: Select all

GRANT ALL ON cacti.* to '<youruser>'@'localhost' IDENTIFIED BY '<yourpassword>';
flush privileges;
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?
nsnidanko
Posts: 7
Joined: Wed Oct 19, 2011 12:19 pm

Re: Errors from PIA when adding items to graph tree

Post by nsnidanko »

I would like to confirm this error as well:

Server version: 5.1.41-3ubuntu12.10 (Ubuntu)

Code: Select all

CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'1100', SQL:"SELECT 1 AS id, ph.name, ph.file, ph.function FROM plugin_hooks AS ph LEFT JOIN plugin_config AS pc ON pc.directory=ph.name WHERE ph.status = 1 AND hook = 'config_arrays' AND ph.name IN ('settings', 'boost', 'dsstats') UNION SELECT pc.id, ph.name, ph.file, ph.function FROM plugin_hooks AS ph LEFT JOIN plugin_config AS pc ON pc.directory=ph.name WHERE ph.status = 1 AND hook = 'config_arrays' AND ph.name NOT IN ('settings', 'boost', 'dsstats') ORDER BY id ASC"
but when i execute this query manually in console everything looks ok:

+------+----------+-----------------------+----------------------+
| id | name | file | function |
+------+----------+-----------------------+----------------------+
| NULL | internal | | plugin_config_arrays |
| 3 | thold | includes/settings.php | thold_config_arrays |
+------+----------+-----------------------+----------------------+
2 rows in set (0.00 sec)
djnono17
Posts: 21
Joined: Tue Aug 18, 2009 1:44 am

Re: Errors from PIA when adding items to graph tree

Post by djnono17 »

Okay, gave full privileges to cactiuser and even set cacti with the root account to test, and I still got the error.
I have mysql server installed in local and the server/client mysql libraries are from the same version.

I went over the script twice, and I don't see anything wrong with it, I executed the repair script (just in case), and I still have the error.

I have to install a couple of new servers next week, and I'll see if the error reappears or not.
maybe try a couple of different mysql versions

will keep you in the loop

PS : the server I have the problem with is a fresh install of CentOS 6 (installed about 2 weeks ago), and is a brand new dell poweredge R410

Linux Izia 2.6.32-71.29.1.el6.x86_64 #1 SMP Mon Jun 27 19:49:27 BST 2011 x86_64 x86_64 x86_64 GNU/Linux
nsnidanko
Posts: 7
Joined: Wed Oct 19, 2011 12:19 pm

Re: Errors from PIA when adding items to graph tree

Post by nsnidanko »

Ok I just tested this with latest MySQL (64 bit):

Code: Select all

Your MySQL connection id is 12
Server version: 5.5.18-log MySQL Community Server (GPL) and
and i still get the same error
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Errors from PIA when adding items to graph tree

Post by TheWitness »

Ok, I'm able to reproduce now. I have to see how to work around this. Need to find the source first...
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?
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Errors from PIA when adding items to graph tree

Post by TheWitness »

Ok, as a test, do the following:

Edit the file lib/functions.php and comment out ~ line 251:

Code: Select all

include($config["include_path"] . "/global_arrays.php");
See if the problem is reproducible at that point.

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?
nsnidanko
Posts: 7
Joined: Wed Oct 19, 2011 12:19 pm

Re: Errors from PIA when adding items to graph tree

Post by nsnidanko »

TheWitness wrote:Ok, as a test, do the following:

Edit the file lib/functions.php and comment out ~ line 251:

Code: Select all

include($config["include_path"] . "/global_arrays.php");
See if the problem is reproducible at that point.

TheWitness
Tested with host, graph and header : no error after removal of this line
djnono17
Posts: 21
Joined: Tue Aug 18, 2009 1:44 am

Re: Errors from PIA when adding items to graph tree

Post by djnono17 »

yep, solves the problem on my side too
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests