PHP Fatal error in zabbix-frontend-php

Bug #1571534 reported by Vitaliy Skibinskiy
28
This bug affects 3 people
Affects Status Importance Assigned to Milestone
zabbix (Ubuntu)
Fix Released
Low
Unassigned
Xenial
Fix Released
Low
Unassigned

Bug Description

[Impact]

 * zabbix PHP fronted fails to load after installation (zabbix-frontend-php) due to fatal errors with loading mbstring (and then others follow if that is fixed manually).

[Test Case]

`apt-get install zabbix-server-mysql zabbix-frontend-php`

Then follow

/usr/share/doc/zabbix-server-mysql/README.Debian

to populate the database.

Then follow

/usr/share/doc/zabbix-frontend-php/README.Debian

to configure the fronted. This document specifically mentions needing to install an appropriate DB driver (e.g., php-mysql to use MySQL).

Attempt to proceed through all the screens at http://<ip of container>/zabbix/setup.php, which will throw PHP errors if not fixed.

[Regression Potential]

 * The version of the web frontend for zabbix in 16.04 does not currently work at all. This update backports an upstream fix for a ini-variable removal, and then updates the packaging to properly list dependencies. The risk of regression is very low from these changes.

16.04 after php5->php7.0 I have blank page in frontend and php fatal error in apache2/error.log:

PHP Fatal error: Uncaught Error: Call to undefined function mb_strlen() in /usr/share/zabbix/include/classes/user/CProfile.php:330\nStack trace:\n#0 /usr/share/zabbix/include/classes/user/CProfile.php(214): CProfile::checkValueType('index.php', 3)\n#1 /usr/share/zabbix/include/menu.inc.php(351): CProfile::update('web.menu.login....', 'index.php', 3)\n#2 /usr/share/zabbix/include/page_header.php(123): zbx_construct_menu(Array, Array, Array)\n#3 /usr/share/zabbix/include/views/general.login.php(30): require_once('/usr/share/zabb...')\n#4 /usr/share/zabbix/include/classes/core/CView.php(111): include('/usr/share/zabb...')\n#5 /usr/share/zabbix/index.php(117): CView->render()\n#6 {main}\n thrown in /usr/share/zabbix/include/classes/user/CProfile.php on line 330

Revision history for this message
Vitaliy Skibinskiy (vit-u) wrote :

Sorry, I hasn't correct php.ini
It can be removed.

Revision history for this message
Nick (kg6nmp) wrote :

What did you do to correct this? I have the same error.

Also I upgraded from 15.04 to 16.10, and I first got a PHP7 MySQL error because php7.0-mysql was not installed. Once I manually installed that I am now getting the error you posted above.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in zabbix (Ubuntu):
status: New → Confirmed
Revision history for this message
Vitaliy Skibinskiy (vit-u) wrote :

Nick, go to http://your_zabbix_url/setup.php - Check of pre-requisites

Revision history for this message
Keith LEE (a2940uw) wrote :

I have the same issue on this and also fresh install the 16.04, after try to install Zabbix 3 in Zabbix repo, get zabbix-frontend with error during apt-get install and unable to continue, problem is most likely is PHP7 + Zabbix-Frontend

Revision history for this message
Kalle Tuulos (kalle-tuulos) wrote :

I came to comment here, as I reported the same bug and it was marked as duplicate, which it was.

Anyway, only after reporting the bug I noticed, that Zabbix itself tells, that it is not compatible with PHP7. Thus the whole Zabbix package should be withdrawn from Ubuntu 16.04 until it supports PHP7 or alternatively, Ubuntu 16.04 should support an official method to stay in PHP5.

Reference:
https://www.zabbix.com/documentation/3.0/manual/installation/requirements
"PHP 5.4.0 or later PHP v7 is not supported yet."

Revision history for this message
Nish Aravamudan (nacc) wrote :

To resolve the original issue (which is a real bug, thank you for filing it), please install the 'php-mbstring' package.

