[ZBX-14904] The undefined "hosts_problematic_count" and "hosts_total_count" indexes in Dashboard Created: 2018 Sep 25  Updated: 2018 Oct 31  Resolved: 2018 Oct 31

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 4.0.0rc1
Fix Version/s: 4.0.1rc2, 4.2.0alpha1, 4.2 (plan)

Type: Problem report Priority: Critical
Reporter: Oleg Ivanivskyi Assignee: Alexander Vladishev
Resolution: Fixed Votes: 0
Labels: dashboard, undefinedindex
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screen Shot 2018-09-25 at 14.42.36.png    
Issue Links:
Causes
caused by ZBX-12580 'Problem hosts' widget should load da... Closed
Team: Team B
Sprint: Sprint 43, Sprint 44, Sprint 45, Sprint 46, Nov 2018
Story Points: 0.125

 Description   

There are several undefined indexes in the Dashboard:

Argument 1 passed to CArrayHelper::sort() must be of the type array, null given, called in /usr/share/zabbix/app/controllers/CControllerWidgetProblemHostsView.php on line 217 and defined [zabbix.php:21 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerWidgetProblemHostsView->doAction() → CArrayHelper::sort() in include/classes/helpers/CArrayHelper.php:124]
uasort() expects parameter 1 to be array, null given [zabbix.php:21 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerWidgetProblemHostsView->doAction() → CArrayHelper::sort() → uasort() in include/classes/helpers/CArrayHelper.php:131]
Argument 1 passed to CArrayHelper::sort() must be of the type array, null given, called in /usr/share/zabbix/app/controllers/CControllerWidgetProblemHostsView.php on line 220 and defined [zabbix.php:21 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerWidgetProblemHostsView->doAction() → CArrayHelper::sort() in include/classes/helpers/CArrayHelper.php:124]
uasort() expects parameter 1 to be array, null given [zabbix.php:21 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerWidgetProblemHostsView->doAction() → CArrayHelper::sort() → uasort() in include/classes/helpers/CArrayHelper.php:131]
Undefined index: hosts_total_count [zabbix.php:21 → require_once() → ZBase->run() → ZBase->processRequest() → CView->getOutput() → include() in app/views/monitoring.widget.problemhosts.view.php:72]
Undefined index: hosts_problematic_count [zabbix.php:21 → require_once() → ZBase->run() → ZBase->processRequest() → CView->getOutput() → include() in app/views/monitoring.widget.problemhosts.view.php:72]
Undefined index: hosts_problematic_count [zabbix.php:21 → require_once() → ZBase->run() → ZBase->processRequest() → CView->getOutput() → include() in app/views/monitoring.widget.problemhosts.view.php:95]
Undefined index: hosts_problematic_count [zabbix.php:21 → require_once() → ZBase->run() → ZBase->processRequest() → CView->getOutput() → include() in app/views/monitoring.widget.problemhosts.view.php:106]
Undefined index: hosts_total_count [zabbix.php:21 → require_once() → ZBase->run() → ZBase->processRequest() → CView->getOutput() → include() in app/views/monitoring.widget.problemhosts.view.php:136]


 Comments   
Comment by Alexander Vladishev [ 2018 Sep 26 ]

Easy way to reproduce this issue:

  • create disabled host
  • add widget with filter by this host
Fatal error:  Uncaught TypeError: Argument 1 passed to CArrayHelper::sort() must be of the type array, null given, called in /app/controllers/CControllerWidgetProblemHostsView.php on line 217 and defined in include/classes/helpers/CArrayHelper.php:124
Stack trace:
#0 app/controllers/CControllerWidgetProblemHostsView.php(217): CArrayHelper::sort(NULL, Array)
#1 include/classes/mvc/CController.php(337): CControllerWidgetProblemHostsView->doAction()
#2 include/classes/core/ZBase.php(385): CController->run()
#3 include/classes/core/ZBase.php(155): ZBase->processRequest(Object(CRouter))
#4 include/config.inc.php(33): ZBase->run('default')
#5 zabbix.php(21): require_once('/home/sasha/zab...') in include/classes/helpers/CArrayHelper.php on line 124
Comment by Alexander Vladishev [ 2018 Sep 26 ]

Fixed in dev branch svn://svn.zabbix.com/branches/dev/ZBX-14904

Comment by Miks Kronkalns [ 2018 Oct 25 ]

Fixed in:

  • 4.0.1rc2 r86025
  • 4.2.0alpha1 (trunk) r86023, r86024
Generated at Fri Mar 29 17:47:34 EET 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.