Database update problem when upgrading from 0.8.7g to 0.8.7i

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

Moderators: Developers, Moderators

Post Reply
uno
Posts: 32
Joined: Mon Aug 27, 2007 7:22 am

Database update problem when upgrading from 0.8.7g to 0.8.7i

Post by uno »

Hi.

I tried to upgrade from 0.8.7g to 0.8.7i. I followed the upgrade guide in the documentation, but when running the database upgrade in the browser I got an error:

Code: Select all

Upgrade results:

WARNING: One or more of the SQL queries needed to upgraded your Cacti installation has failed. Please see below for more details. Your Cacti MySQL user must have SELECT, INSERT, UPDATE, DELETE, ALTER, CREATE, and DROP permissions. You should try executing the failed queries as 'root' to ensure that you do not have a permissions problem.

0.8.7g -> 0.8.7h

[Success] ALTER TABLE host_snmp_cache ADD COLUMN present tinyint NOT NULL DEFAULT '1' AFTER `oid`

[Success] ALTER TABLE host_snmp_cache ADD INDEX present (present)

[Success] ALTER TABLE poller_item ADD COLUMN present tinyint NOT NULL DEFAULT '1' AFTER `action`

[Success] ALTER TABLE poller_item ADD INDEX present (present)

[Success] ALTER TABLE poller_reindex ADD COLUMN present tinyint NOT NULL DEFAULT '1' AFTER `action`

[Success] ALTER TABLE poller_reindex ADD INDEX present (present)

[Success] ALTER TABLE host ADD COLUMN device_threads tinyint(2) unsigned NOT NULL DEFAULT '1' AFTER max_oids;

[Fail] ALTER TABLE `data_template_rrd` ADD UNIQUE INDEX `duplicate_dsname_contraint` (`local_data_id`, `data_source_name`, `data_template_id`)
I tried the query in mysql as root and got this:

Code: Select all

mysql> ALTER TABLE `data_template_rrd` ADD UNIQUE INDEX `duplicate_dsname_contraint` (`local_data_id`, `data_source_name`, `data_template_id`)                                                                  ;
ERROR 1062 (23000): Duplicate entry '0-Total-268' for key 'duplicate_dsname_contraint'
It seems like I have three entries with the same `local_data_id`, `data_source_name`, `data_template_id` in the database:

Code: Select all

SELECT * FROM `data_template_rrd` WHERE local_data_id =0 AND data_source_name = 'total' AND data_template_id =268;
+------+----------------------------------+----------------------------+---------------+------------------+---------------+-------------+---------------+-------------+-----------------+---------------+-----------------------+---------------------+--------------------+------------------+-----------------------+---------------------+
| id   | hash                             | local_data_template_rrd_id | local_data_id | data_template_id | t_rrd_maximum | rrd_maximum | t_rrd_minimum | rrd_minimum | t_rrd_heartbeat | rrd_heartbeat | t_data_source_type_id | data_source_type_id | t_data_source_name | data_source_name | t_data_input_field_id | data_input_field_id |
+------+----------------------------------+----------------------------+---------------+------------------+---------------+-------------+---------------+-------------+-----------------+---------------+-----------------------+---------------------+--------------------+------------------+-----------------------+---------------------+
| 7127 | c1143b69a182e12cb36d6cbf471449b3 |                          0 |             0 |              268 | NULL          | 100         | NULL          | 0           | NULL            |           600 | NULL                  |                   1 | NULL               | Total            | NULL                  |                   0 |
| 7183 | 389ac27bafed3bdc7430274f3968250d |                          0 |             0 |              268 | NULL          | 100         | NULL          | 0           | NULL            |           600 | NULL                  |                   1 | NULL               | Total            | NULL                  |                 686 |
| 7190 | 97ba3fdfa64c57cf888bf62195637062 |                          0 |             0 |              268 | NULL          | 100         | NULL          | 0           | NULL            |           600 | NULL                  |                   1 | NULL               | Total            | NULL                  |                   0 |
+------+----------------------------------+----------------------------+---------------+------------------+---------------+-------------+---------------+-------------+-----------------+---------------+-----------------------+---------------------+--------------------+------------------+-----------------------+---------------------+
What can I do to fix this? Should the duplicate entries be deleted?

Edit:
Checked the data template with ID 268, and there are three "tabs" named "Total". I guess there was something wrong with this template.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Database update problem when upgrading from 0.8.7g to 0.

Post by gandalf »

Yep, that seems to be the case. But it sounds like a custom template. In each case, three equal ds names do not make sense at all.
R.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests