Mikesch-mp / icingaweb2-module-grafana

Grafana module for Icinga Web 2 (supports InfluxDB & Graphite)
https://icinga.com/community/
GNU General Public License v2.0
241 stars 94 forks source link

Error when trying to configure Grafana module #274

Closed jprusch closed 1 year ago

jprusch commented 3 years ago

After upgrading Icinga Web to 2.9.0 and PHP to 8.0.8 I cannot configure the Grafana module anymore.

The following stack trace is displayed when clicking on Configuration in module Grafana settings:

Uncaught ArgumentCountError: array_merge() does not accept unknown named parameters in /usr/share/icingaweb2/modules/grafana/library/Grafana/Helpers/Timeranges.php:168
Stack trace:
#0 [internal function]: array_merge()
#1 /usr/share/icingaweb2/modules/grafana/library/Grafana/Helpers/Timeranges.php(168): call_user_func_array()
#2 /usr/share/icingaweb2/modules/grafana/application/forms/Graph/GraphForm.php(112): Icinga\Module\Grafana\Helpers\Timeranges::getTimeranges()
#3 /usr/share/php/Icinga/Web/Form.php(776): Icinga\Module\Grafana\Forms\Graph\GraphForm->createElements()
#4 /usr/share/php/Icinga/Web/Form.php(1118): Icinga\Web\Form->create()
#5 /usr/share/icingaweb2/modules/grafana/application/forms/Graph/GraphForm.php(293): Icinga\Web\Form->populate()
#6 /usr/share/icingaweb2/modules/grafana/application/controllers/GraphController.php(105): Icinga\Module\Grafana\Forms\Graph\GraphForm->bind()
#7 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action.php(507): Icinga\Module\Grafana\Controllers\GraphController->updateAction()
#8 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch()
#9 /usr/share/icingaweb2/library/vendor/Zend/Controller/Front.php(937): Icinga\Web\Controller\Dispatcher->dispatch()
#10 /usr/share/php/Icinga/Application/Web.php(304): Zend_Controller_Front->dispatch()
#11 /usr/share/php/Icinga/Application/webrouter.php(107): Icinga\Application\Web->dispatch()
#12 /usr/share/icingaweb2/public/index.php(4): require_once('...')
#13 {main}
thrown

#0 [internal function]: Icinga\Application\Web->Icinga\Application\{closure}()
#1 {main}

Expected Behavior

Configuration dialog is display

Current Behavior

Stacktrace is displayed

Steps to Reproduce (for bugs)

  1. Upgrade to Icinga Web 2.9.0
  2. Upgrade to PHP 8

Your Environment

Mikesch-mp commented 3 years ago

I fixed this in master, just need someone to test it if it still works with php version 7.x first before i release it

jprusch commented 3 years ago

I can confirm that the fix works with PHP 8.0.8. I cannot test with PHP 7.

eifelmicha commented 3 years ago

I fixed this in master, just need someone to test it if it still works with php version 7.x first before i release it

Any particular PHP 7 Version? Could run a docker testbuild with PHP 7.4

Mikesch-mp commented 3 years ago

Any version 7 should do it

eifelmicha commented 3 years ago

Tested with:

Debian GNU/Linux 10 (buster)
PHP 7.4.21
Icingaweb 2.9.2

Configuration page + Graphs work fine.

IPB-DevOps commented 2 years ago

Worked with PHP 7.4 and 8.0.

This change should worked regardless of php version.

tjtoml commented 2 years ago

Getting this error with:

Rocky Linux 8.5
PHP 8.0.16
icingaweb2 2.9.5
Marci24h commented 2 years ago

Got the same issue on one nearly up to date system:

## debian 11 with php8.0
Icinga Web 2 Version 2.11.1
PHP Version 8.0.22
icinga/icinga-php-library       0.9.1
icinga/icinga-php-thirdparty    0.11.0
businessprocess     2.4.0
director        1.8.1
grafana         1.4.2
idoreports      0.10.0
incubator       0.18.0
migrate         2.11.1
monitoring      2.11.1
pdfexport       0.10.2
reporting       0.10.0
vspheredb       1.4.0
x509            1.1.2

after checking out the master branch (version: 1.4.3) the issue doesn't occur again

On an older System i don't faced this issue

## debian 10 with php7.3
Icinga Web 2 Version    2.11.1
PHP Version 7.3.31-1~deb10u1
icinga/icinga-php-library       0.9.1
icinga/icinga-php-thirdparty    0.11.0
director    1.8.1
doc     2.11.1
grafana     1.4.2
incubator   0.18.0
monitoring  2.11.1
phil-or commented 1 year ago

I also get the same error using php 8.0.20 and grafana module verison 1.4.2 : Uncaught ArgumentCountError: array_merge() does not accept unknown named parameters in /usr/share/icingaweb2/modules/grafana/library/Grafana/Helpers/Timeranges.php:137

Master branch works with php8. Is there a new release soon?

Mikesch-mp commented 1 year ago

Vrsion 2.0.0 will be fully support php 8.x