Skip to main content

BAM update from 23.10 to 24.10 does not seem to apply required SQL schema updates, as a result upgrade renders BAM unusable with error like this

[2025-04-07T14:32:23+03:00] ERROR : [CentreonDb] Error while using CentreonDb::query | {"context":{"default":{"back_trace":{"file":"/usr/share/centreon/www/class/centreonDB.class.php","line":947,"class":null,"function":null},"request_infos":{"url":"/centreon/api/internal.php?object=centreon_bam_top_counter&action=getBamTopCounterData","http_method":"GET","server":"10.204.72.72","referrer":"https://10.204.72.72/centreon/main.php?p=20201"}},"exception":{"exception_type":"PDOException","file":"/usr/share/centreon/www/class/centreonDB.class.php","line":1011,"code":"42S22","message":"SQLSTATE[42S22]: Column not found: 1054 Unknown column 'all_business_views' in 'field list'","previous":null},"custom":{"db_name":"centreon","query":"    SELECT ba_group_id, all_business_views FROM mod_bam_acl ","pdo_error_infos":["42S22",1054,"Unknown column 'all_business_views' in 'field list'"],"pdo_error_code":"42S22","bind_params":null}}}

Solution is to update mod_bam_acl table to match new expected schema

$ mysql
mysql> use centreon
mysql> ALTER TABLE `mod_bam_acl`
-- Modify ba_group_id to allow NULL
MODIFY `ba_group_id` int(11) DEFAULT NULL,

-- Add the new columns
ADD COLUMN `acl_res_id` int(11) NULL AFTER `acl_group_id`,
ADD COLUMN `all_business_views` TINYINT DEFAULT 0 AFTER `ba_group_id`;

I could expect this level issues with open source software, but with paid solution this is kind of unacceptable.

Hello ​@thakala 
Thanks for the info you gave.
I just tried to upgrade from Centreon 23.10 to 24.10 following this documentation and I have no issue.

After the upgrade of Centreon BAM as described here, the schema is ok:

CREATE TABLE `mod_bam_acl` (
`acl_ba_id` int(11) NOT NULL AUTO_INCREMENT,
`acl_group_id` int(11) NOT NULL,
`ba_group_id` int(11) DEFAULT NULL,
`acl_res_id` int(11) DEFAULT NULL,
`all_business_views` tinyint(4) DEFAULT 0,
PRIMARY KEY (`acl_ba_id`),
KEY `mod_bam_acl_ibfk_1` (`ba_group_id`),
KEY `mod_bam_acl_ibfk_2` (`acl_group_id`),
CONSTRAINT `mod_bam_acl_ibfk_1` FOREIGN KEY (`ba_group_id`) REFERENCES `mod_bam_ba_groups` (`id_ba_group`) ON DELETE CASCADE,
CONSTRAINT `mod_bam_acl_ibfk_2` FOREIGN KEY (`acl_group_id`) REFERENCES `acl_groups` (`acl_group_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci

Before having this issue, did you complete the BAM upgrade from the page Administration > Extensions > Manager ?


Reply