Changed in zabbix (Ubuntu):
status: Confirmed → Triaged
importance: Undecided → Low
Revision history for this message
Nish Aravamudan (nacc) wrote :

This is I believe fixed in the Yakkety (16.10) package, which is synced from Debian. I am working on backporting some fixes from that version, which allow for 2.4.7 (in my testing) to bring up the web frontend with PHP7. I will update this bug shortly with more information.

Changed in zabbix (Ubuntu):
status: Triaged → Fix Released
Logan Rosen (logan)
tags: added: php7
Nish Aravamudan (nacc)
Changed in zabbix (Ubuntu):
assignee: nobody → Nish Aravamudan (nacc)
Revision history for this message
Nish Aravamudan (nacc) wrote :

I have pushed a test build to: https://launchpad.net/~nacc/+archive/ubuntu/zabbix.

Please test the version there (2.4.7+dfsg-2ubuntu3~ppa1), if you are affected. This should install the correct dependencies and avoid the issue in bug 1572841 for the web frontend.

Revision history for this message
Nish Aravamudan (nacc) wrote :

Using the afore-mentioned PPA in a 16.04 LXD container, I did:

`apt-get install zabbix-server-mysql zabbix-frontend-php`

I then followed

/usr/share/doc/zabbix-server-mysql/README.Debian

to populate the database.

I then followed

/usr/share/doc/zabbix-frontend-php/README.Debian

to configure the fronted. This document specifically mentions needing to install php-mysql to use MySQL, so I did that as well.

I was able to proceed through all the screens at http://<ip of container>/zabbix/setup.php until the last, which threw an error about creating the configuration file. I downloaded the provided instead and saved its contents to /etc/zabbix/zabbix.conf.php and the install was able to conclude.

I was able to login and see the dashboard. I have little knowledge of zabbix itself, but this much does work. I will investigate the LTS upgrade path next.

Revision history for this message
Nish Aravamudan (nacc) wrote :
description: updated
Changed in zabbix (Ubuntu):
assignee: Nish Aravamudan (nacc) → nobody
Changed in zabbix (Ubuntu Xenial):
status: New → In Progress
Mathew Hodson (mhodson)
tags: added: packaging
Changed in zabbix (Ubuntu Xenial):
importance: Undecided → Low
Revision history for this message
Robie Basak (racb) wrote :

This looks good, but needs SRU information for the fix for bug 1572841 please. The SRU team will reject the upload without this, so I'll wait before uploading.

Minor: the changelog formatting looks a little off (missing bracket, extra comma).

Mathew Hodson (mhodson)
tags: added: patch
Revision history for this message
McHno (chaocrator) wrote :

encountered this bug while upgrading my zabbix server from 14.04 to 16.04 (using zabbix packages fom zabbix repo).
fixed by installing php-mbstring & php7.0-mbstring.
so, this may be just a misconfigured dependencies issue, i suspect.

Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Hello Vitaliy, or anyone else affected,

Accepted zabbix into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/zabbix/1:2.4.7+dfsg-2ubuntu2.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in zabbix (Ubuntu Xenial):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Nish Aravamudan (nacc) wrote :

Verified on 2.4.7+dfsg-2ubuntu2.1

tags: added: verification-done
removed: verification-needed
Revision history for this message
Chris J Arges (arges) wrote : Update Released

The verification of the Stable Release Update for zabbix has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package zabbix - 1:2.4.7+dfsg-2ubuntu2.1

---------------
zabbix (1:2.4.7+dfsg-2ubuntu2.1) xenial; urgency=medium

  * d/control: add dependencies on split-out PHP7 packages (bcmath,
    mbstring, xml) needed by web frontend (LP: #1571534, .
  * debian/patches/always_populate_raw_post_data_not_in_php7.patch:
    Backport '[ZBX-9659] changed setup condition for checking
    always_populate_raw_post_data'. Closes LP: #1572841.

 -- Nishanth Aravamudan <email address hidden> Mon, 27 Jun 2016 17:03:29 -0700

Changed in zabbix (Ubuntu Xenial):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.