Upgrading to 1.2.8 results in database upgrade errors

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

Moderators: Moderators, Developers

Post Reply
Author
Message
User avatar
gdsotirov
Posts: 28
Joined: Fri Sep 19, 2014 3:33 am
Location: Sofia, Bulgaraia
Contact:

Upgrading to 1.2.8 results in database upgrade errors

#1 Post by gdsotirov » Mon Dec 09, 2019 2:49 am

I just tried upgrading to 1.2.8 from 1.2.7 by directly checking out the new version from Git in the existing cacti folder. Everything else went OK as with previous upgrades. The database upgrade was delayed initially and I saw no errors, but when I clicked on Refresh button, I got this:

Code: Select all

ALTER TABLE host_snmp_cache DROP INDEX snmp_index, DROP INDEX field_value	[Fail]
ALTER TABLE host_snmp_cache MODIFY COLUMN snmp_index VARCHAR(255) NOT NULL default ""	[Success]
ALTER TABLE host_snmp_cache ADD INDEX snmp_index(snmp_index), ADD INDEX field_value(field_value)	[Fail]
ALTER TABLE data_local DROP INDEX snmp_index, ADD INDEX snmp_index(snmp_index)	[Success]
ALTER TABLE graph_local DROP INDEX snmp_index, ADD INDEX snmp_index(snmp_index)	[Success]
ALTER TABLE aggregate_graphs ADD COLUMN gprint_format CHAR(2) default "" AFTER gprint_prefix	[Success]
ALTER TABLE aggregate_graph_templates ADD COLUMN gprint_format CHAR(2) default "" AFTER gprint_prefix	[Success]
I tried creating the indexes again to fix the upgrade process, but it fails again and I do not understand why. Anyway else having this problem?

User avatar
gdsotirov
Posts: 28
Joined: Fri Sep 19, 2014 3:33 am
Location: Sofia, Bulgaraia
Contact:

Re: Upgrading to 1.2.8 results in database upgrade errors

#2 Post by gdsotirov » Mon Dec 09, 2019 3:22 am

I managed to upgrade the database by simply running the following:

Code: Select all

 php cli/upgrade_database.php
which printed:

Code: Select all

Upgrading from v1.2.7
Upgrading from v1.2.7 (DB 1.2.7) to v1.2.8
++
I then cleared cookies, reloaded page and the Cacti installation was already 1.2.8, but it makes me wonder what "Refresh" button actually does...

How do you deal with such problems (of failing database upgrades)?

User avatar
Osiris
Cacti Pro User
Posts: 889
Joined: Mon Jan 05, 2015 10:10 am

Re: Upgrading to 1.2.8 results in database upgrade errors

#3 Post by Osiris » Mon Dec 09, 2019 6:38 am

Your database is missing some mandatory settings. Set the version back to the previous version by updating the version table and then execute the upgrade from the GUI, and you will see the errors. There are some mandatory updates required and documented on the database page.

You may also have to reconvert some tables due to these setting changes.
Before history, there was a paradise, now dust.

User avatar
gdsotirov
Posts: 28
Joined: Fri Sep 19, 2014 3:33 am
Location: Sofia, Bulgaraia
Contact:

Re: Upgrading to 1.2.8 results in database upgrade errors

#4 Post by gdsotirov » Mon Dec 09, 2019 7:06 am

Osiris wrote:
Mon Dec 09, 2019 6:38 am
Your database is missing some mandatory settings. Set the version back to the previous version by updating the version table and then execute the upgrade from the GUI, and you will see the errors. There are some mandatory updates required and documented on the database page.
I'm really not sure what you mean... Isn't this handled by the upgrade process of Cacti? Nothing was noted before the database upgrade started and since I got there I believe there were no wrong PHP/MySQL settings. Furthermore, I have upgraded the same way to the past releases, but only this time I had problem with the database upgrade. I have already resolved the problem (see my previous comment). However, what bugs me is that it wasn't solvable from the updater interface and I had to resort to the command line.

User avatar
gdsotirov
Posts: 28
Joined: Fri Sep 19, 2014 3:33 am
Location: Sofia, Bulgaraia
Contact:

Re: Upgrading to 1.2.8 results in database upgrade errors

#5 Post by gdsotirov » Sun Dec 15, 2019 2:53 am

A similar issue was reported on GitHub (see https://github.com/Cacti/cacti/issues/3136).

Post Reply