"Out of range value for column 'notification_number' at row 1" error after an upgrade or an update
Symptoms
After an update or an upgrade (to 22.04 or 22.10), poller warns as follows:
And the broker logs returns errors as follows:
>2022-08-22T15:30:40.917+02:00] sql] error] mysql_connection: could not store service: Out of range value for column 'notification_number' at row 1 >2022-08-22T15:30:40.917+02:00] core] error] failover: global error: could not store service: Out of range value for column 'notification_number' at row 1
Problem
When a host or service has a non-ok status for a while, centreon-broker keeps incrementing the notification_number until it reaches 32767, which is a maximum value.
Solution
You need to change the type of the column to allow centreon-broker to insert larger values.
Log into your terminal and connect to MySQL: mysql -udatabase_user -p
Run these queries:
UPDATE centreon_storage.hosts SET notification_number=0 WHERE notification_number < 0; UPDATE centreon_storage.services SET notification_number=0 WHERE notification_number < 0;
ALTER TABLE centreon_storage.hosts MODIFY notification_number bigint(20) unsigned DEFAULT NULL; ALTER TABLE centreon_storage.services MODIFY notification_number bigint(20) unsigned DEFAULT NULL;
After 20 minutes, check the last update in the Centreon interface in the Configuration > Pollers menu.
If it is still warning
Check the /var/log/centreon-broker/central-broker-master.log file.
Improved Broker's behaviour when trying to insert negative values in unsigned columns of the storage database.
FYI :
If the error persists, you can try with this type :
ALTER TABLE centreon_storage.services MODIFY notification_number bigint(20) DEFAULT NULL;
ALTER TABLE centreon_storage.hosts MODIFY notification_number bigint(20) DEFAULT NULL;
The unsigned type could not be recognized by mariadb.
Hi,
I’m using Centreon version 21.10.14, the OS is Centos 7 and the database MariaDB. I keep seeing these error messages in our logs despite both columns have being resized to bigint(20) unsigned.
Is there anything else we can do to get rid of them?
Regards,
LM
Hi,
I’m using Centreon version 21.10.14, the OS is Centos 7 and the database MariaDB. I keep seeing these error messages in our logs despite both columns have being resized to bigint(20) unsigned.
Is there anything else we can do to get rid of them?
Regards,
LM
Hello @gianola ,
Old mysql versions doesn’t support “unsigned”, have you tried the 2nd solution pinned?
Hello @gianola ,
Old mysql versions doesn’t support “unsigned”, have you tried the 2nd solution pinned?
Hi,
I haven’t noticed the 2nd solution, we are now testing it.
Is it possible that this issue prevented our Centreon to show information in the web from time to time as explained in the thread below? I was focusing on PHP configuration and it seems quite strange to me that the issue comes from the database.
Thank you! LM.
Hi @Sébastien thank you !!
This article resolve communications problems between the central and the remote servers on our monitoring platform.