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

Host/Service actions with only a label are not shown #4211

Closed
Arukadox opened this issue Jul 16, 2020 · 15 comments · Fixed by #4219
Closed

Host/Service actions with only a label are not shown #4211

Arukadox opened this issue Jul 16, 2020 · 15 comments · Fixed by #4219
Assignees
Labels
area/navigation Affects the navigation bug Something isn't working
Milestone

Comments

@Arukadox
Copy link

Arukadox commented Jul 16, 2020

Describe the bug

Hi, recently I've updated my RHEL 7.5 installation to 7.8 along with icinga2 from 2.9 to 2.11 and icingaweb2 to 2.8.1-1.
Most of the update went like a charm but I've noticed that right now I'm getting error under "Problem handling" field on each service in icinga web.
Problem handling
Icinga\Exception\ProgrammingError in /usr/share/php/Icinga/Web/Url.php:168 with message: url "" is not a string

I've tried to search for solution for many hours and ended up digging in php-fpm installation etc. but without any luck.
So any solution or workaround would be greatly appreciated.

Screenshots

image

Your Environment

[root@icinga]# icinga2 --version
icinga2 - The Icinga 2 network monitoring daemon (version: 2.11.4-1)

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

Build information:
  Compiler: GNU 4.8.5
  Build host: runner-ltrjqz9n-project-322-concurrent-0

[root@icinga]# icingacli --version
Icinga Web 2  2.8.1
Git Commit    233bd29e4104125b4e5ef631e8c16dde33dadd9a
PHP Version   7.3.11
MODULE       VERSION
audit        1.0.1
director     1.7.0
fileshipper  1.1.0
incubator    0.5.0
ipl          v0.3.0
monitoring   2.8.1
pnp          1.1.0
reactbundle  0.7.0
vspheredb    1.1.0

[root@icinga]# php -v
PHP 7.3.11 (cli) (built: Oct 31 2019 08:30:29) ( NTS )

Kind Regards
Michal

@nilmerg
Copy link
Member

nilmerg commented Jul 17, 2020

Hi,

That's probably a module. Disable the modules one by one and check if it disappears after disabling a particular one. This may already allow you to track the issue down, if not, head back here.

@Arukadox
Copy link
Author

Hello I've tried to disable modules one by one and even all of them leaving only monitoring module active and this error is still there.

@Al2Klimov
Copy link
Member

Hello @Arukadox and thank you for reporting!

Please share the error message in your current setup + #4217.

Best,
AK

@Al2Klimov Al2Klimov added the needs-feedback We'll only proceed once we hear from you again label Aug 6, 2020
@Arukadox
Copy link
Author

Arukadox commented Aug 6, 2020

After changing
'url "%s" is not a string', $url
to
'url %s is not a string', var_export($url, true)

I'm getting this error
Icinga\Exception\ProgrammingError in /usr/share/php/Icinga/Web/Url.php:168 with message: url NULL is not a string

@Al2Klimov
Copy link
Member

IcingaException::describe() seems to be the only one which generates messages with a such format.

What happens if you apply this one?

diff --git library/Icinga/Exception/IcingaException.php library/Icinga/Exception/IcingaException.php
index a87ea4a8f..82793dc3d 100644
--- library/Icinga/Exception/IcingaException.php
+++ library/Icinga/Exception/IcingaException.php
@@ -52,6 +52,7 @@ class IcingaException extends Exception
      */
     public static function describe(Exception $exception)
     {
+        return static::getConfidentialTraceAsString($exception);
         return sprintf(
             '%s in %s:%d with message: %s',
             get_class($exception),

@Arukadox
Copy link
Author

Arukadox commented Aug 6, 2020

That one did a lot ;)

#0 /usr/share/icingaweb2/modules/monitoring/library/Monitoring/Web/Navigation/Action.php(106): Icinga\Web\Url::fromPath(NULL)
#1 /usr/share/php/Icinga/Web/Navigation/Renderer/NavigationItemRenderer.php(186): Icinga\Module\Monitoring\Web\Navigation\Action->getUrl()
#2 /usr/share/php/Icinga/Web/Navigation/NavigationItem.php(901): Icinga\Web\Navigation\Renderer\NavigationItemRenderer->render(Object(Icinga\Module\Monitoring\Web\Navigation\ServiceAction))
#3 /usr/share/php/Icinga/Web/Navigation/Renderer/RecursiveNavigationRenderer.php(172): Icinga\Web\Navigation\NavigationItem->render()
#4 /usr/share/php/Icinga/Web/Navigation/Renderer/RecursiveNavigationRenderer.php(193): Icinga\Web\Navigation\Renderer\RecursiveNavigationRenderer->render()
#5 /usr/share/icingaweb2/modules/monitoring/application/views/scripts/show/components/actions.phtml(42): Icinga\Web\Navigation\Renderer\RecursiveNavigationRenderer->__toString()
#6 /usr/share/php/Icinga/Web/View.php(248): include(String)
#7 /usr/share/icingaweb2/library/vendor/Zend/View/Abstract.php(877): Icinga\Web\View->_run(String)
#8 /usr/share/icingaweb2/modules/monitoring/application/views/scripts/partials/object/detail-content.phtml(13): Zend_View_Abstract->render(NULL)
#9 /usr/share/php/Icinga/Web/View.php(248): include(String)
#10 /usr/share/icingaweb2/library/vendor/Zend/View/Abstract.php(877): Icinga\Web\View->_run(String)
#11 /usr/share/icingaweb2/modules/monitoring/application/views/scripts/service/show.phtml(8): Zend_View_Abstract->render(NULL)
#12 /usr/share/php/Icinga/Web/View.php(248): include(String)
#13 /usr/share/icingaweb2/library/vendor/Zend/View/Abstract.php(877): Icinga\Web\View->_run(String)
#14 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php(904): Zend_View_Abstract->render(NULL)
#15 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php(925): Zend_Controller_Action_Helper_ViewRenderer->renderScript(String, NULL)
#16 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php(964): Zend_Controller_Action_Helper_ViewRenderer->render()
#17 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/HelperBroker.php(272): Zend_Controller_Action_Helper_ViewRenderer->postDispatch()
#18 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action.php(518): Zend_Controller_Action_HelperBroker->notifyPostDispatch()
#19 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch(String)
#20 /usr/share/icingaweb2/library/vendor/Zend/Controller/Front.php(937): Icinga\Web\Controller\Dispatcher->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#21 /usr/share/php/Icinga/Application/Web.php(300): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#22 /usr/share/php/Icinga/Application/webrouter.php(99): Icinga\Application\Web->dispatch()
#23 /usr/share/icingaweb2/public/index.php(4): require_once(String)
#24 {main}

@Al2Klimov
Copy link
Member

And this one?

diff --git library/Icinga/Web/Navigation/Renderer/RecursiveNavigationRenderer.php library/Icinga/Web/Navigation/Renderer/RecursiveNavigationRenderer.php
index 562ed37d6..899bf3d19 100644
--- library/Icinga/Web/Navigation/Renderer/RecursiveNavigationRenderer.php
+++ library/Icinga/Web/Navigation/Renderer/RecursiveNavigationRenderer.php
@@ -192,6 +192,7 @@ class RecursiveNavigationRenderer extends RecursiveIteratorIterator implements N
         try {
             return $this->render();
         } catch (Exception $e) {
+            return var_export($this, true);
             return IcingaException::describe($e);
         }
     }

@Arukadox
Copy link
Author

Arukadox commented Aug 6, 2020

