Debian 11.5 - upgrade Cacti to 1.2.16 failed

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

Moderators: Developers, Moderators

Post Reply
mario78
Posts: 2
Joined: Fri Sep 16, 2022 4:37 am

Debian 11.5 - upgrade Cacti to 1.2.16 failed

Post by mario78 »

Hi,

System: Debian 11.5
PHP 7.4.30

I have a problem with updating Cacti on Debian 11.5
I did two Debian distribution upgrades in a row - from 9 to 10 and to 11.
Now I want to upgrade Cacti, but process failed. Here is a cacti.log:

Code: Select all

2022-09-16 12:33:29 - INSTALL: always: Spawning background process: /usr/bin/php '/usr/share/cacti/site/install/background.php' 1663324409.5817
2022-09-16 12:33:29 - INSTALL: Checking arguments
2022-09-16 12:33:29 - INSTALL: always: Setting PHP Option max_execution_time = 0
2022-09-16 12:33:29 - INSTALL: always: Setting PHP Option memory_limit = -1
2022-09-16 12:33:30 - INSTALL: always: Starting UPGRADE Process for v1.2.16
2022-09-16 12:33:30 - INSTALL: always: Found 111 tables to convert
2022-09-16 12:33:30 - INSTALL: always: Converting Table #1 'weathermap_settings'
...
2022-09-16 12:33:36 - INSTALL: always: Converting Table #111 'automation_devices'
2022-09-16 12:33:36 - INSTALL: always: Switched from  to /tmp/cduInKE7h
2022-09-16 12:33:36 - INSTALL: always: NOTE: Using temporary file for db cache: /tmp/cduInKE7h
2022-09-16 12:33:36 - INSTALL: always: Upgrading from v1.0.4 (DB 1.2.16 (DB: 1.0.4)) to v1.0.5
2022-09-16 12:33:36 - CMDPHP ERROR: A DB Exec Failed!, Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE data_source_profile_id = 0' at line 1
2022-09-16 12:33:36 - CMDPHP SQL Backtrace:  (/install/background.php[54]:Installer::beginInstall(), /lib/installer.php[3386]:Installer->install(), /lib/installer.php[2891]:Installer->upgradeDatabase(), /lib/installer.php[3285]:upgrade_to_1_0_5(), /install/upgrades/1_0_5.php[35]:db_install_execute(), /install/functions.php[136]:db_execute_prepared())
2022-09-16 12:33:36 - INSTALL: always: Finished UPGRADE Process for v1.2.16
2022-09-16 12:33:36 - INSTALL: always: WARNING: One or more upgrades failed to install correctly
2022-09-16 12:33:36 - INSTALL: always: Installation was started at 2022-09-16 10:33:29, completed at 2022-09-16 10:33:36
All recommended settings during upgrade passed 'green'. Searched for solution with google, but didn't find anything.

Thanks for any suggestions!
mario78
Posts: 2
Joined: Fri Sep 16, 2022 4:37 am

Re: Debian 11.5 - upgrade Cacti to 1.2.16 failed

Post by mario78 »

Ok, I did some workaround to fix this:

in a file /usr/share/cacti/site/install/upgrades/1_0_5.php I hashed a line:

Code: Select all

#       db_install_execute('UPDATE data_template_data SET data_source_profile_id = ' . $profile_id . ' WHERE data_source_profile_id = 0');
and upgrade went fine to the end. Cacti started but didn't collect data - something was missing in data_source_profile, data_source_profiles_rra and data_source_profiles_cf in DB so I deleted everyhing and put there:

Code: Select all

INSERT INTO `data_source_profiles` VALUES (1,'d62c52891f4f9688729a5bc9fad91b18','5 Minute Collection',300,600,0.5,'on');
INSERT INTO `data_source_profiles` VALUES (2,'c0dd0e46b9ca268e7ed4162d329f9215','30 Second Collection',30,1200,0.5,'');
INSERT INTO `data_source_profiles` VALUES (3,'66d35da8f75c912ede3dbe901fedcae0','1 Minute Collection',60,600,0.5,'');
INSERT INTO `data_source_profiles_cf` VALUES (1,1);
INSERT INTO `data_source_profiles_cf` VALUES (1,2);
INSERT INTO `data_source_profiles_cf` VALUES (1,3);
INSERT INTO `data_source_profiles_cf` VALUES (1,4);
INSERT INTO `data_source_profiles_cf` VALUES (2,1);
INSERT INTO `data_source_profiles_cf` VALUES (2,2);
INSERT INTO `data_source_profiles_cf` VALUES (2,3);
INSERT INTO `data_source_profiles_cf` VALUES (2,4);
INSERT INTO `data_source_profiles_cf` VALUES (3,1);
INSERT INTO `data_source_profiles_cf` VALUES (3,2);
INSERT INTO `data_source_profiles_cf` VALUES (3,3);
INSERT INTO `data_source_profiles_cf` VALUES (3,4);
INSERT INTO `data_source_profiles_rra` VALUES (1,1,'Daily (5 Minute Average)',1,600,86400);
INSERT INTO `data_source_profiles_rra` VALUES (2,1,'Weekly (30 Minute Average)',6,700,604800);
INSERT INTO `data_source_profiles_rra` VALUES (3,1,'Monthly (2 Hour Average)',24,775,2618784);
INSERT INTO `data_source_profiles_rra` VALUES (4,1,'Yearly (1 Day Average)',288,797,31536000);
INSERT INTO `data_source_profiles_rra` VALUES (5,2,'Daily (30 Second Average)',1,2900,86400);
INSERT INTO `data_source_profiles_rra` VALUES (6,2,'Weekly (15 Minute Average)',30,1346,604800);
INSERT INTO `data_source_profiles_rra` VALUES (7,2,'Monthly (1 Hour Average)',120,1445,2618784);
INSERT INTO `data_source_profiles_rra` VALUES (8,2,'Yearly (4 Hour Average)',480,4380,31536000);
INSERT INTO `data_source_profiles_rra` VALUES (9,3,'Daily (1 Minute Average)',1,2900,86400);
INSERT INTO `data_source_profiles_rra` VALUES (10,3,'Weekly (15 Minute Average)',15,1440,604800);
INSERT INTO `data_source_profiles_rra` VALUES (11,3,'Monthly (1 Hour Average)',60,8784,2618784);
INSERT INTO `data_source_profiles_rra` VALUES (12,3,'Yearly (12 Hour Average)',720,7305,31536000);
and everyting started to work.
Maybe there is some better solution, but this worked for me.
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Debian 11.5 - upgrade Cacti to 1.2.16 failed

Post by TheWitness »

Glad you got it to work.
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?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest