Skip to main content
Solved

FAIL SQL UPGRADE 22.04.5 to 22.04.6

  • October 4, 2022
  • 3 replies
  • 392 views

Forum|alt.badge.img+5

Bonjour,

 

J’ai un soucis d’upgrade de Centreon ; en effet une erreur apparait (voir PJ).



Lorsque je vais dans l’upgrade.log j’ai un soucis au niveau de ma colonne de ma table host :
 

2022-10-04 09:54|0|0|UPGRADE - 22.04.6: Impossible to update 'hosts' table - Code : 22003 - Error : SQLSTATE[22003]: Numeric value out of range: 1264 Out o
f range value for column 'notification_number' at row 57 - Trace : #0 /usr/share/centreon/www/class/centreonDB.class.php(309): PDO->query()
#1 /usr/share/centreon/www/install/php/Update-22.04.6.php(32): 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\DbWriteUpdateRe
pository->runScript()
#4 /usr/share/centreon/www/install/step_upgrade/process/process_step4.php(46): Core\Platform\Infrastructure\Repository\DbWriteUpdateRepository->runUpdate()
#5 {main}

 

Je ne suis pas trés à l’aise en SQL savez ce que je dois faire ?

Hello,


I have a problem with the Centreon upgrade; indeed an error appears (see PJ).

 

When I go to the upgrade.log I have a problem with my host table column:

2022-10-04 09:54|0|0|UPGRADE - 22.04.6: Impossible to update 'hosts' table - Code: 22003 - Error: SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value for column 'notification_number' at row 57 - Trace : #0 /usr/share/centreon/www/class/centreonDB.class.php(309): PDO->query()
#1 /usr/share/centreon/www/install/php/Update-22.04.6.php(32): 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): CorePlatform/Infrastructure/Repository/DbWriteUpdateRe
pository->runScript()
#4 /usr/share/centreon/www/install/step_upgrade/process/process_step4.php(46): CorePlatformInfrastructureRepositoryDbWriteUpdateRepository->runUpdate()
#5 {main}


I'm not very comfortable with SQL, what should I do?

Best answer by L3eO

Ok i found solution to change smallint to BIGINT :

alter table hosts change column notification_number notification_number BIGINT NULL DEFAULT NULL;


And after that the same for the services table :

alter table services change column notification_number notification_number BIGINT NULL DEFAULT NULL;

3 replies

lpinsivy
Centreonian
Forum|alt.badge.img+21
  • Centreonian
  • October 4, 2022

Can you give me the current schema of centreon_storage.hosts table using following SQL request:

desc centreon_storage.hosts;

 


Forum|alt.badge.img+5
  • Author
  • Steward **
  • Answer
  • October 4, 2022

Ok i found solution to change smallint to BIGINT :

alter table hosts change column notification_number notification_number BIGINT NULL DEFAULT NULL;


And after that the same for the services table :

alter table services change column notification_number notification_number BIGINT NULL DEFAULT NULL;


Forum|alt.badge.img
  • Steward *
  • October 5, 2022

Bonjour @L3eO 
Merci pour le partage.