So this massive error disappeared but we have new one:
Icinga\Web\Navigation\Renderer\RecursiveNavigationRenderer::__set_state(array( 'content' => array ( 0 => '

And on top of that something else broke:
image

@Al2Klimov
Copy link
Member

Damn! Overseen an 🐘!

diff --git library/Icinga/Web/Navigation/Renderer/RecursiveNavigationRenderer.php library/Icinga/Web/Navigation/Renderer/RecursiveNavigationRenderer.php
index 562ed37d6..9c04f69d4 100644
--- library/Icinga/Web/Navigation/Renderer/RecursiveNavigationRenderer.php
+++ library/Icinga/Web/Navigation/Renderer/RecursiveNavigationRenderer.php
@@ -192,6 +192,7 @@ class RecursiveNavigationRenderer extends RecursiveIteratorIterator implements N
         try {
             return $this->render();
         } catch (Exception $e) {
+            return '<pre>' . htmlspecialchars(var_export($this, true), ENT_COMPAT | ENT_SUBSTITUTE | ENT_HTML5, 'UTF-8') . '</pre>';
             return IcingaException::describe($e);
         }
     }

@Al2Klimov
Copy link
Member

Damn! It doesn't dump base class' members. Try this instead:

diff --git modules/monitoring/application/views/scripts/show/components/actions.phtml modules/monitoring/application/views/scripts/show/components/actions.phtml
index 938ab2aff..4c5f8fb06 100644
--- modules/monitoring/application/views/scripts/show/components/actions.phtml
+++ modules/monitoring/application/views/scripts/show/components/actions.phtml
@@ -39,5 +39,6 @@ if ($navigation->isEmpty() || ! $navigation->hasRenderableItems()) {
 ?>
 <tr>
     <th><?= $this->translate('Actions'); ?></th>
+    <pre><?= htmlspecialchars(var_export($navigation, true), ENT_COMPAT | ENT_SUBSTITUTE | ENT_HTML5, 'UTF-8') ?></pre>
     <?= $navigation->getRenderer()->setElementTag('td')->setCssClass('actions go-ahead'); ?>
 </tr>

@Al2Klimov
Copy link
Member

What about C&P instead of screenshots?

@Al2Klimov
Copy link
Member

And this one?

diff --git modules/monitoring/application/views/scripts/show/components/actions.phtml modules/monitoring/application/views/scripts/show/components/actions.phtml
index 938ab2aff..6d2161c4d 100644
--- modules/monitoring/application/views/scripts/show/components/actions.phtml
+++ modules/monitoring/application/views/scripts/show/components/actions.phtml
@@ -39,5 +39,6 @@ if ($navigation->isEmpty() || ! $navigation->hasRenderableItems()) {
 ?>
 <tr>
     <th><?= $this->translate('Actions'); ?></th>
+    <pre><?= htmlspecialchars(var_export($object->getActionUrls(), true), ENT_COMPAT | ENT_SUBSTITUTE | ENT_HTML5, 'UTF-8') ?></pre>
     <?= $navigation->getRenderer()->setElementTag('td')->setCssClass('actions go-ahead'); ?>
 </tr>

@Arukadox
Copy link
Author

Arukadox commented Aug 6, 2020

Much better:

Problem handling

array (
)

But we still have this below:

#0 /usr/share/icingaweb2/modules/monitoring/library/Monitoring/Web/Navigation/Action.php(106): Icinga\Web\Url::fromPath(NULL)
#1 /usr/share/php/Icinga/Web/Navigation/Renderer/NavigationItemRenderer.php(186): Icinga\Module\Monitoring\Web\Navigation\Action->getUrl()
#2 /usr/share/php/Icinga/Web/Navigation/NavigationItem.php(901): Icinga\Web\Navigation\Renderer\NavigationItemRenderer->render(Object(Icinga\Module\Monitoring\Web\Navigation\ServiceAction))
#3 /usr/share/php/Icinga/Web/Navigation/Renderer/RecursiveNavigationRenderer.php(172): Icinga\Web\Navigation\NavigationItem->render()
#4 /usr/share/php/Icinga/Web/Navigation/Renderer/RecursiveNavigationRenderer.php(193): Icinga\Web\Navigation\Renderer\RecursiveNavigationRenderer->render()
#5 /usr/share/icingaweb2/modules/monitoring/application/views/scripts/show/components/actions.phtml(43): Icinga\Web\Navigation\Renderer\RecursiveNavigationRenderer->__toString()
#6 /usr/share/php/Icinga/Web/View.php(248): include(String)
#7 /usr/share/icingaweb2/library/vendor/Zend/View/Abstract.php(877): Icinga\Web\View->_run(String)
#8 /usr/share/icingaweb2/modules/monitoring/application/views/scripts/partials/object/detail-content.phtml(13): Zend_View_Abstract->render(NULL)
#9 /usr/share/php/Icinga/Web/View.php(248): include(String)
#10 /usr/share/icingaweb2/library/vendor/Zend/View/Abstract.php(877): Icinga\Web\View->_run(String)
#11 /usr/share/icingaweb2/modules/monitoring/application/views/scripts/service/show.phtml(8): Zend_View_Abstract->render(NULL)
#12 /usr/share/php/Icinga/Web/View.php(248): include(String)
#13 /usr/share/icingaweb2/library/vendor/Zend/View/Abstract.php(877): Icinga\Web\View->_run(String)
#14 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php(904): Zend_View_Abstract->render(NULL)
#15 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php(925): Zend_Controller_Action_Helper_ViewRenderer->renderScript(String, NULL)
#16 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php(964): Zend_Controller_Action_Helper_ViewRenderer->render()
#17 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/HelperBroker.php(272): Zend_Controller_Action_Helper_ViewRenderer->postDispatch()
#18 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action.php(518): Zend_Controller_Action_HelperBroker->notifyPostDispatch()
#19 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch(String)
#20 /usr/share/icingaweb2/library/vendor/Zend/Controller/Front.php(937): Icinga\Web\Controller\Dispatcher->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#21 /usr/share/php/Icinga/Application/Web.php(300): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#22 /usr/share/php/Icinga/Application/webrouter.php(99): Icinga\Application\Web->dispatch()
#23 /usr/share/icingaweb2/public/index.php(4): require_once(String)
#24 {main}

@Al2Klimov
Copy link
Member

Annotating #0's location shows @nilmerg – and I don't know how this shall actually work.

@nilmerg
Copy link
Member

nilmerg commented Aug 10, 2020

Caused by #3830

@nilmerg nilmerg added area/navigation Affects the navigation bug Something isn't working and removed needs-feedback We'll only proceed once we hear from you again labels Aug 10, 2020
@nilmerg nilmerg added this to the 2.9.0 milestone Aug 10, 2020
@nilmerg nilmerg changed the title Icinga\Exception\ProgrammingError in /usr/share/php/Icinga/Web/Url.php:168 with message: url "" is not a string Host/Service actions with only a label are not shown Aug 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/navigation Affects the navigation bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants