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

Broken UI if service/host_icon_image is set to a variable that doesn't exist #5168

Open
Tqnsls opened this issue Jan 8, 2024 · 0 comments · May be fixed by #5201
Open

Broken UI if service/host_icon_image is set to a variable that doesn't exist #5168

Tqnsls opened this issue Jan 8, 2024 · 0 comments · May be fixed by #5201
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Tqnsls
Copy link

Tqnsls commented Jan 8, 2024

Describe the bug

icingacli monitoring list services --format csv --columns "host,service,service_icon_image":
"example_host","example_service1",""
"example_host","example_service2","$host_icon_image$"
"example_host","example_service3","/internal_url/icon_host.png"

To Reproduce

  1. Create a generic-service template with its icon_image set to $host_icon_image$.
  2. Create some services which have a service_icon_image set to an icinga-icon or an url which overwrites the generic-service's icon_image (those services cause no problems). In the example it's example_service1 and example_service3
  3. Create service that have set the host's icon_image (they break the overview). In the example its example_service2

The stacktrace in the icingaweb log is:

Error in /usr/share/icingaweb2/modules/monitoring/library/Monitoring/Object/Macro.php:72 with message: Call to undefined method stdClass::getName()
#0 /usr/share/icingaweb2/modules/monitoring/library/Monitoring/Object/Macro.php(45): Icinga\Module\Monitoring\Object\Macro::resolveMacro(String, Object(stdClass))
#1 /usr/share/icingaweb2/modules/monitoring/application/views/helpers/IconImage.php(58): Icinga\Module\Monitoring\Object\Macro::resolveMacros(String, Object(stdClass))
#2 /usr/share/icingaweb2/modules/monitoring/application/views/scripts/list/services.phtml(74): Zend_View_Helper_IconImage->service(Object(stdClass))
#3 /usr/share/php/Icinga/Web/View.php(235): include(String)
#4 /usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/View/Abstract.php(886): Icinga\Web\View->_run(String)
#5 /usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/Controller/Action/Helper/ViewRenderer.php(910): Zend_View_Abstract->render(NULL)
#6 /usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/Controller/Action/Helper/ViewRenderer.php(931): Zend_Controller_Action_Helper_ViewRenderer->renderScript(String, NULL)
#7 /usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/Controller/Action/Helper/ViewRenderer.php(970): Zend_Controller_Action_Helper_ViewRenderer->render()
#8 /usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/Controller/Action/HelperBroker.php(277): Zend_Controller_Action_Helper_ViewRenderer->postDispatch()
#9 /usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/Controller/Action.php(527): Zend_Controller_Action_HelperBroker->notifyPostDispatch()
#10 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch(String)
#11 /usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/Controller/Front.php(954): Icinga\Web\Controller\Dispatcher->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#12 /usr/share/php/Icinga/Application/Web.php(294): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#13 /usr/share/php/Icinga/Application/webrouter.php(105): Icinga\Application\Web->dispatch()
#14 /usr/share/icingaweb2/public/index.php(4): require_once(String)
#15 {main}

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Your Environment

  • Icinga Web 2 version and modules (System - About): 2.12.1

Additional context

Reference:
dae7bf4
dae7bf4#commitcomment-136484066

@nilmerg nilmerg added the bug Something isn't working label Jan 8, 2024
@nilmerg nilmerg added this to the v2.12.2 milestone Jan 8, 2024
@nilmerg nilmerg changed the title Commit dae7bf4657895ba1283cdd56c1a7d7c836681aa3 breaks service-overview when service_icon_image is set to a variable Broken UI if service/host_icon_image is set to a variable that doesn't exist Jan 9, 2024
@sukhwinder33445 sukhwinder33445 self-assigned this Mar 25, 2024
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.

3 participants