Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabled but not configured module breaks About page in Icinga Web #5236

Open
julianbrost opened this issue Jul 24, 2024 · 1 comment · May be fixed by #5239
Open

Enabled but not configured module breaks About page in Icinga Web #5236

julianbrost opened this issue Jul 24, 2024 · 1 comment · May be fixed by #5239
Assignees
Labels
bug Something isn't working
Milestone

Comments

@julianbrost
Copy link

Describe the bug

Some code from the x509 module is run when accessing the global About page in Icinga Web (/icingaweb2/about) that throws an exception if the module wasn't configured yet.

To Reproduce

  1. Install Icinga Web 2 as per the usual installation instructions from packages
  2. Install the icinga-x509 package (which automatically enables the module)
  3. Access the About page

Instead of the About page, you are greeted by the following exception:

Cannot load resource config "x509". Resource does not exist

#0 /usr/share/icingaweb2/modules/x509/library/X509/Common/Database.php(42): Icinga\Data\ResourceFactory::getResourceConfig()
Icinga/icingaweb2-module-x509#1 /usr/share/icingaweb2/modules/x509/library/X509/Common/Database.php(29): Icinga\Module\X509\Common\Database::getDb()
Icinga/icingaweb2-module-x509#2 /usr/share/icingaweb2/modules/x509/library/X509/ProvidedHook/DbMigration.php(88): Icinga\Module\X509\Common\Database::get()
Icinga/icingaweb2-module-x509#3 /usr/share/php/Icinga/Application/Hook/DbMigrationHook.php(293): Icinga\Module\X509\ProvidedHook\DbMigration->getDb()
Icinga/icingaweb2-module-x509#4 /usr/share/php/Icinga/Application/Hook/DbMigrationHook.php(172): Icinga\Application\Hook\DbMigrationHook->load()
Icinga/icingaweb2-module-x509#5 /usr/share/php/Icinga/Application/MigrationManager.php(306): Icinga\Application\Hook\DbMigrationHook->getMigrations()
Icinga/icingaweb2-module-x509#6 /usr/share/php/Icinga/Application/MigrationManager.php(56): Icinga\Application\MigrationManager->load()
Icinga/icingaweb2-module-x509#7 /usr/share/php/Icinga/Application/MigrationManager.php(106): Icinga\Application\MigrationManager->getPendingMigrations()
Icinga/icingaweb2-module-x509#8 /usr/share/php/Icinga/Application/MigrationManager.php(69): Icinga\Application\MigrationManager->count()
Icinga/icingaweb2-module-x509#9 /usr/share/icingaweb2/application/views/scripts/about/index.phtml(99): Icinga\Application\MigrationManager->hasPendingMigrations()
Icinga/icingaweb2-module-x509#10 /usr/share/php/Icinga/Web/View.php(235): include(String)
Icinga/icingaweb2-module-x509#11 /usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/View/Abstract.php(886): Icinga\Web\View->_run()
Icinga/icingaweb2-module-x509#12 /usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/Controller/Action/Helper/ViewRenderer.php(910): Zend_View_Abstract->render()
Icinga/icingaweb2-module-x509#13 /usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/Controller/Action/Helper/ViewRenderer.php(931): Zend_Controller_Action_Helper_ViewRenderer->renderScript()
Icinga/icingaweb2-module-x509#14 /usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/Controller/Action/Helper/ViewRenderer.php(970): Zend_Controller_Action_Helper_ViewRenderer->render()
Icinga/icingaweb2-module-x509#15 /usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/Controller/Action/HelperBroker.php(277): Zend_Controller_Action_Helper_ViewRenderer->postDispatch()
Icinga/icingaweb2-module-x509#16 /usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/Controller/Action.php(527): Zend_Controller_Action_HelperBroker->notifyPostDispatch()
Icinga/icingaweb2-module-x509#17 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch()
Icinga/icingaweb2-module-x509#18 /usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/Controller/Front.php(954): Icinga\Web\Controller\Dispatcher->dispatch()
Icinga/icingaweb2-module-x509#19 /usr/share/php/Icinga/Application/Web.php(294): Zend_Controller_Front->dispatch()
Icinga/icingaweb2-module-x509#20 /usr/share/php/Icinga/Application/webrouter.php(105): Icinga\Application\Web->dispatch()
Icinga/icingaweb2-module-x509#21 /usr/share/icingaweb2/public/index.php(4): require_once(String)
Icinga/icingaweb2-module-x509#22 {main}

When disabling the x509 module, the About page works again.

Your Environment

Icinga Web 2 Version 2.12.1
Git commit cd2daeb
PHP Version 8.2.21
Git commit date 2023-11-15
Loaded Libraries
icinga/icinga-php-library 0.14.0
icinga/icinga-php-thirdparty 0.12.1
Loaded Modules
icingadb 1.1.2 Configure
notifications 0.1.0 Configure

icinga-x509 package version is 1.3.2-1+debian12.

@yhabteab yhabteab transferred this issue from Icinga/icingaweb2-module-x509 Jul 24, 2024
@yhabteab
Copy link
Member

Icinga Web 2 should catch any exceptions from those hooks and prevent them from crashing the about page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants