failed to upgrade database from 0.4.3 to 0.4.9-3

Support questions about the Threshold plugin

Moderators: Developers, Moderators

Post Reply
mikecarel
Cacti User
Posts: 68
Joined: Thu Jun 03, 2010 10:00 pm

failed to upgrade database from 0.4.3 to 0.4.9-3

Post by mikecarel »

Hi,

During my upgrade I encountered error when upgrading my database:

11/15/2011 02:22:47 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1064', SQL:"ALTER TABLE thold_template REMOVE COLUMN bl_enabled'
11/15/2011 02:22:47 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1064', SQL:"ALTER TABLE thold_data REMOVE COLUMN bl_enabled'
11/15/2011 02:22:43 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1060', SQL:"ALTER TABLE thold_data ADD COLUMN bl_thold_valid INT UNSIGNED NOT NULL DEFAULT 0'


Currently I cannot save/edit template from thold plugins, I receiving "Error: Saving".


Thanks for any help.

Mike
User avatar
TheWitness
Developer
Posts: 17061
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: failed to upgrade database from 0.4.3 to 0.4.9-3

Post by TheWitness »

Hmm. Sounds like you db is from some thold fork. I suggest you review your table formats with the ones in includes/database.php and make correction manually.

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?
mikecarel
Cacti User
Posts: 68
Joined: Thu Jun 03, 2010 10:00 pm

Re: failed to upgrade database from 0.4.3 to 0.4.9-3

Post by mikecarel »

Thanks for the reply. I did manually modify the thold tables and re-run the upgrade script to see if there's still missing but it's all success and no other error occurs. But when I tried to save/edit the thold template it still won't saved. Still getting "Error: Save Failed".
mikecarel
Cacti User
Posts: 68
Joined: Thu Jun 03, 2010 10:00 pm

Re: failed to upgrade database from 0.4.3 to 0.4.9-3

Post by mikecarel »

Sorry for the last post. Template saving is now ok after comparing the thold tables posted in "Unable to receive alerts from Thold" topic. But after these my thold triggers seems to be not syncronized from the updated templates, I'm having a weird tholds triggers which is working from 0.4.3 thold version. The triggers are not syncronized/inconsistent with the saved template. Checking on thold_data table, it's not updating when changing or saving the template.

Please help me on this.


My New Thold table:

thold_data:

id int(11) No Primary NULL auto_increment
name varchar(150) Yes None NULL
rra_id int(11) No Indexed 0
data_id int(11) No Indexed 0
graph_id int(11) No Indexed 0
graph_template int(11) No Indexed 0
data_template int(11) No Indexed 0
thold_hi varchar(100) Yes None NULL
thold_low varchar(100) Yes None NULL
thold_fail_trigger int(10) unsigned Yes None NULL
thold_fail_count int(11) No None 0
time_hi varchar(100) Yes None NULL
time_low varchar(100) Yes None NULL
time_fail_trigger int(12) No None 1
time_fail_length int(12) No None 1
thold_alert int(1) No None 0
thold_enabled enum('on','off') No Indexed on
thold_type int(3) No None 0
bl_ref_time_range int(10) unsigned Yes None NULL
bl_pct_down varchar(100) Yes None NULL
bl_pct_up varchar(100) Yes None NULL
bl_fail_trigger int(10) unsigned Yes None NULL
bl_fail_count int(11) unsigned Yes None NULL
bl_alert int(2) No None 0
lastread varchar(100) Yes None NULL
oldvalue varchar(100) Yes None NULL
repeat_alert int(10) unsigned Yes None NULL
notify_default enum('on','off') Yes None NULL
notify_extra text Yes None NULL
host_id int(10) Yes Indexed NULL
syslog_priority int(2) No None 3
data_type int(12) No None 0
cdef int(11) No None 0
percent_ds varchar(64) No None
template int(11) No Indexed 0
template_enabled char(3) No Indexed
tcheck int(1) No Indexed 0
exempt char(3) No None off
restored_alert char(3) No None off
thold_warning_hi varchar(100) Yes None NULL
thold_warning_low varchar(100) Yes None NULL
thold_warning_fail_trigger int(10) unsigned Yes None NULL
thold_warning_fail_count int(11) No None 0
time_warning_hi varchar(100) Yes None NULL
time_warning_low varchar(100) Yes None NULL
time_warning_fail_trigger int(12) No None 1
time_warning_fail_length int(12) No None 1
lasttime timestamp No None 0000-00-00 00:00:00
notify_warning_extra varchar(512) Yes None NULL
notify_warning int(10) No None 0
notify_alert int(10) No None 0
bl_thold_valid int(10) unsigned No None 0

thold_template:

id int(11) No Primary NULL auto_increment
name varchar(100) No None
data_template_id int(10) No Indexed 0
data_template_name varchar(100) No None
data_source_id int(10) No Indexed 0
data_source_name varchar(100) No None
data_source_friendly varchar(100) No None
thold_hi varchar(100) Yes None NULL
thold_low varchar(100) Yes None NULL
thold_fail_trigger int(10) unsigned Yes None NULL
time_hi varchar(100) Yes None NULL
time_low varchar(100) Yes None NULL
time_fail_trigger int(12) No None 1
time_fail_length int(12) No None 1
thold_enabled enum('on','off') No None on
thold_type int(3) No None 0
bl_ref_time_range int(10) unsigned Yes None NULL
bl_pct_down varchar(100) Yes None NULL
bl_pct_up varchar(100) Yes None NULL
bl_fail_trigger int(10) unsigned Yes None NULL
bl_fail_count int(11) unsigned Yes None NULL
bl_alert int(2) No None 0
repeat_alert int(10) unsigned Yes None NULL
notify_default enum('on','off') Yes None NULL
notify_extra text Yes None NULL
data_type int(12) No None 0
cdef int(11) No None 0
percent_ds varchar(64) No None
exempt char(3) No None off
restored_alert char(3) No None off
hash varchar(32) Yes None NULL
thold_warning_hi varchar(100) Yes None NULL
thold_warning_low varchar(100) Yes None NULL
thold_warning_fail_trigger int(10) unsigned Yes None NULL
thold_warning_fail_count int(11) No None 0
time_warning_hi varchar(100) Yes None NULL
time_warning_low varchar(100) Yes None NULL
time_warning_fail_trigger int(12) No None 1
time_warning_fail_length int(12) No None 1
notify_warning_extra varchar(512) Yes None NULL
notify_warning int(10) No None 0
notify_alert int(10) No None 0
expression varchar(70) No None
Attachments
thold inconsistent alerts
thold inconsistent alerts
Slide3.JPG (88.21 KiB) Viewed 2359 times
graph edit threshold
graph edit threshold
Slide2.JPG (106.49 KiB) Viewed 2359 times
Template
Template
Slide1.JPG (103.26 KiB) Viewed 2359 times
User avatar
TheWitness
Developer
Posts: 17061
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: failed to upgrade database from 0.4.3 to 0.4.9-3

Post by TheWitness »

Looks like the Warning values are not propogating, is that what you are seeing?
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: 17061
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: failed to upgrade database from 0.4.3 to 0.4.9-3

Post by TheWitness »

It works just fine for me, your database is still missing some columns.
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?
mikecarel
Cacti User
Posts: 68
Joined: Thu Jun 03, 2010 10:00 pm

Re: failed to upgrade database from 0.4.3 to 0.4.9-3

Post by mikecarel »

I used to follow the table format posted in "http://forums.cacti.net/viewtopic.php?f ... 5&start=15" , can you please post what should be my expected tables for thold? I've already downloaded the latest thold in the svn. I just need to verify the correct thold database table before trying to upgrade it again. tnx
User avatar
TheWitness
Developer
Posts: 17061
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: failed to upgrade database from 0.4.3 to 0.4.9-3

Post by TheWitness »

Here you go
Attachments
cacti.tar.gz
(1.25 KiB) Downloaded 273 times
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?
mikecarel
Cacti User
Posts: 68
Joined: Thu Jun 03, 2010 10:00 pm

Re: failed to upgrade database from 0.4.3 to 0.4.9-3

Post by mikecarel »

Thank you so much. I will check and compare this to isolate what happens to my installation.
mikecarel
Cacti User
Posts: 68
Joined: Thu Jun 03, 2010 10:00 pm

Re: failed to upgrade database from 0.4.3 to 0.4.9-3

Post by mikecarel »

this issue now resolved, after comparing and adding the missing field in the tholds tables. Tnx
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests