[ZBX-9365] "Create host" page gives error: array_combine(): Both parameters should have at least 1 element... Created: 2015 Mar 04 Updated: 2017 May 30 Resolved: 2015 Mar 23 |
|
| Status: | Closed |
| Project: | ZABBIX BUGS AND ISSUES |
| Component/s: | Frontend (F) |
| Affects Version/s: | 2.4.4 |
| Fix Version/s: | 2.2.10rc1, 2.4.5rc1, 2.5.0 |
| Type: | Incident report | Priority: | Critical |
| Reporter: | Taras Dyshkant | Assignee: | Unassigned |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | php, regression | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
CentOS release 6.6 (Final) with latest updates |
||
| Attachments: |
|
||||
| Issue Links: |
|
||||
| Description |
|
When I go to Configuration -> Hosts and click on "Create host" button I see this error at the bottom of the page: array_combine(): Both parameters should have at least 1 element [hosts.php:794 ? CView->render() ? include() ? array_combine() in /usr/share/zabbix/include/views/configuration.host.edit.php:201]}} |
| Comments |
| Comment by Oleksii Zagorskyi [ 2015 Mar 05 ] |
|
Of course it's not reproducible on 2.4.4. One strange thing is that your yum-info shows different zabbix versions installed simultaneously - 1.8, 2.0, 2.2, 2.4 The line #201 is 3rd in next code: // groups for normal hosts if (!$isDiscovered) { $hostGroups = array_combine($hostGroups, $hostGroups); $grp_tb = new CTweenBox($frmHost, 'groups', $hostGroups, 10); I suppose something is wrong (broken) in your database related to host groups. |
| Comment by Taras Dyshkant [ 2015 Mar 05 ] |
|
Correct installed packages list yum-list-installed-zabbix.txt |
| Comment by Taras Dyshkant [ 2015 Mar 05 ] |
|
I'm sorry I messed up that list yum-info-zabbix.txt |
| Comment by Oleksii Zagorskyi [ 2015 Mar 06 ] |
|
What is PHP version ? |
| Comment by Taras Dyshkant [ 2015 Mar 06 ] |
|
It Is a fresh installation.
# yum list installed php* ... php.x86_64 5.3.3-40.el6_6 @updates php-bcmath.x86_64 5.3.3-40.el6_6 @updates php-cli.x86_64 5.3.3-40.el6_6 @updates php-common.x86_64 5.3.3-40.el6_6 @updates php-gd.x86_64 5.3.3-40.el6_6 @updates php-mbstring.x86_64 5.3.3-40.el6_6 @updates php-mysql.x86_64 5.3.3-40.el6_6 @updates php-pdo.x86_64 5.3.3-40.el6_6 @updates php-xml.x86_64 5.3.3-40.el6_6 @updates Please let me know what I might did wrong or if you need some more information. |
| Comment by Oleksii Zagorskyi [ 2015 Mar 06 ] |
|
https://www.zabbix.com/documentation/2.4/manual/installation/requirements requires PHP 5.3.0 or later http://php.net/manual/en/function.array-combine.php says that:
Changelog ΒΆ
Version Description
5.4.0 Previous versions issued E_WARNING and returned FALSE for empty arrays.
PHP on my debian host is 5.6.5-2 and of course I don't see such error. The array-combine() function usage introduced in |
| Comment by Oleksii Zagorskyi [ 2015 Mar 06 ] |
|
Issue confirmed as it requires to be checked by devs. |
| Comment by Oleksii Zagorskyi [ 2015 Mar 06 ] |
|
Trivial -> Critical |
| Comment by Ivo Kurzemnieks [ 2015 Mar 09 ] |
|
(1) No translation string changes. oleg.egorov CLOSED |
| Comment by Ivo Kurzemnieks [ 2015 Mar 09 ] |
|
array_combine() exists since 2.0 (PHP 5.1.6) and is used only in one place, which seems to work and can't be broken.
|
| Comment by Oleg Egorov (Inactive) [ 2015 Mar 20 ] |
|
TESTED |
| Comment by Ivo Kurzemnieks [ 2015 Mar 20 ] |
|
Fixed in:
|
| Comment by Geoff Maciolek [ 2015 Jul 23 ] |
|
I very nearly opened a duplicate of this issue; 2.2.9 on CentOS 5, MySQL 5.0.95, PHP 5.3.3 (all w/OS patches). Just confirming I have this happen in 2.2.9; but for me this only happens on create Template, not on create Host. array_combine() [<a href='function.array-combine'>function.array-combine</a>]: Both parameters should have at least 1 element [templates.php:464 β CView->render() β include() β array_combine() in /var/www/html/include/views/configuration.template.edit.php:173] Is it safe for me to create a host or template? I'm concerned about database corruption etc. iivs Should be safe for 2.2.9, since it is just a frontend runtime warning, but 2.2.10 is relased and it's even safer there. |