[ZBX-24683] problem.view PHP Fatal error: Uncaught TypeError: count() Created: 2024 Jun 19 Updated: 2024 Aug 01 Resolved: 2024 Jul 30 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | API (A) |
Affects Version/s: | 7.0.0 |
Fix Version/s: | 7.0.2rc2, 7.2.0alpha1 |
Type: | Problem report | Priority: | Critical |
Reporter: | Damian Vermeulen | Assignee: | Alexander Vladishev |
Resolution: | Fixed | Votes: | 7 |
Labels: | None | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | 1h | ||
Original Estimate: | Not Specified | ||
Environment: |
Ubuntu 22 |
Attachments: |
![]() ![]() ![]() |
||||||||||||||||
Issue Links: |
|
||||||||||||||||
Team: | |||||||||||||||||
Sprint: | S24-W30/31 | ||||||||||||||||
Story Points: | 0.25 |
Description |
Steps to reproduce:
Result: Observations: CScreenProblem.php |
Comments |
Comment by Yury Larin [ 2024 Jun 20 ] |
I also have this issue. $problems is Array, but count() thinks it is bool. I change the line 286 to: $end_of_data = (count((array)$problems) < $limit + 1); And it fixes issue. But it is possible the is another root of the problem... However, I have error in the top on this page: Invalid parameter "/eventid_till": a timestamp is too large.
Debian 12 php8.2 nginx mariadb 10.11 |
Comment by Alexey [ 2024 Jul 01 ] |
same problems debian 12 arm64 |
Comment by Andrey [ 2024 Jul 04 ] |
The same problem after upgrading zabbix instances from version 5.4 and 6.0 to 7.0, while those updated from version 6.4 do not have the same problem |
Comment by Geoffrey Timmerman [ 2024 Jul 16 ] |
Same here after upgrade from 6.0 to 7.0 and also fixed it in the same way as mentioned by Hawk128. I wished I had found this earlier, it would have saved me some time
For people bumping into this; in detail you need to edit “/usr/share/zabbix/include/classes/screens/CScreenProblem.php" and change line 286 from: $end_of_data = (count($problems) < $limit + 1); To this: $end_of_data = (count((array)$problems) < $limit + 1);
The problem widget will then load but as mentioned you are still left with the error message "Invalid parameter "/eventid_till": a timestamp is too large.".
|
Comment by Geoffrey Timmerman [ 2024 Jul 18 ] |
We have just encountered another issue in one of our instances which is probably depending on this same issue reported here. We are unable to load alert instructions which normally popup when you hover over "duration". Also when clicking the timestamp next to a trigger, a blank page appears where normally you would see the trigger details. The Apache error log shows a bunch of errors like: [Thu Jul 18 09:57:33.508581 2024] [php:error] [pid 1312743] [client 10.73.95.90:50966] PHP Fatal error: Uncaught TypeError: CArrayHelper::sort(): Argument #1 ($array) must be of type array, bool given, called in /usr/share/zabbix/app/controllers/CControllerHintboxEventlist.php on line 127 and defined in /usr/share/zabbix/include/classes/helpers/CArrayHelper.php:160\nStack trace:\n#0 /usr/share/zabbix/app/controllers/CControllerHintboxEventlist.php(127): CArrayHelper::sort()\n#1 /usr/share/zabbix/include/classes/mvc/CController.php(473): CControllerHintboxEventlist->doAction()\n#2 /usr/share/zabbix/include/classes/core/ZBase.php(642): CController->run()\n#3 /usr/share/zabbix/include/classes/core/ZBase.php(228): ZBase->processRequest()\n#4 /usr/share/zabbix/include/config.inc.php(20): ZBase->run()\n#5 /usr/share/zabbix/zabbix.php(17): require_once('...')\n#6 {main}\n thrown in /usr/share/zabbix/include/classes/helpers/CArrayHelper.php on line 160 [Thu Jul 18 09:57:35.247622 2024] [php:error] [pid 1315986] [client 10.73.95.90:50969] PHP Fatal error: Uncaught TypeError: CArrayHelper::sort(): Argument #1 ($array) must be of type array, bool given, called in /usr/share/zabbix/app/controllers/CControllerHintboxEventlist.php on line 127 and defined in /usr/share/zabbix/include/classes/helpers/CArrayHelper.php:160\nStack trace:\n#0 /usr/share/zabbix/app/controllers/CControllerHintboxEventlist.php(127): CArrayHelper::sort()\n#1 /usr/share/zabbix/include/classes/mvc/CController.php(473): CControllerHintboxEventlist->doAction()\n#2 /usr/share/zabbix/include/classes/core/ZBase.php(642): CController->run()\n#3 /usr/share/zabbix/include/classes/core/ZBase.php(228): ZBase->processRequest()\n#4 /usr/share/zabbix/include/config.inc.php(20): ZBase->run()\n#5 /usr/share/zabbix/zabbix.php(17): require_once('...')\n#6 {main}\n thrown in /usr/share/zabbix/include/classes/helpers/CArrayHelper.php on line 160 [Thu Jul 18 09:53:27.311347 2024] [php:warn] [pid 1311462] [client 10.73.95.90:50605] PHP Warning: foreach() argument must be of type array|object, bool given in /usr/share/zabbix/include/events.inc.php on line 360 [Thu Jul 18 09:53:27.311399 2024] [php:warn] [pid 1311462] [client 10.73.95.90:50605] PHP Warning: foreach() argument must be of type array|object, bool given in /usr/share/zabbix/include/events.inc.php on line 376 [Thu Jul 18 09:53:27.311493 2024] [php:error] [pid 1311462] [client 10.73.95.90:50605] PHP Fatal error: Uncaught TypeError: getEventsActionsIconsData(): Argument #1 ($events) must be of type array, bool given, called in /usr/share/zabbix/include/events.inc.php on line 394 and defined in /usr/share/zabbix/include/actions.inc.php:1087\nStack trace:\n#0 /usr/share/zabbix/include/events.inc.php(394): getEventsActionsIconsData()\n#1 /usr/share/zabbix/tr_events.php(175): make_small_eventlist()\n#2 {main}\n thrown in /usr/share/zabbix/include/actions.inc.php on line 1087 [Thu Jul 18 09:53:27.311912 2024] [php:warn] [pid 1311462] [client 10.73.95.90:50605] PHP Warning: Undefined array key "file" in /usr/share/zabbix/include/classes/debug/CProfiler.php on line 376 [Thu Jul 18 09:53:27.311934 2024] [php:warn] [pid 1311462] [client 10.73.95.90:50605] PHP Warning: Undefined array key "line" in /usr/share/zabbix/include/classes/debug/CProfiler.php on line 376 [Thu Jul 18 09:53:27.311969 2024] [php:warn] [pid 1311462] [client 10.73.95.90:50605] PHP Warning: Cannot modify header information - headers already sent in /usr/share/zabbix/include/classes/helpers/CCookieHelper.php on line 54 [Thu Jul 18 09:53:27.311993 2024] [php:warn] [pid 1311462] [client 10.73.95.90:50605] PHP Warning: Unknown: Failed to write session data using user defined save handler. (session.save_path: /var/lib/php/sessions) in Unknown on line 0 I have tried patching it but doesn't work as new errors come up. Most probably the root case is located in one or more database records since it is down to a timestamp being too large? Any suggestions on how to resolve this? |
Comment by Alexey [ 2024 Jul 23 ] |
an update came out - but the problem was not fixed, moreover, the file was overwritten with a new one and it stopped working again. need to edit again |
Comment by Geoffrey Timmerman [ 2024 Jul 24 ] |
We have rolled back to the 6.0 snapshot we took before upgrade as our production environment needs to be secured. We will retry to upgrade again once we are sure the issue is resolved. |
Comment by Alexey [ 2024 Jul 24 ] |
in DashBoard the panel with intervals of problems does not open here, I think this is related. |
Comment by Geoffrey Timmerman [ 2024 Jul 24 ] |
Hi silencess Check the Apache error log for Zabbix (on Debian based systems this is located in "/var/log/apache2/zabbix-error.log") to see what the error is about exactly. But we also encountered this issue with the duration (I've described this in a previous post above). Also clicking the timestamp on the left of the trigger shows a blank page instead of the trigger details. |
Comment by Alexander Vladishev [ 2024 Jul 26 ] |
Available in versions:
|
Comment by Alexey [ 2024 Aug 01 ] |
in 7.0.2 version - fixed |