Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

conf generation HS when last servicegroup disabled #10487

Open
dmagniez opened this issue Dec 13, 2021 · 4 comments
Open

conf generation HS when last servicegroup disabled #10487

dmagniez opened this issue Dec 13, 2021 · 4 comments

Comments

@dmagniez
Copy link

Hello,

In Centreon 21.10
when the last servicegroup is disabled, we can't generate configuration file anymore.

error thrown by PHP :

`==> /var/log/php-fpm/centreon-error.log <==
[13-Dec-2021 16:01:31 Europe/Paris] PHP Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /usr/share/centreon/www/class/config-generate/servicegroup.class.php:183
Stack trace:

#0 /usr/share/centreon/www/class/config-generate/host.class.php(505): Servicegroup->generateObjects()

#1 /usr/share/centreon/www/class/config-generate/generate.class.php(232): Host->generateFromPollerId()

#2 /usr/share/centreon/www/class/config-generate/generate.class.php(264): Generate->configPoller()

#3 /usr/share/centreon/www/include/configuration/configGenerate/xml/generateFiles.php(161): Generate->configPollerFromId()

#4 {main}
thrown in /usr/share/centreon/www/class/config-generate/servicegroup.class.php on line 183`

@dmagniez dmagniez added the status/new New tickets label Dec 13, 2021
@lpinsivy
Copy link
Contributor

Thank you @dmagniez for your feedback

Internal ticket MON-11848

@TanguyFournier
Copy link

I'm facing the same issue except it doesn't look like it is limited to servicegroups. Instead, it seems to affect services as well.

Centreon version 21.10.1
/var/log/php-fpm/centreon-error.log

[30-Dec-2021 14:26:06 Europe/Paris] PHP Fatal error:  Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /usr/share/centreon/www/class/config-generate/service.class.php:295
Stack trace:
#0 /usr/share/centreon/www/class/config-generate/service.class.php(387): Service->manageVerticalInheritance()
#1 /usr/share/centreon/www/class/config-generate/service.class.php(569): Service->manageNotificationInheritance()
#2 /usr/share/centreon/www/class/config-generate/host.class.php(113): Service->generateFromServiceId()
#3 /usr/share/centreon/www/class/config-generate/host.class.php(479): Host->getServices()
#4 /usr/share/centreon/www/class/config-generate/host.class.php(497): Host->generateFromHostId()
#5 /usr/share/centreon/www/class/config-generate/generate.class.php(232): Host->generateFromPollerId()
#6 /usr/share/centreon/www/class/config-generate/generate.class.php(264): Generate->configPoller()
#7 /usr/share/centreon/www/include/configuration/configGenerate/xml/generateFiles.php(161): Generate->configPollerFromId()
#8 {main}
  thrown in /usr/share/centreon/www/class/config-generate/service.class.php on line 295

@TanguyFournier
Copy link

We found the culprit ! A service inheriting from a disabled template had been created in the meantime.
Too bad that it doesn't pop up a clearer error message. In addition, except if i miss something, it should not be possible to select a disabled template when creating a new host/service/contact...

@natman
Copy link

natman commented Mar 22, 2022

I'm facing this issue too after upgrading from 3.4 to latest. I removed all disabled services/hosts/servicesgroup etc but nothing helps to generate the conf file

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants