Skip to main content

Hi,

I have the following error when I try to upgrade centreon 20.10 to 22.10.

Here the following error:

 

I already inserted the following request on centreon database:

ALTER TABLE centreon.cfg_nagios ROW_FORMAT=DYNAMIC;
 ALTER TABLE centreon.contact ROW_FORMAT=DYNAMIC;

I try to drop manually the column but the error is stil here. I try to change to the SQL request 

/usr/share/centreon/www/install/php/Update-20.10.12.php because the synthax seemed incorrect

$pearDB->query("ALTER TABLE `contact` DROP IF EXISTS COLUMN `contact_platform_data_sending`");

Below the upgrade.log content:

UPGRADE - 20.10.12: Impossible to drop column 'contact_platform_data_sending' from 'contact' table - Code : 42000 - Error : SQLSTATEQ42000]: Syntax error or access violation: 1064 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 'COLUMN contact_platform_data_sending' at line 1 - Trace : #0 /usr/share/centreon/www/class/centreonDB.class.php(309): PDO->query()
#1 /usr/share/centreon/www/install/php/Update-20.10.12.php(55): CentreonDB->query()
#2 /usr/share/centreon/src/Core/Platform/Infrastructure/Repository/DbWriteUpdateRepository.php(144): include_once('...')
#3 /usr/share/centreon/src/Core/Platform/Infrastructure/Repository/DbWriteUpdateRepository.php(61): Core\Platform\Infrastructure\Repository\DbWriteUpdateRepository->runScript()
#4 /usr/share/centreon/www/install/step_upgrade/process/process_step4.php(46): Core\Platform\Infrastructure\Repository\DbWriteUpdateRepository->runUpdate()

 

Can you help me to resolve this error please?

Best regards!

Hi @Crazy99, it’s strange because changing the row_format to dynamic for the centreon.contact table is theorically the good solution in order to avoid this error.

The error occured again after a refresh and just changing the row format, or after you delete the column, or both ?

 

Currently it failed because your syntax is not ok, you should try “DROP COLUMN IF EXISTS” :

 

 


Hi,

Thank you for your reply, I already tried to execute this request manually but the message was still here.

I managed to install the update by commenting thhis line in the upgrade script :

usr/share/centreon/www/install/php/Update-20.10.12.php 

//$pearDB->query("ALTER TABLE `contact` DROP IF EXISTS COLUMN `contact_platform_data_sending`");

I dont’t know if it’s the good method but I managed to upgrade to the 22.10 version!

It's really strange that Centreon scripts have a SQL syntax error in their upgrade process. I had already carried out other upgrades of other Centreons of this version and I had never encountered this error...

 

Happy New Year!

 


Hi @Crazy99, happy new year too !

20.10 version has now almost 4 years, so I think the good syntax can depend of the MariaDB/MySQL version as I don’t encounter this problem.

Glad that you’re now on 22.10.


Reply