[SOLVED] Errors upgrading from 0.8.6h

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

Moderators: Developers, Moderators

Post Reply
stompasaurus
Posts: 2
Joined: Thu Feb 14, 2008 1:42 pm

[SOLVED] Errors upgrading from 0.8.6h

Post by stompasaurus »

EDIT: Wow this was a fun one. Someone must have seriously botched an upgrade in the past, as the original server said it was 0.8.6h, but looking through the upgrade files in install/, it would appear that the version of the database was more like 0.8.6d. I went back and manually re-applied all of the schema changes from there, and made sure none of the following upgrades changed any of it.. hopefully I didn't miss anything and the next upgrade will go better. I would have some seriously harsh words for the previous maintainer of this Cacti installation if he still worked at the company (grr)

Anyway, sorry if you wasted your time looking in to this, thanks!

--------------------------------------------------

I recently inherited a Cacti installation and migrated it to a new server. Everything was working as expected after the move, poller was running properly, etc.

I upgraded to 0.8.7b, but when running through the upgrade process it failed running one of the ALTER TABLE commands (I don't remember which section it was exactly, I can run through this process again if necessary and give the full log)

So I tried to run the ALTER TABLE manually after the installation was complete.

mysql> ALTER TABLE `poller_item` ADD INDEX `rrd_next_step`(`rrd_next_step`);
ERROR 1072 (42000): Key column 'rrd_next_step' doesn't exist in table

And when I re-enabled my poller.php cron job, the logs were full of errors like this:

02/14/2008 10:35:01 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'1054', SQL:"SELECT * FROM poller_item WHERE (host_id >= 184 AND host_id <= 192 AND rrd_next_step <= 0) ORDER by host_id"
02/14/2008 10:35:01 AM - CMDPHP: Poller[0] ERROR: SQL Cell Failed!, Error:'1054', SQL:"SELECT count(*) FROM poller_item WHERE (action=2 AND host_id >= 184 AND host_id <= 192 AND rrd_next_step <= 0)"
02/14/2008 10:35:01 AM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1054', SQL:"UPDATE poller_item SET rrd_next_step = rrd_next_step - 300 WHERE (host_id >= 184 AND host_id <= 192)'
02/14/2008 10:35:01 AM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1054', SQL:"UPDATE poller_item SET rrd_next_step = rrd_step - 300 WHERE (rrd_next_step < 0 AND host_id >= 184 AND host_id <= 192)'

I tried reading through stickies and searching for errors similar to this but I couldn't find anything. Anyone have a clue as to what could have caused this? Could there have been something wrong with the previous Cacti installation and we just didn't notice?

Of course it would be preferable to me to be able to repair this somehow as opposed to starting over and running through the upgrade process again, as I have made a few changes since moving, but of course I am prepared to start over from scratch if that is what's necessary. Any advice would be welcome, thanks.

Oh, and if this helps:

mysql> describe poller_item;
+----------------------+-----------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------------------+-----------------------+------+-----+---------+-------+
| local_data_id | mediumint(8) unsigned | | PRI | 0 | |
| poller_id | smallint(5) unsigned | | | 0 | |
| host_id | mediumint(8) | | MUL | 0 | |
| action | tinyint(2) unsigned | | MUL | 1 | |
| hostname | varchar(250) | | | | |
| snmp_community | varchar(100) | | | | |
| snmp_version | tinyint(1) unsigned | | | 0 | |
| snmp_username | varchar(50) | | | | |
| snmp_password | varchar(50) | | | | |
| snmp_auth_protocol | varchar(5) | YES | | | |
| snmp_priv_passphrase | varchar(200) | YES | | | |
| snmp_priv_protocol | varchar(6) | YES | | | |
| snmp_context | varchar(64) | YES | | | |
| snmp_port | mediumint(5) unsigned | | | 161 | |
| snmp_timeout | mediumint(8) unsigned | | | 0 | |
| rrd_name | varchar(19) | | PRI | | |
| rrd_path | varchar(255) | | | | |
| rrd_num | tinyint(2) unsigned | | | 0 | |
| arg1 | text | YES | | NULL | |
| arg2 | varchar(255) | YES | | NULL | |
| arg3 | varchar(255) | YES | | NULL | |
+----------------------+-----------------------+------+-----+---------+-------+
21 rows in set (0.00 sec)

mysql> select * from version;
+--------+
| cacti |
+--------+
| 0.8.7b |
+--------+
1 row in set (0.00 sec)
User avatar
Linegod
Developer
Posts: 1626
Joined: Thu Feb 20, 2003 10:16 am
Location: Canada
Contact:

Post by Linegod »

As a note, instead of editing your first post (or in addition to), add a reply - that way it doesn't show up in 'Show posts without reply'.
--
Live fast, die young
You're sucking up my bandwidth.

J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca
stompasaurus
Posts: 2
Joined: Thu Feb 14, 2008 1:42 pm

Post by stompasaurus »

Linegod wrote:As a note, instead of editing your first post (or in addition to), add a reply - that way it doesn't show up in 'Show posts without reply'.
Will do next time, thanks. Seems every forum has its own protocol, some others I frequent prefer editing the original post :)
User avatar
Linegod
Developer
Posts: 1626
Joined: Thu Feb 20, 2003 10:16 am
Location: Canada
Contact:

Post by Linegod »

Although sometimes a pain, I prefer that you edit the original post '[SOLVED]', but add your comments as a new post. But that's me :)
--
Live fast, die young
You're sucking up my bandwidth.

J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

Linegod wrote:But that's me :)
You're not alone :)
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests