Error: Constant must not be modified icinga2 after install packages

After install some packages, the icinga satellite isn’t be able to begin the monitoring, the logs show me this error:

critical/ApiListener: Config validation failed for staged cluster config sync in ‘/var/lib/icinga2/api/zones-stage/’. Aborting. Logs: ‘/var/lib/icinga2/api//zones-stage-startup-last-failed.log’

and if I check the log…
information/cli: Icinga application loader (version: r2.14.0-1)
information/cli: Loading configuration file(s).
critical/config: Error: Constant must not be modified.

I can’t find if some of this packages, would be broke some configuration, if I got back before the installation of the packages, icinga2 works well

python36-requests-2.14.2-2.el7.noarch
python36-pysocks-1.6.8-6.el7.noarch
python36-cached_property-1.5.1-2.el7.noarch
python36-docker-pycreds-0.2.1-2.el7.noarch
python36-docker-2.6.1-3.el7.noarch
python36-six-1.12.0-1.el7.noarch
python36-dockerpty-0.4.1-18.el7.noarch
python36-jsonschema-2.5.1-4.el7.noarch
python36-urllib3-1.25.6-1.el7.noarch
python36-texttable-1.6.2-1.el7.noarch
python36-chardet-3.0.4-1.el7.noarch
python36-idna-2.7-2.el7.noarch
python36-PyYAML-3.12-1.el7.x86_64
python36-websocket-client-0.47.0-2.el7.noarch
python36-docopt-0.6.2-8.el7.noarch
libzip-0.10.1-8.el7.x86_64
bzip2-1.0.6-13.el7.x86_64
unzip-6.0-24.el7_9.x86_64
nss-pam-ldapd-0.8.13-25.el7.x86_64
nagios-plugins-ldap-2.3.1-3.el7.x86_64
openldap-clients-2.4.44-25.el7_9.x86_64
openssh-ldap-7.4p1-22.el7_9.x86_64
tzdata-java-2020a-1.el7.noarch

Hello and welcome :slight_smile:

Is there anything else other than this in the log file? For example which config file it is complaining about?

Issues I found containing the same error message: https://github.com/Icinga/icinga2/issues?q="Constant+must+not+be+modified"

Maybe look inside one of those a check your config files. Maybe it is in /etc/icinga2/constants.conf or some file under /etc/icinga2/features-enabled or even in some config that get synced from the master.

It’s the whole log that I have, just these 4 lines, I checked the constants.conf and features-enabled vs a node that it’s running well, but I don’t have difference between them :worried:

As it is a satellite it might be some configuration that is located on the master.
Check in the /etc/icinga2/zones.d/ folder. Look in the zone that the satellite is part of and check the configs there.

You could also grep for the read-only constants from Language Reference - Icinga 2 and check something turns up.

Hi all, Icinga 2 is not complaining about a read-only attribute being set, rather about a constant being modified later on. E.g. there is a constant NodeName in your constants.conf file, you can’t set this constant later elsewhere by doing something like: NodeName = "Fooo".

critical/ApiListener: Config validation failed for staged cluster config sync in ‘/var/lib/icinga2/api/zones-stage/’. Aborting. Logs: ‘/var/lib/icinga2/api//zones-stage-startup-last-failed.log’

In this startup log must be a full path to and the name of the constant being set illegally, i.e. something like this. Then it should be easy to locate and fix the error by yourself.

[2023-07-31 10:10:02 +0000] critical/config: Error: Constant must not be modified.
Location: in /etc/icinga2/zones.d/master/test-services.conf: 123:1-123:17
/etc/icinga2/zones.d/master/test-services.conf(121): }
/etc/icinga2/zones.d/master/test-services.conf(122):
/etc/icinga2/zones.d/master/test-services.conf(123): FooBar = "FooBar"
                                                     ^^^^^^^^^^^^^^^^^
1 Like