Cacti 1.1.10 - 1.1.20 SQL query upgrade error

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

Moderators: Developers, Moderators

Post Reply
jround
Posts: 8
Joined: Thu Mar 16, 2017 6:20 am

Cacti 1.1.10 - 1.1.20 SQL query upgrade error

Post by jround »

During an upgrade from Cacti 1.1.10 to Cacti 1.1.20 everything goes OK apart from the below SQL query error :-

[Fail] 
ALTER TABLE snmpagent_cache_textual_conventions
MODIFY COLUMN name VARCHAR(50) NOT NULL,
MODIFY COLUMN mib VARCHAR(50) NOT NULL,
MODIFY COLUMN type VARCHAR(50) NOT NULL,
PRIMARY KEY (`name`,`mib`,`type`)

I have rolled the server back (VM snapshot) for now so no harm done but any ideas how to resolve?
Rno
Cacti Pro User
Posts: 680
Joined: Wed Dec 07, 2011 9:19 am

Re: Cacti 1.1.10 - 1.1.20 SQL query upgrade error

Post by Rno »

It's a known problem, the ADD is missing
the right command should be:

ALTER TABLE snmpagent_cache_textual_conventions
MODIFY COLUMN name VARCHAR(50) NOT NULL,
MODIFY COLUMN mib VARCHAR(50) NOT NULL,
MODIFY COLUMN type VARCHAR(50) NOT NULL,
ADD PRIMARY KEY (`name`,`mib`,`type`)
Test
Almalinux
php 8.2.14
mariadb 10.6.16
Cacti 1.2.27
Spine 1.2.27
RRD 1.7.2
thold 1.8
monitor 2.5
syslog 3.2
flowview: 3.3
weathermap 1.0 Beta
majedz
Posts: 39
Joined: Fri Aug 07, 2015 8:15 am

Re: Cacti 1.1.10 - 1.1.20 SQL query upgrade error

Post by majedz »

ok i executed the right command in the cacti database;
or should it be done in all the databases?
Seek and you shall find, knock and it shall be opened, cry and you will find comfort, thirst and you shall be watered.
Rno
Cacti Pro User
Posts: 680
Joined: Wed Dec 07, 2011 9:19 am

Re: Cacti 1.1.10 - 1.1.20 SQL query upgrade error

Post by Rno »

Just the cacti one
Test
Almalinux
php 8.2.14
mariadb 10.6.16
Cacti 1.2.27
Spine 1.2.27
RRD 1.7.2
thold 1.8
monitor 2.5
syslog 3.2
flowview: 3.3
weathermap 1.0 Beta
JJX
Cacti User
Posts: 402
Joined: Thu Oct 06, 2005 5:03 am

Re: Cacti 1.1.10 - 1.1.20 SQL query upgrade error

Post by JJX »

Same problem here (after testing 0.8.8h to 1.1.20)
Solved with:

MariaDB [cacti]> ALTER TABLE snmpagent_cache_textual_conventions
-> MODIFY COLUMN name VARCHAR(50) NOT NULL,
-> MODIFY COLUMN mib VARCHAR(50) NOT NULL,
-> MODIFY COLUMN type VARCHAR(50) NOT NULL,
-> ADD PRIMARY KEY (`name`,`mib`,`type`)
-> ;
Query OK, 2 rows affected (0.51 sec)
Records: 2 Duplicates: 0 Warnings: 0


Thank you
cacti rulez!
User avatar
Osiris
Cacti Guru User
Posts: 1424
Joined: Mon Jan 05, 2015 10:10 am

Re: Cacti 1.1.10 - 1.1.20 SQL query upgrade error

Post by Osiris »

Fixed in 1.1.21
Before history, there was a paradise, now dust.
Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests