Update to 0.8.8 is not working

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

Moderators: Developers, Moderators

telenet
Posts: 2
Joined: Wed Apr 04, 2012 8:40 am

Update to 0.8.8 is not working

Post by telenet »

Hi everyone,

We're using Cacti for monitoring our networks, and we recently wanted to update to the 0.8.8 version.

I've made all the steps required (on the manual) and the last time (update to 0.8.7i) it worked.

But now, when I enter in my browser http://<IP>/cacti

I have the redirection to ==> <IP>/install that appears, and firefox send me a "broken link" error message.

Any ideas ?

(PS : sorry for english mistakes, I'm french :D )
skyjou
Posts: 6
Joined: Mon Oct 24, 2011 12:07 am

Re: Update to 0.8.8 is not working

Post by skyjou »

maybe you can try to edit:

Code: Select all

include/config.php
and unmark this line:

Code: Select all

$url_path = "/cacti/";
telenet
Posts: 2
Joined: Wed Apr 04, 2012 8:40 am

Re: Update to 0.8.8 is not working

Post by telenet »

It worked, thanks :)

However, during the update of the database, I've benn warned about one query that didn't worked (something with "poller" ??)

Should I be worried ?
stormonts
Cacti User
Posts: 349
Joined: Tue Mar 31, 2009 10:05 am

Re: Update to 0.8.8 is not working

Post by stormonts »

I got that same error about the poller. Actually error is:

Code: Select all

[Fail] ALTER TABLE `poller_output` ADD PRIMARY KEY (`local_data_id`, `rrd_name`, `time`) USING BTREE
Would sure like to know if that is benign or not.
MikeMcr
Posts: 17
Joined: Mon Jan 04, 2010 12:44 pm

Re: Update to 0.8.8 is not working

Post by MikeMcr »

Code: Select all

[Fail] ALTER TABLE `poller_output` ADD PRIMARY KEY (`local_data_id`, `rrd_name`, `time`) USING BTREE
Same error here on upgrade. I tried running the above SQL manually but it still failed. Is it important for this to work?
chadd
Cacti User
Posts: 382
Joined: Thu Mar 24, 2005 3:53 pm
Location: Ocoee, Florida

Re: Update to 0.8.8 is not working

Post by chadd »

I would say that you can just comment out that line of code. Here is why:

First, not sure why they added "USING BTREE" to the command, as that is the default anyway.

mysql> SHOW INDEX FROM cacti.host\G
*************************** 1. row ***************************
Table: host
Non_unique: 0
Key_name: PRIMARY
Seq_in_index: 1
Column_name: id
Collation: A
Cardinality: 1
Sub_part: NULL
Packed: NULL
Null:
Index_type: BTREE
Comment:
*************************** 2. row ***************************
Table: host
Non_unique: 1
Key_name: disabled
Seq_in_index: 1
Column_name: disabled
Collation: A
Cardinality: 1
Sub_part: NULL
Packed: NULL
Null: YES
Index_type: BTREE
Comment:
2 rows in set (0.00 sec)


Second, if you issue the command at the mysql> prompt you get a better error message:
mysql> ALTER TABLE `poller_output` ADD PRIMARY KEY (`local_data_id`, `rrd_name`, `time`) USING BTREE;
ERROR 1068 (42000): Multiple primary key defined

Third, as you can see, those columns are already primary keys, so you wouldn't be changing anything anyway:
mysql> describe poller_output;
+---------------+-----------------------+------+-----+---------------------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------------+-----------------------+------+-----+---------------------+-------+
| local_data_id | mediumint(8) unsigned | NO | PRI | 0 | |
| rrd_name | varchar(19) | NO | PRI | | |
| time | datetime | NO | PRI | 0000-00-00 00:00:00 | |
| output | text | NO | | NULL | |
+---------------+-----------------------+------+-----+---------------------+-------+
4 rows in set (0.00 sec)

mysql>

Lastly, you would have to drop and add the primary keys; you can not alter them. The correct command syntax would be as follows:

ALTER TABLE `poller_output`
DROP PRIMARY KEY,
ADD PRIMARY KEY (`local_data_id`, `rrd_name`, `time`);

As you can see, that works:

mysql> ALTER TABLE `poller_output`
-> DROP PRIMARY KEY,
-> ADD PRIMARY KEY (`local_data_id`, `rrd_name`, `time`);
Query OK, 0 rows affected (0.06 sec)
Records: 0 Duplicates: 0 Warnings: 0

mysql>

Hope this helps.

-chadd.
MikeMcr
Posts: 17
Joined: Mon Jan 04, 2010 12:44 pm

Re: Update to 0.8.8 is not working

Post by MikeMcr »

Hi chadd

Thank you for the helpful reply.
Second, if you issue the command at the mysql> prompt you get a better error message:
mysql> ALTER TABLE `poller_output` ADD PRIMARY KEY (`local_data_id`, `rrd_name`, `time`) USING BTREE;
ERROR 1068 (42000): Multiple primary key defined
Actually, I get a syntax error. Since you indicated that "USING BTREE" was the default, I thought I would try without that suffix and the command now works.

Code: Select all

ALTER TABLE `poller_output` ADD PRIMARY KEY (`local_data_id`, `rrd_name`, `time`);
Before:

Code: Select all

describe poller_output;
+---------------+-----------------------+------+-----+---------------------+-------+
| Field         | Type                  | Null | Key | Default             | Extra |
+---------------+-----------------------+------+-----+---------------------+-------+
| local_data_id | mediumint(8) unsigned | NO   |     | 0                   |       | 
| rrd_name      | varchar(19)           | NO   |     |                     |       | 
| time          | datetime              | NO   |     | 0000-00-00 00:00:00 |       | 
| output        | text                  | NO   |     |                     |       | 
+---------------+-----------------------+------+-----+---------------------+-------+
4 rows in set (0.00 sec)
After:

Code: Select all

describe poller_output;
+---------------+-----------------------+------+-----+---------------------+-------+
| Field         | Type                  | Null | Key | Default             | Extra |
+---------------+-----------------------+------+-----+---------------------+-------+
| local_data_id | mediumint(8) unsigned | NO   | PRI | 0                   |       | 
| rrd_name      | varchar(19)           | NO   | PRI |                     |       | 
| time          | datetime              | NO   | PRI | 0000-00-00 00:00:00 |       | 
| output        | text                  | NO   |     |                     |       | 
+---------------+-----------------------+------+-----+---------------------+-------+
4 rows in set (0.00 sec)
Hopefully this is now all OK. Thanks again.
chadd
Cacti User
Posts: 382
Joined: Thu Mar 24, 2005 3:53 pm
Location: Ocoee, Florida

Re: Update to 0.8.8 is not working

Post by chadd »

MikeMcr wrote:Hi chadd

Thank you for the helpful reply.
Second, if you issue the command at the mysql> prompt you get a better error message:
mysql> ALTER TABLE `poller_output` ADD PRIMARY KEY (`local_data_id`, `rrd_name`, `time`) USING BTREE;
ERROR 1068 (42000): Multiple primary key defined
Actually, I get a syntax error. Since you indicated that "USING BTREE" was the default, I thought I would try without that suffix and the command now works.

Code: Select all

ALTER TABLE `poller_output` ADD PRIMARY KEY (`local_data_id`, `rrd_name`, `time`);
Before:

Code: Select all

describe poller_output;
+---------------+-----------------------+------+-----+---------------------+-------+
| Field         | Type                  | Null | Key | Default             | Extra |
+---------------+-----------------------+------+-----+---------------------+-------+
| local_data_id | mediumint(8) unsigned | NO   |     | 0                   |       | 
| rrd_name      | varchar(19)           | NO   |     |                     |       | 
| time          | datetime              | NO   |     | 0000-00-00 00:00:00 |       | 
| output        | text                  | NO   |     |                     |       | 
+---------------+-----------------------+------+-----+---------------------+-------+
4 rows in set (0.00 sec)
After:

Code: Select all

describe poller_output;
+---------------+-----------------------+------+-----+---------------------+-------+
| Field         | Type                  | Null | Key | Default             | Extra |
+---------------+-----------------------+------+-----+---------------------+-------+
| local_data_id | mediumint(8) unsigned | NO   | PRI | 0                   |       | 
| rrd_name      | varchar(19)           | NO   | PRI |                     |       | 
| time          | datetime              | NO   | PRI | 0000-00-00 00:00:00 |       | 
| output        | text                  | NO   |     |                     |       | 
+---------------+-----------------------+------+-----+---------------------+-------+
4 rows in set (0.00 sec)
Hopefully this is now all OK. Thanks again.
No problem. You should be fine.
If you want to confirm you are using BTREE data structure, just do this:

SHOW INDEX FROM cacti.poller_output\G

Also, I'd be curious to know what version of MySQL you are running, and on what OS? And, was this a new install, or an upgrade?

-chadd.
MikeMcr
Posts: 17
Joined: Mon Jan 04, 2010 12:44 pm

Re: Update to 0.8.8 is not working

Post by MikeMcr »

chadd wrote:No problem. You should be fine.
If you want to confirm you are using BTREE data structure, just do this:

SHOW INDEX FROM cacti.poller_output\G

Also, I'd be curious to know what version of MySQL you are running, and on what OS? And, was this a new install, or an upgrade?

-chadd.
Yes, SHOW INDEX indicates BTREE is already being used. Strange that it doesn't like the "USING BTREE" command. It was an upgrade. I am running this on a ReadyNAS Pro (Linux) and the MySQL version is:

Code: Select all

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 328
Server version: 5.0.32-Debian_7etch5 Debian etch distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> STATUS
--------------
mysql  Ver 14.12 Distrib 5.0.32, for pc-linux-gnu (i486) using readline 5.2
chadd
Cacti User
Posts: 382
Joined: Thu Mar 24, 2005 3:53 pm
Location: Ocoee, Florida

Re: Update to 0.8.8 is not working

Post by chadd »

MikeMcr wrote:
chadd wrote:No problem. You should be fine.
If you want to confirm you are using BTREE data structure, just do this:

SHOW INDEX FROM cacti.poller_output\G

Also, I'd be curious to know what version of MySQL you are running, and on what OS? And, was this a new install, or an upgrade?

-chadd.
Yes, SHOW INDEX indicates BTREE is already being used. Strange that it doesn't like the "USING BTREE" command. It was an upgrade. I am running this on a ReadyNAS Pro (Linux) and the MySQL version is:

Code: Select all

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 328
Server version: 5.0.32-Debian_7etch5 Debian etch distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> STATUS
--------------
mysql  Ver 14.12 Distrib 5.0.32, for pc-linux-gnu (i486) using readline 5.2

Weird.. I am running 5.1.54-1 on my dev machine, and it wouldn't take the command minus the "use btree".. Wonder why?? Oh, well. If it works for you, then good.

-chadd.
MikeMcr
Posts: 17
Joined: Mon Jan 04, 2010 12:44 pm

Re: Update to 0.8.8 is not working

Post by MikeMcr »

chadd wrote: Weird.. I am running 5.1.54-1 on my dev machine, and it wouldn't take the command minus the "use btree".. Wonder why?? Oh, well. If it works for you, then good.

-chadd.
It looks like that command is not supported in MySQL 5.0, see here:

http://prattski.com/2010/06/01/mysql-us ... ng-to-5-0/
chadd
Cacti User
Posts: 382
Joined: Thu Mar 24, 2005 3:53 pm
Location: Ocoee, Florida

Re: Update to 0.8.8 is not working

Post by chadd »

MikeMcr wrote:
chadd wrote: Weird.. I am running 5.1.54-1 on my dev machine, and it wouldn't take the command minus the "use btree".. Wonder why?? Oh, well. If it works for you, then good.

-chadd.
It looks like that command is not supported in MySQL 5.0, see here:

http://prattski.com/2010/06/01/mysql-us ... ng-to-5-0/

Makes sense.. Well, hopefully this thread gets picked up by the Cacti devs ;)

Cheers,

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

Re: Update to 0.8.8 is not working

Post by gandalf »

chadd wrote:First, not sure why they added "USING BTREE" to the command, as that is the default anyway.
Yes and no. We wanted to force that BTREE type of index
Second, if you issue the command at the mysql> prompt you get a better error message:
mysql> ALTER TABLE `poller_output` ADD PRIMARY KEY (`local_data_id`, `rrd_name`, `time`) USING BTREE;
ERROR 1068 (42000): Multiple primary key defined
This should not happen:

Code: Select all

    $_keys = array_rekey(db_fetch_assoc("SHOW KEYS FROM `poller_output`"), "Key_name", "Key_name");
    if (in_array("PRIMARY", $_keys)) {
        db_install_execute("0.8.8", "ALTER TABLE `poller_output` DROP PRIMARY KEY");
        cacti_log(__FUNCTION__ . " table poller_output: dropping old PRIMARY KEY", false, "UPGRADE");
    }
    /* now the KEY we want to create is definitively NOT present */
    db_install_execute("0.8.8", "ALTER TABLE `poller_output` ADD PRIMARY KEY (`local_data_id`, `rrd_name`, `time`) USING BTREE");
    cacti_log(__FUNCTION__ . " upgrade table poller_output", false, "UPGRADE");
Should delete a PRIMRAY KEY before creating a new one.

So I fear we've touched a MYSQL version that does not like BTREE type indexes.

Please: Post the mysql version used
R.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Update to 0.8.8 is not working

Post by gandalf »

MikeMcr wrote:
chadd wrote: Weird.. I am running 5.1.54-1 on my dev machine, and it wouldn't take the command minus the "use btree".. Wonder why?? Oh, well. If it works for you, then good.

-chadd.
It looks like that command is not supported in MySQL 5.0, see here:

http://prattski.com/2010/06/01/mysql-us ... ng-to-5-0/
Looking at http://dev.mysql.com/doc/refman/5.0/en/alter-table.html it SHOULD be supported in 5.0. This is, what I was looking at when coding this bit.
It was present even in earlier releases: http://dev.mysql.com/doc/refman/4.1/en/alter-table.html
But perhaps I missed sth.
R.
MikeMcr
Posts: 17
Joined: Mon Jan 04, 2010 12:44 pm

Re: Update to 0.8.8 is not working

Post by MikeMcr »

gandalf wrote:Looking at http://dev.mysql.com/doc/refman/5.0/en/alter-table.html it SHOULD be supported in 5.0. This is, what I was looking at when coding this bit.
It was present even in earlier releases: http://dev.mysql.com/doc/refman/4.1/en/alter-table.html
But perhaps I missed sth.
R.
Strange but it definately doesn't like that command in my version of 5.0.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest