Thold 0.4.1 -> 0.5.0 upgrade

Support questions about the Threshold plugin

Moderators: Developers, Moderators

Post Reply
skatter
Cacti User
Posts: 153
Joined: Fri Oct 22, 2004 2:55 am
Contact:

Thold 0.4.1 -> 0.5.0 upgrade

Post by skatter »

I am attempting to run extras/upgrade.php on an existing thold installation, upgrading from 0.4.1 -> 0.5.0, and it is taking what seems to be a really long time. I have 700+ thresholds configured, and the upgrade has been running for 30 minutes now.

Code: Select all

$ php extras/upgrade.php 
Faking Low Thold Version
Running Thold Upgrade

I'm not clear on whether or not anything is actually being done, although php is running @ 15%, so I assume something is happening. Is there a way to check the progress of this upgrade?
skatter
skatter
Cacti User
Posts: 153
Joined: Fri Oct 22, 2004 2:55 am
Contact:

Re: Thold 0.4.1 -> 0.5.0 upgrade

Post by skatter »

It's still going...

Any advice on checking the status of its progress would be helpful. I'm using a remote MySQL server, and I can see a lot SQL traffic being transmitted, so it appears to still be doing its thing.
skatter
skatter
Cacti User
Posts: 153
Joined: Fri Oct 22, 2004 2:55 am
Contact:

Re: Thold 0.4.1 -> 0.5.0 upgrade

Post by skatter »

This upgrade is still running, nearly 24 hours later...
skatter
skatter
Cacti User
Posts: 153
Joined: Fri Oct 22, 2004 2:55 am
Contact:

Re: Thold 0.4.1 -> 0.5.0 upgrade

Post by skatter »

This never resolved itself, so I just cancelled it and uninstalled/reinstalled thold (losing all existing thresholds). I suspect I ran into a bug, but was unable to identify the cause.
skatter
mitchese
Posts: 8
Joined: Fri Jan 25, 2013 4:52 am

Re: Thold 0.4.1 -> 0.5.0 upgrade

Post by mitchese »

I had exactly the same issue when doing the upgrade, also from 0.4.1 to 0.5.

I have successfully upgraded it without losing our thresholds. I observed with "show processlist" that there was an update command that was repeatedly being executed, as if it were stuck in an infinite loop. The command was:

Code: Select all

ALTER TABLE thold_data ADD COLUMN bl_thold_valid INT UNSIGNED NOT NULL DEFAULT 0
I tried running this command, and it returned an error that this column already existed - it seems the error handling in the ugprade script was not able to understand this error, and it was stuck trying to execute this command over and over. I believe this column was already there from a previous upgrade attempt, so after verifying it was "0" in all thresholds, I simply deleted the column:

Code: Select all

alter table thold_data drop bl_thold_valid;
This got me further, where it got stuck trying to delete a column from two tables:

Code: Select all

ALTER TABLE thold_data REMOVE COLUMN bl_enabled;
ALTER TABLE thold_template REMOVE COLUMN bl_enabled;
When manually running this I got a syntax error, so I manually deleted this:

Code: Select all

 alter table thold_data drop bl_enabled;
alter table thold_template drop bl_enabled;
After doing these three modifications, the update completes in under 1 minute. After the update a few columns were missing, and I added them with:

Code: Select all

ALTER TABLE thold_data ADD COLUMN expression varchar(70) NOT NULL DEFAULT '';
ALTER TABLE thold_template ADD COLUMN expression varchar(70) NOT NULL DEFAULT '';
and I can confirm thresholds are working as they were before. I suspect some of these problems are as a result of our database being unclean from a legacy of changes, however I also think a few things might be missing from the database upgrade script (example, I cannot find the expression column anywhere other than the install new section)

Hope this helps someone!
skatter
Cacti User
Posts: 153
Joined: Fri Oct 22, 2004 2:55 am
Contact:

Re: Thold 0.4.1 -> 0.5.0 upgrade

Post by skatter »

Bummer that I didn't see this sooner, I ended up blowing everything away. Perhaps the update script can get patched with your feedback...
skatter
Velnias
Posts: 11
Joined: Wed Nov 03, 2010 4:50 am

Re: Thold 0.4.1 -> 0.5.0 upgrade

Post by Velnias »

I might add to it, that when you execute

Code: Select all

alter table thold_data drop bl_enabled;
alter table thold_template drop bl_enabled;
then you should go to
/plugins/thold/includes/database.php

and comment out lines:

Code: Select all

db_execute("ALTER TABLE thold_data REMOVE COLUMN bl_enabled", FALSE);
db_execute("ALTER TABLE thold_template REMOVE COLUMN bl_enabled", FALSE);
So it does not try delete non existent colums
and relaunch upgrade.

You will still need to redo this:

Code: Select all

alter table thold_data drop bl_thold_valid;
but then it will upgrade successfully.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest