Problems upgrading from 0.8.8h to 1.1.38

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
AndyLDEX
Posts: 12
Joined: Wed Oct 31, 2012 12:38 pm

Problems upgrading from 0.8.8h to 1.1.38

Post by AndyLDEX »

Hi all,

I wonder if anyone has any clues what's going wrong with my upgrade. I've taken an existing Cacti system, and moved it to a newer OS (FreeBSD 11.2) and upgraded from 0.8.8h to 1.1.38.

During the DB update I get these problems:

Code: Select all

root@localhost [cacti]> UPDATE external_links SET enabled="on" WHERE disabled="";
ERROR 1054 (42S22): Unknown column 'disabled' in 'where clause'
root@localhost [cacti]> UPDATE external_links SET enabled="" WHERE disabled="on";
ERROR 1054 (42S22): Unknown column 'disabled' in 'where clause'
root@localhost [cacti]> desc external_links;
+---------------+--------------+------+-----+---------+----------------+
| Field         | Type         | Null | Key | Default | Extra          |
+---------------+--------------+------+-----+---------+----------------+
| id            | int(11)      | NO   | PRI | NULL    | auto_increment |
| sortorder     | int(11)      | NO   |     | 0       |                |
| enabled       | char(2)      | YES  |     | on      |                |
| contentfile   | varchar(255) | NO   |     |         |                |
| title         | varchar(20)  | NO   |     |         |                |
| style         | varchar(10)  | NO   |     |         |                |
| extendedstyle | varchar(50)  | NO   |     |         |                |
+---------------+--------------+------+-----+---------+----------------+
7 rows in set (0.00 sec)

root@localhost [cacti]> ALTER TABLE poller_reindex DROP PRIMARY KEY, ADD PRIMARY KEY (host_id, data_query_id);
ERROR 1062 (23000): Duplicate entry '19-13' for key 'PRIMARY'
Can I delete those tables and recreate from scratch without loosing anything important?

And ignoring those errors, once updated and logged in I have some issues from the web interface. For example, when changing the RRD version in settings when I clock save I get an error 500 and in the Apache log I see:

Code: Select all

PHP Fatal error:  Call to a member function qstr() on null in /usr/local/www/cacti/settings.php on line 66, referer: https://cacti.test.server/settings.php
I've tried both PHP 5.6 and 7.2 and both give the same error,

thanks in advance! Andy.
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Problems upgrading from 0.8.8h to 1.1.38

Post by netniV »

You appear to be updating those tables manually. If you are currently testing an upgrade, could I suggest you get the latest version of Cacti from the develop branch on GitHub? We have done a lot more work around ensuring an upgrade from 0.8.8h to 1.2 works better. The last problem with qstr() is strange as that doesn't even exist in the 1.2 settings.php code
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
AndyLDEX
Posts: 12
Joined: Wed Oct 31, 2012 12:38 pm

Re: Problems upgrading from 0.8.8h to 1.1.38

Post by AndyLDEX »

Ok thanks for the reply. I was only running the queries that failed during the upgrade by hand to see what error MySQL was throwing up. I'm trying now with the dev 1.2 version, still seeing the same MySQL upgrade errors:

Code: Select all

UPDATE external_links SET enabled="on" WHERE disabled=""	[Fail]
UPDATE external_links SET enabled="" WHERE disabled="on"	[Fail]
ALTER TABLE `poller_reindex` ADD PRIMARY KEY(host_id,data_query_id)	[Fail]
ALTER TABLE `poller_reindex` ADD PRIMARY KEY(host_id,data_query_id)	[Fail]
WRT to the PHP error, this has gone away now, so guess I messed something up previously,

thanks, Andy.

PS I've just seen that Weathermap still doesn't work on 1.x so for now I cannot migrate to 1.2. Happy to rerun the upgrade on a test system if there is interest in solving the upgrade errors.
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Problems upgrading from 0.8.8h to 1.1.38

Post by netniV »

What upgrade section did the above fails appear in?
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
AndyLDEX
Posts: 12
Joined: Wed Oct 31, 2012 12:38 pm

Re: Problems upgrading from 0.8.8h to 1.1.38

Post by AndyLDEX »

Hi,

1.0.0:

UPDATE external_links SET enabled="on" WHERE disabled="" [Fail]
UPDATE external_links SET enabled="" WHERE disabled="on" [Fail]

1.0.5:

ALTER TABLE `poller_reindex` ADD PRIMARY KEY(host_id,data_query_id) [Fail]
ALTER TABLE `poller_reindex` ADD PRIMARY KEY(host_id,data_query_id) [Fail]

I tested this on the DB of another 0.8.8h system we have and it completed without errors, so for whatever reason the two systems are different,

thanks, Andy.
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Problems upgrading from 0.8.8h to 1.1.38

Post by netniV »

Can you run "SHOW CREATE TABLE <table>\G" for both of those tables against the DB that failed?
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
AndyLDEX
Posts: 12
Joined: Wed Oct 31, 2012 12:38 pm

Re: Problems upgrading from 0.8.8h to 1.1.38

Post by AndyLDEX »

Sure:

Code: Select all

| external_links | CREATE TABLE `external_links` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `sortorder` int(11) NOT NULL DEFAULT '0',
  `enabled` char(2) COLLATE utf8mb4_unicode_ci DEFAULT 'on',
  `contentfile` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `title` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `style` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `extendedstyle` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `refresh` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Stores External Link Information' 

| poller_reindex | CREATE TABLE `poller_reindex` (
  `host_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `data_query_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `action` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `present` tinyint(4) NOT NULL DEFAULT '1',
  `op` char(1) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `assert_value` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `arg1` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`host_id`,`data_query_id`,`arg1`),
  KEY `present` (`present`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci 
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Problems upgrading from 0.8.8h to 1.1.38

Post by netniV »

OK, there's a difference there ... can you post that as a new issue on the GitHub repo for the upgrade problem and include your create tables part for reference.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
AndyLDEX
Posts: 12
Joined: Wed Oct 31, 2012 12:38 pm

Re: Problems upgrading from 0.8.8h to 1.1.38

Post by AndyLDEX »

yep, done!
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Problems upgrading from 0.8.8h to 1.1.38

Post by netniV »

Thanks, we've worked out roughly what we are going to do for these two issues but any further updates will be on the issue trackers.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest