Icingaweb2 reinstall not working

Hello,

and sorry but it seems I messed up Icingaweb2 on my working Debian setup.

I had everything worked for few months.

Yesterday I had a “brilliant” idea to install gitlab-ee next to Icinga on the same server.
Right know I know it will be better to solve gitlab via Docker container.

So what happened (OS: Debian Stretch)
working status (without backup, my bad)
It was installed by guide following with php7.3 FPM with Apache few month ago, all working.
Yesterday:
installed gitlab-ee + set the external url to gitlab.domain.cz
I realized right after installation its on the same port 80 (Icinga on Apache and new Gitlab on nginx)
Uninstalled gitlab-ee to prevent it from to have apache and nginx together.
icingaweb has stopped working, restarts didnt helped, and it seems that installation of gitlab somehow corrupted apache.

So I went through:
backup /usr/share/icingaweb2 folder
apt-get remove/purge of apache2 icingaweb2 icingacli
manualy deleted /etc/apache2 folder
reboot
apt-get install apache2
apt-get install icingaweb2
apt-get install icingacli
while trying to install icingaweb2 and icingacli it went into errors like this:

root@control_machine:/home/bmcom# apt-get install icingaweb2 icingacli
Reading package lists… Done
Building dependency tree
Reading state information… Done
icingacli is already the newest version (2.7.1-1.stretch).
icingaweb2 is already the newest version (2.7.1-1.stretch).
The following packages were automatically installed and are no longer required:
libconfig-inifiles-perl libjemalloc1 php-htmlpurifier sgml-base xml-core
Use ‘apt autoremove’ to remove them.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
3 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up icingaweb2 (2.7.1-1.stretch) …
apache2_invoke rewrite: no action - module was disabled by local admin
dpkg: error processing package icingaweb2 (–configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of icingaweb2-module-doc:
icingaweb2-module-doc depends on icingaweb2 (= 2.7.1-1.stretch); however:
Package icingaweb2 is not configured yet.
dpkg: error processing package icingaweb2-module-doc (–configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of icingaweb2-module-monitoring:
icingaweb2-module-monitoring depends on icingaweb2 (= 2.7.1-1.stretch); however:
Package icingaweb2 is not configured yet.
dpkg: error processing package icingaweb2-module-monitoring (–configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
icingaweb2
icingaweb2-module-doc
icingaweb2-module-monitoring
E: Sub-process /usr/bin/dpkg returned an error code (1)

When separating them it helped and install is complete.

But the next step from the guide for Debian went here:
icingacli setup token create
Found invalid module in enabledModule directory “/etc/icingaweb2/enabledModules”: “/etc/icingaweb2/enabledModules/setup” points to non existing path “false”
The ‘setup’ module does not provide any CLI commands

So I manualy removed the not working link for module setup
But
icingacli module install setup
ERROR: Icinga\Exception\IcingaException in /usr/share/php/Icinga/Cli/Command.php:154 with message: Not implemented yet

Right now the web page looks like this:

Warning : Uncaught ErrorException: require_once(Zend/Loader/Autoloader.php): failed to open stream: No such file or directory in /usr/share/php/Icinga/Application/ClassLoader.php:273 Stack trace: #0 /usr/share/php/Icinga/Application/ClassLoader.php(273): Icinga\Application\ApplicationBootstrap->Icinga\Application{closure}(2, ‘require_once(Ze…’, ‘/usr/share/php/…’, 273, Array) #1 /usr/share/php/Icinga/Application/ClassLoader.php(273): require_once() #2 /usr/share/php/Icinga/Application/ClassLoader.php(291): Icinga\Application\ClassLoader->requireZendAutoloader() #3 [internal function]: Icinga\Application\ClassLoader->loadClass(‘Zend_Controller…’) #4 /usr/share/php/Icinga/Web/Request.php(14): spl_autoload_call(‘Zend_Controller…’) #5 /usr/share/php/Icinga/Application/ClassLoader.php(303): require(‘/usr/share/php/…’) #6 [internal function]: Icinga\Application\ClassLoader->loadClass(‘Icinga\Web\Requ…’) #7 /usr/share/php/Icinga/Application/EmbeddedWeb.php(85): spl_autoload_call(‘Icinga\Web\Requ…’) #8 /usr/ in /usr/share/php/Icinga/Application/ClassLoader.php on line 273

Fatal error : Icinga\Application\ClassLoader::requireZendAutoloader(): Failed opening required ‘Zend/Loader/Autoloader.php’ (include_path=‘/usr/share/icingaweb2/library/vendor:.:/usr/share/php’) in /usr/share/php/Icinga/Application/ClassLoader.php on line 273

Its similar to Icingaweb2 post-installation Zend Loader error

Can anyone please point me into the right direction? Icinga daemon works and collects data from monitored satelites/clients.

Is is possible to clean it up and install just Icingaweb2 again?
From what I remember the installation is super easy, just few commands when the system was freshly installed.

After it will be solved for sure making snapshot a backing up everything before I will do next operations on the server.

Thanks in advance.

Change

into

icingacli module enable setup

A simple package re-install will leave the configuration untouched, a successful setup also disables this module to prevent further unwanted changes.

Cheers,
Michael

Hello,

thanks for response, but it seems its broken more deep. Because

root@control_machine:/# icingacli module enable setup
ERROR: Icinga\Exception\ConfigurationError in /usr/share/php/Icinga/Application/Modules/Manager.php:248 with message: Cannot enable module “setup”. Module is not installed.

What to do?
Can I without touching icinga daemon rebuild icingaweb2 with icingacli to working status please?

Thank you for your support!

Hm, look for the package then which provides the setup module, e.g. icingaweb2-module-setup.

This doesnt work :frowning:

apt-get install icingaweb2-module-setup
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package icingaweb2-module-setup is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
icingaweb2-common
E: Package ‘icingaweb2-module-setup’ has no installation candidate

So I made reinstall of common

apt-get install --reinstall icingaweb2-common
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages were automatically installed and are no longer required:
libconfig-inifiles-perl libjemalloc1 php-htmlpurifier sgml-base xml-core
Use ‘apt autoremove’ to remove them.
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 11 not upgraded.
Need to get 0 B/428 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database … 48119 files and directories currently installed.)
Preparing to unpack …/icingaweb2-common_2.7.1-1.stretch_all.deb …
Unpacking icingaweb2-common (2.7.1-1.stretch) over (2.7.1-1.stretch) …
Setting up icingaweb2-common (2.7.1-1.stretch) …

From this point I tried enabled setup

root@control_machine:/# icingacli module enable setup

root@control_machine:/# icingacli module list
MODULE VERSION STATE DESCRIPTION
monitoring 2.7.1 enabled Icinga monitoring module
setup 2.7.1 enabled Setup module

But even after restart of apache and visit icinga.domain.cz/icingaweb2/setup it return the same error:

Warning : Uncaught ErrorException: require_once(Zend/Loader/Autoloader.php)…

What do you suggest now?

Thanks

The previous uninstalling, remove link and other manual interactions are now in a somewhat broken state. I’d suggest backing up the configuration directory (in case you need it), also the MySQL database.

Then purge everything away and start fresh.

Even the icinga daemon right? purge like this? apt-get remove --purge icinga2 icingaweb2 icingacli apache
Right?
OK it makes sense while its broken and we are unble to make it working.
In result it will took less time than repairing.

No, only the web components.

I already did it before posting.
What else I have to clean?
Uninstall web2, cli and apache, remove/backup the /usr/share/icingaweb2 and?
And also database? For web only.