Version clash between icingadb-web and icingaweb2-module-grafana causes stacktrace
Abstract
A clash between very specific versions of icingadb-web and icingaweb2-module-grafana
causes a stacktrace within the grafana module and for no embedded graphs to be displayed.
Scenario
Customer is upgrading from Icinga IDO database to Icinga DB.
Customer needs legacy monitoring module to continue to work in production
until all icingadb-web issues can be fixed.
Due to monitoring being retained, customer was unable to upgrade further than PHP 7.2.
Due to PHP 7.2 being retained, icinga-web-grafana could not be upgraded to v2.0.3.
Due to monitoring being retained, icinga-web-grafana could not be upgraded to v2 since it does not support monitoring.
Fallback version for icinga-web-grafana is v1.4.2, known to be stable and work with
both monitoring and icingadb-web.
Versions
Package
Version
icinga2
v2.13.7
icingaweb2
v2.12.0
icingadb
v1.1.1
icingadb-web
v1.1.0 (broken) v1.0.2 (works)
icinga-module-grafana
v1.4.2
Steps to reproduce
Install system with all versions above, including icingadb-web v1.1.0.
Navigate to any icingadb-web page showing a Host or Service where a Grafana graph would normally appear.
Instead of the graph appearing, the following error is shown in bold:
ErrorException in /usr/share/icingaweb2/modules/grafana/library/Grafana/ProvidedHook/Grapher.php:298
with message: Object of class DateTime could not be converted to int
Workaround
Downgrade the icingadb-web to v1.0.2.
Refresh the browser and the graph appears.
Full stacktrace
Oct 27 12:56:31 othrpeq0003 icingaweb[511076]: Failed to load legacy grapher: ErrorException in /usr/share/icingaweb2/modules/grafana/library/Grafana/ProvidedHook/Grapher.php:298
with message: Object of class DateTime could not be converted to int
#0 /usr/share/icingaweb2/modules/grafana/library/Grafana/ProvidedHook/Grapher.php(298): Icinga\Application\ApplicationBootstrap->Icinga\Application\{closure}(8, 'Object of class...', '/usr/share/icin...', 298, Array)
#1 /usr/share/icingaweb2/modules/icingadb/library/Icingadb/Widget/Detail/ObjectDetail.php(468): Icinga\Module\Grafana\ProvidedHook\Grapher->getPreviewHtml(Object(Icinga\Module\Icingadb\Compat\CompatService))
#2 /usr/share/icingaweb2/modules/icingadb/library/Icingadb/Widget/Detail/ServiceDetail.php(35): Icinga\Module\Icingadb\Widget\Detail\ObjectDetail->createExtensions()
#3 /usr/share/icinga-php/ipl/vendor/ipl/html/src/HtmlDocument.php(344): Icinga\Module\Icingadb\Widget\Detail\ServiceDetail->assemble()
#4 /usr/share/icinga-php/ipl/vendor/ipl/html/src/HtmlDocument.php(566): ipl\Html\HtmlDocument->ensureAssembled()
#5 /usr/share/icinga-php/ipl/vendor/ipl/html/src/HtmlDocument.php(390): ipl\Html\HtmlDocument->render()
#6 /usr/share/icinga-php/ipl/vendor/ipl/html/src/BaseHtmlElement.php(297): ipl\Html\HtmlDocument->renderUnwrapped()
#7 /usr/share/icinga-php/ipl/vendor/ipl/html/src/BaseHtmlElement.php(365): ipl\Html\BaseHtmlElement->renderContent()
#8 /usr/share/icinga-php/ipl/vendor/ipl/html/src/HtmlDocument.php(568): ipl\Html\BaseHtmlElement->renderUnwrapped()
#9 /usr/share/icinga-php/ipl/vendor/ipl/html/src/HtmlDocument.php(390): ipl\Html\HtmlDocument->render()
#10 /usr/share/icinga-php/ipl/vendor/ipl/html/src/HtmlDocument.php(568): ipl\Html\HtmlDocument->renderUnwrapped()
#11 /usr/share/icinga-php/ipl/vendor/ipl/web/src/Compat/ViewRenderer.php(56): ipl\Html\HtmlDocument->render()
#12 /usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/Controller/Action/Helper/ViewRenderer.php(970): ipl\Web\Compat\ViewRenderer->render()
#13 /usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/Controller/Action/HelperBroker.php(277): Zend_Controller_Action_Helper_ViewRenderer->postDispatch()
#14 /usr/share/icingaweb2/modules/icingadb/library/Icingadb/Web/Controller.php(480): Zend_Controller_Action_HelperBroker->notifyPostDispatch()
#15 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Icinga\Module\Icingadb\Web\Controller->dispatch('indexAction')
#16 /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))
#17 /usr/share/php/Icinga/Application/Web.php(294): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#18 /usr/share/php/Icinga/Application/webrouter.php(105): Icinga\Application\Web->dispatch()
#19 /usr/share/icingaweb2/public/index.php(4): require_once('/usr/share/php/...')
#20 {main}
Description
Version clash between
icingadb-web
andicingaweb2-module-grafana
causes stacktraceAbstract
A clash between very specific versions of
icingadb-web
andicingaweb2-module-grafana
causes a stacktrace within the grafana module and for no embedded graphs to be displayed.Scenario
monitoring
module to continue to work in production until allicingadb-web
issues can be fixed.monitoring
being retained, customer was unable to upgrade further than PHP 7.2.icinga-web-grafana
could not be upgraded to v2.0.3.monitoring
being retained,icinga-web-grafana
could not be upgraded to v2 since it does not supportmonitoring
.icinga-web-grafana
is v1.4.2, known to be stable and work with bothmonitoring
andicingadb-web
.Versions
icinga2
v2.13.7
icingaweb2
v2.12.0
icingadb
v1.1.1
icingadb-web
v1.1.0
(broken)v1.0.2
(works)icinga-module-grafana
v1.4.2
Steps to reproduce
icingadb-web
v1.1.0.Instead of the graph appearing, the following error is shown in bold:
ErrorException in /usr/share/icingaweb2/modules/grafana/library/Grafana/ProvidedHook/Grapher.php:298 with message: Object of class DateTime could not be converted to int
Workaround
icingadb-web
to v1.0.2.Full stacktrace
Other environmental context
Additional context
This bug is being cross-posted on: