Failed to set up Icinga Web 2 - Check the permissions for the enabledModules directory

I’m installing Icinga2 with Icinga Web2 from using the Icinga2/Icinga Web 2 repository, and also I’ve installed/configured the Director from GIT repository on a Red Hat 7.6 prior to executing the web setup.

But the web setup is failing with the following error:

Sorry! Failed to set up Icinga Web 2 successfully.

Successfully connected to existing database “icingaweb2_db”…
Database schema already exists…
Login “icingaweb2” already exists…
Required privileges were already granted to login “icingaweb2”.
The database has been fully set up!

General configuration has been successfully written to: /etc/icingaweb2/config.ini

Authentication configuration has been successfully written to: /etc/icingaweb2/authentication.ini
Account “icinga_admin” has been successfully defined as initial administrator.

User Group Backend configuration has been successfully written to: /etc/icingaweb2/groups.ini

Resource configuration has been successfully written to: /etc/icingaweb2/resources.ini

Monitoring backend configuration has been successfully written to: /etc/icingaweb2/modules/monitoring/backends.ini
Resource configuration has been successfully updated: /etc/icingaweb2/resources.ini

Command transport configuration has been successfully created: /etc/icingaweb2/modules/monitoring/commandtransports.ini

Monitoring security configuration has been successfully created: /etc/icingaweb2/modules/monitoring/config.ini

Module “director” could not be enabled. An error occured:
ERROR: Icinga\Exception\SystemPermissionException in /usr/share/php/Icinga/Application/Modules/Manager.php:275 with message: Cannot enable module “director”. Check the permissions for the enabledModules directory: /etc/icingaweb2/enabledModules
Module “doc” could not be enabled. An error occured:
ERROR: Icinga\Exception\SystemPermissionException in /usr/share/php/Icinga/Application/Modules/Manager.php:275 with message: Cannot enable module “doc”. Check the permissions for the enabledModules directory: /etc/icingaweb2/enabledModules
Module “monitoring” could not be enabled. An error occured:
ERROR: Icinga\Exception\SystemPermissionException in /usr/share/php/Icinga/Application/Modules/Manager.php:275 with message: Cannot enable module “monitoring”. Check the permissions for the enabledModules directory: /etc/icingaweb2/enabledModules

Here is some info about the version I 've installed:

[root@icinga2 ~]# icinga2 --version
icinga2 - The Icinga 2 network monitoring daemon (version: r2.10.5-1)

Copyright © 2012-2019 Icinga GmbH (https://icinga.com/)
License GPLv2+: GNU GPL version 2 or later http://gnu.org/licenses/gpl2.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

System information:
Platform: Red Hat Enterprise Linux Server
Platform version: 7.6 (Maipo)
Kernel: Linux
Kernel version: 3.10.0-957.el7.x86_64
Architecture: x86_64

Build information:
Compiler: GNU 4.8.5
Build host: afcad697467e

Application information:

General paths:
Config directory: /etc/icinga2
Data directory: /var/lib/icinga2
Log directory: /var/log/icinga2
Cache directory: /var/cache/icinga2
Spool directory: /var/spool/icinga2
Run directory: /run/icinga2

Old paths (deprecated):
Installation root: /usr
Sysconf directory: /etc
Run directory (base): /run
Local state directory: /var

Internal paths:
Package data directory: /usr/share/icinga2
State path: /var/lib/icinga2/icinga2.state
Modified attributes path: /var/lib/icinga2/modified-attributes.conf
Objects path: /var/cache/icinga2/icinga2.debug
Vars path: /var/cache/icinga2/icinga2.vars
PID path: /run/icinga2/icinga2.pid
[root@icinga2 ~]#

I fixed it!

For some reason, the permissions for the enabledModules directory (/etc/icingaweb2/enabledModules) were pointing to a symbolic link with a different set of permissions.

I fixed it by executing:

$ chown -R apache /etc/icingaweb2/

1 Like