Icinga / icingaweb2

A lightweight and extensible web interface to keep an eye on your environment. Analyse problems and act on them.
https://icinga.com/get-started/
GNU General Public License v2.0
805 stars 280 forks source link

icingacli without full installation fails #2705

Closed aflatto closed 6 years ago

aflatto commented 7 years ago

trying to execute icingacli --help generates the following error:

PHP Fatal error:  Uncaught exception 'Icinga\Exception\ProgrammingError' with message 'Trying to access uninstalled module dir: setup' in /usr/share/php/Icinga/Application/Modules/Manager.php:392
Stack trace:
#0 /usr/share/php/Icinga/Application/Modules/Manager.php(225): Icinga\Application\Modules\Manager->getModuleDir('setup')
#1 /usr/share/php/Icinga/Application/ApplicationBootstrap.php(407): Icinga\Application\Modules\Manager->loadModule('setup')
#2 /usr/share/php/Icinga/Application/Cli.php(46): Icinga\Application\ApplicationBootstrap->loadSetupModuleIfNecessary()
#3 /usr/share/php/Icinga/Application/ApplicationBootstrap.php(336): Icinga\Application\Cli->bootstrap()
#4 /usr/bin/icingacli(7): Icinga\Application\ApplicationBootstrap::start('/usr/share/icin...')
#5 {main}
  thrown in /usr/share/php/Icinga/Application/Modules/Manager.php on line 392

Fatal error: Uncaught exception 'Icinga\Exception\ProgrammingError' with message 'Trying to access uninstalled module dir: setup' in /usr/share/php/Icinga/Application/Modules/Manager.php:392
Stack trace:
#0 /usr/share/php/Icinga/Application/Modules/Manager.php(225): Icinga\Application\Modules\Manager->getModuleDir('setup')
#1 /usr/share/php/Icinga/Application/ApplicationBootstrap.php(407): Icinga\Application\Modules\Manager->loadModule('setup')
#2 /usr/share/php/Icinga/Application/Cli.php(46): Icinga\Application\ApplicationBootstrap->loadSetupModuleIfNecessary()
#3 /usr/share/php/Icinga/Application/ApplicationBootstrap.php(336): Icinga\Application\Cli->bootstrap()
#4 /usr/bin/icingacli(7): Icinga\Application\ApplicationBootstrap::start('/usr/share/icin...')
#5 {main}
  thrown in /usr/share/php/Icinga/Application/Modules/Manager.php on line 392
cli version : icingacli-2.4.1-1.fc24.noarch
on Fedora 24 
4.8.15-200.fc24.x86_64 #1 SMP Thu Dec 15 23:09:22 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
Al2Klimov commented 7 years ago

Hello @aflatto

Works for me. How did you deploy which packages from which repos? Did you alter any IW2 directory structures? # ll /usr/share/icingaweb2/modules ?

Best, AK

aflatto commented 7 years ago

Hello @Al2Klimov

Please see the information below : rpm -ql icingacli /etc/bash_completion.d/icingacli /usr/bin/icingacli /usr/share/icingaweb2/application/clicommands /usr/share/icingaweb2/application/clicommands/AutocompleteCommand.php /usr/share/icingaweb2/application/clicommands/HelpCommand.php /usr/share/icingaweb2/application/clicommands/ModuleCommand.php /usr/share/icingaweb2/application/clicommands/WebCommand.php assaf@aflatto-laptop:~/WorkSpace/SparkBeyond/DevOps$ rpm -qf icingacli error: file /home/assaf/WorkSpace/SparkBeyond/DevOps/icingacli: No such file or directory assaf@aflatto-laptop:~/WorkSpace/SparkBeyond/DevOps$ rpm -qi icingacli Name : icingacli Version : 2.4.1 Release : 1.fc24 Architecture: noarch Install Date: Mon 23 Jan 2017 12:04:03 IST Group : Applications/System Size : 14050 License : GPLv2+ and MIT and BSD Signature : DSA/SHA1, Fri 20 Jan 2017 15:10:42 IST, Key ID c6e319c334410682 Source RPM : icingaweb2-2.4.1-1.fc24.src.rpm Build Date : Fri 20 Jan 2017 15:10:36 IST Build Host : e204419c1927 Relocations : (not relocatable) Packager : Icinga Team info@icinga.com URL : https://icinga.com Summary : Icinga CLI Description : Icinga CLI

ls /usr/share/icingaweb2/modules total 0

Regards Assaf

Al2Klimov commented 7 years ago

@aflatto Have you installed icingaweb2? If not: why?

aflatto commented 7 years ago

@Al2Klimov I have the folowing icingaweb2 packages installed : rpm -qa | grep icingaweb2 icingaweb2-vendor-zf1-1.12.20-1.fc24.noarch icingaweb2-common-2.4.1-1.fc24.noarch

Al2Klimov commented 7 years ago

@aflatto Please install the package icingaweb2. Does this fix your problem?

aflatto commented 7 years ago

yes, but if i want to install just the cli on a machine is that not an option ?

dgoetz commented 7 years ago

Please reopen this issue. Especially as the cli is used also as check command for some modules it should run without the complete webinterface with only some configuration required which of course should be documentated.

lazyfrosch commented 7 years ago

Agreed, looks like the auto-enabled setup module causes problems (when no config is present)

Al2Klimov commented 7 years ago

@lippserd Should we either silently fail to load the setup module or put it in a separate RPM package and make the CLI depending on it?

lazyfrosch commented 7 years ago

Would we need the setup module for anything specific? (in CLI)

Configuration should be duty of the user if he wants a minimal installation for some sorts, but it should not fail like this :)

I think all it needs is the main config dir / config.ini present, isn't it?

Al2Klimov commented 7 years ago

@lazyfrosch The CLI is "most likely" used to set up IW2 so the setup mod should be auto-loaded. But I think we should not debate about it right now. @lippserd should decide.

lippserd commented 6 years ago

@Al2Klimov The setup module should be auto-loaded but should not throw an error if the module does not exist. Are there more steps necessary in order to make the icingacli work w/o the installation of icingaweb2?

Al2Klimov commented 6 years ago

No.