icingaweb2 2.1.0 can't find Zend library

Bug #1574250 reported by ManUnix
82
This bug affects 14 people
Affects Status Importance Assigned to Milestone
icingaweb2 (Ubuntu)
Fix Released
Undecided
Nish Aravamudan
Xenial
Fix Released
Undecided
Unassigned
zend-framework (Ubuntu)
Invalid
Undecided
Unassigned
Xenial
Fix Released
Undecided
Unassigned
Yakkety
Fix Released
Undecided
Unassigned
zendframework (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

[Impact]

* After running `apt install icingaweb2`, the icinga frontend does not successfully load.

* The root cause of this issue is two-fold: 1) icingaweb2 only ships a configuration for apache, but 16.04 defaults to php-fpm being used to satsify the php dependency. [16.10 does not have this issue.] 2) zend-framework installs to /usr/share/php/libzend-framework-php but the .ini file that accompanies ships with the required include_path change commented-out (due to an old bug now fixed in PHP5).

 * Note that the zesty fixes are rather different, as we have synced both icingaweb2 and zendframework (effectively, adding a delta to transition from the zend-framework binary packages) there.

[Test Case]

* Install icingaweb2 and attempt to navigate to http://<ip>/icingaweb2. A failing case will lead to the icinga login page not being displayed. A working case will display the login page.

* Test that a PHP script using the old path of /usr/share/php/libzend-framework-php continues to work after the update.

[Regression Potential]

* The icingaweb2 change is low in regression, as it only changes the dependencies for the package. If a user had installed php on 16.04 (and thus got php-fpm), there will be an additional package installed such that icingaweb2 now works -- this will be overhead if the user figured out how to configure fpm to host icingaweb2, but that would be outside the packaged conffiles.

* The zend-framework change is possibly higher risk, as it installs files into a new path (directly into /usr/share/php rather than /usr/share/php/libzend-framework-php). However, we also put in a symlink for the old path pointing at /usr/share/php, in case anyone is using the old path explicitly in their code, which seems like the likeliest regression source.

---

$ lsb_release -rd
Description: Ubuntu 16.04 LTS
Release: 16.04

$ apt-cache policy icingaweb2
icingaweb2:
  Installed: 2.1.0-1ubuntu1
  Candidate: 2.1.0-1ubuntu1
  Version table:
 *** 2.1.0-1ubuntu1 500
        500 http://us.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
        500 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 Packages
        100 /var/lib/dpkg/status

I've installed Ubuntu 16.04 from the latest ISO and did a "apt update && apt upgrade" to be certain I use the latest updates.
Then I've installed icingaweb2 via "sudo apt install icingaweb2":

What was still missing after that was mod-php (the issue was a white page when browsing http://<hostname>/icingaweb2/). Thus, to get it working I had to run "sudo apt install libapache2-mod-php".

With that the white page has been resolved but then I got the following error:

<b>Warning</b>: Uncaught ErrorException: require_once(Zend/Loader/Autoloader.php): failed to open stream: No such file or directory in /usr/share/php/Icinga/Application/ClassLoader.php:276
Stack trace:
#0 /usr/share/php/Icinga/Application/ClassLoader.php(276): Icinga\Application\ApplicationBootstrap->Icinga\Application\{closure}(2, 'require_once(Ze...', '/usr/share/php/...', 276, Array)
#1 /usr/share/php/Icinga/Application/ClassLoader.php(276): require_once()
#2 /usr/share/php/Icinga/Application/ClassLoader.php(294): Icinga\Application\ClassLoader->requireZendAutoloader()
#3 [internal function]: Icinga\Application\ClassLoader->loadClass('Zend_Controller...')
#4 /usr/share/php/Icinga/Web/Request.php(13): spl_autoload_call('Zend_Controller...')
#5 /usr/share/php/Icinga/Application/ClassLoader.php(301): require('/usr/share/php/...')
#6 [internal function]: Icinga\Application\ClassLoader->loadClass('Icinga\\Web\\Requ...')
#7 /usr/share/php/Icinga/Application/EmbeddedWeb.php(82): spl_autoload_call('Icinga\\Web\\Requ...')
#8 /usr/ in <b>/usr/share/php/Icinga/Application/ClassLoader.php</b> on line <b>276</b><br />
<br />
<b>Fatal error</b>: Icinga\Application\ClassLoader::requireZendAutoloader(): Failed opening required 'Zend/Loader/Autoloader.php' (include_path='/usr/share/icingaweb2/library/vendor:.:/usr/share/php') in <b>/usr/share/php/Icinga/Application/ClassLoader.php</b> on line <b>276</b><br />

The error is reproducible on all servers that I've tried so far (installed from scratch or updated from 14.04 LTS to 16.04 LTS).

When I manually add "/usr/share/php/libzend-framework-php" to the "include_path" I can get rid of the error but then I'm stuck with the error described in https://bugs.launchpad.net/ubuntu/+source/icingaweb2/+bug/1571402

Revision history for this message
ManUnix (manunix-deactivatedaccount) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in icingaweb2 (Ubuntu):
status: New → Confirmed
Revision history for this message
lars (laked) wrote :

Are any news? The Problem is still there since 2 Month...

Any solution?

Revision history for this message
H.-Dirk Schmitt (dirk-computer42) wrote :

As a workaround I'm using ppa:formorer/icinga
  "This PPA provides Icinga 1, Icinga 2 and Icinga web Packages for Ubuntu. They are directly derived from the Debian Packages that I maintain within Debian."

Revision history for this message
Kevjoe (kevjoe) wrote :

This will fix the problem: sudo mv /usr/share/php/libzend-framework-php/* /usr/share/php/Zend
Probably you could also do ln -s /usr/share/php/libzend-framework-php /usr/share/php/Zend

Both will likely solve the issue.

Revision history for this message
Unknown Ubuntu User (wy75sdchobrchywi4pj0-deactivatedaccount) wrote :

Moving a ton of files which the package manager put there for a reason is maybe not the best idea unless the goal is to create a bigger mess than we already have.

Revision history for this message
Kevjoe (kevjoe) wrote :

This should do the trick, without moving anything:
sudo ln -s /usr/share/php/libzend-framework-php/Zend /usr/share/php/Zend

Just tested it and it works for me.

Nish Aravamudan (nacc)
Changed in icingaweb2 (Ubuntu):
assignee: nobody → Nish Aravamudan (nacc)
Revision history for this message
Nish Aravamudan (nacc) wrote :

Hello and thank you for filing this bug! I apologize for not replying until now.

I believe the following steps are the most trivial steps to the two issues you found.

1) php-fpm is preferred over libapache2-mod-php by default.
 - This is why you didn't get a browser loaded by default.
 - If you had installed php first (and specified libapache2-mod-php as the satisfier at the time), you would have not seen this.
 - I think given that it doesn't seem like icingaweb2 is shipping a working FPM configuration, we should mark the dependency as specifically on libapache2-mod-php (in 16.04).
 - In the short term `apt install libapache2-mod-php` will fix this.
   * Note, though, that since zend-framework has already been installed at this point, possibly, the config has not been enabled for apache2, even though it is on for the cli. So after installing the package, run:
    + `phpenmod zend-framework`

2) zend-framework in Ubuntu (in Debian, this is called zendframework).
 - By default, we are not enabling the zend framework at install time. I do not know why this is the case, as it doesn't seem sensible (and violates the principle of least surprise).
 - In the short term, edit /etc/php/7.0/mods-available/zend-framework.ini to modify teh include_path to not be commented out.
  * Restart apache2.

This worked for me starting from a fresh Xenial container.

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

I am working on getting this fixed in Zesty, which is required before we fix it in Xenial & Yakkety properly. But there, I'm trying to work on LP: #1593024, which will let Ubuntu inherit the icingaweb2 directly from Debian going forward (requires dealing with a similar but differently maintained and named zend-framework package in Ubuntu).

Once I get some help getting that fixed up, I will upload a fix for Xenial. I will, in the meanwhile, provide a PPA with a test build.

Nish Aravamudan (nacc)
Changed in icingaweb2 (Ubuntu):
status: Confirmed → Fix Committed
Changed in zend-framework (Ubuntu):
status: New → Invalid
no longer affects: zendframework (Ubuntu Xenial)
no longer affects: zendframework (Ubuntu Yakkety)
Changed in zend-framework (Ubuntu Xenial):
status: New → Fix Committed
Nish Aravamudan (nacc)
Changed in zend-framework (Ubuntu Xenial):
status: Fix Committed → New
Changed in zendframework (Ubuntu):
status: New → Fix Committed
Revision history for this message
Nish Aravamudan (nacc) wrote :

Please consider testing the PPA packages at: https://launchpad.net/~nacc/+archive/ubuntu/zendframework, which I will work on uploading shortly. Given a base 16.04 image, and icingaweb2 installed, it initially does not work. Rather than making local modifications to 'fix' it, I:

sudo add-apt-repository ppa:nacc/zendframework
sudo apt update
sudo apt upgrade

and the resulting system correctly displays the login screen as expected.

Revision history for this message
Louis-Gabriel Thibault (louisgab) wrote :

Nish,

I was able to repro the problem, and test your fix on 16.04. Thanks for the good work!

Nish Aravamudan (nacc)
Changed in icingaweb2 (Ubuntu):
status: Fix Committed → Fix Released
Changed in zendframework (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Nish Aravamudan (nacc) wrote :

@lousigab: thanks for the quick response/testing! I'm uploading the fixes now for SRU.

description: updated
no longer affects: icingaweb2 (Ubuntu Yakkety)
description: updated
Changed in icingaweb2 (Ubuntu Xenial):
status: New → In Progress
Changed in zend-framework (Ubuntu Xenial):
status: New → In Progress
Changed in zend-framework (Ubuntu Yakkety):
status: New → In Progress
Revision history for this message
Robie Basak (racb) wrote : Please test proposed package

Hello ManUnix, or anyone else affected,

Accepted zend-framework into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/zend-framework/1.11.11-0ubuntu3.16.04.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 on 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 zend-framework (Ubuntu Xenial):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Robie Basak (racb) wrote :

Accepted, but is it possible to test that a php script using the old path continues to work after the update? If so, please do. I'll add the test case to the bug description.

description: updated
Revision history for this message
Brian Murray (brian-murray) wrote :

Hello ManUnix, or anyone else affected,

Accepted zend-framework into yakkety-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/zend-framework/1.11.11-0ubuntu3.16.10.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 on 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 zend-framework (Ubuntu Yakkety):
status: In Progress → Fix Committed
Revision history for this message
ManUnix (manunix-deactivatedaccount) wrote :

Thanks, I've tested the package zend-framework (1.11.11-0ubuntu3.16.04.1) from xenial-proposed on Ubuntu 16.04.1 and confirm that it fixes the bug.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Robie Basak (racb) wrote :

Hello ManUnix, or anyone else affected,

Accepted icingaweb2 into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/icingaweb2/2.1.0-1ubuntu1.2 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 on 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 icingaweb2 (Ubuntu Xenial):
status: In Progress → Fix Committed
tags: removed: verification-done
tags: added: verification-needed
Revision history for this message
Robie Basak (racb) wrote :

No need to verify zend-framework again. But verify the icingaweb2 fix please, and only mark verification-done when that is complete as well so that we do not get confused.

Revision history for this message
ManUnix (manunix-deactivatedaccount) wrote :

Thanks, I've tested the package icingaweb2 2.1.0-1ubuntu1.2 from xenial-proposed on Ubuntu 16.04.1 in combination with zend-framework 1.11.11-0ubuntu3.16.04.1 from xenial-proposed and confirm that it fixes the bug.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Brian Murray (brian-murray) wrote :

This zend-framework bug still needs verification for this SRU to be released.

https://bugs.launchpad.net/ubuntu/+source/zend-framework/+bug/1066406

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

This bug was fixed in the package zend-framework - 1.11.11-0ubuntu3.16.04.1

---------------
zend-framework (1.11.11-0ubuntu3.16.04.1) xenial; urgency=medium

  * d/Makefile, d/dirs, d/p/series: install Zend into /usr/share/php
    rather than /usr/share/php/libzend-framework-php.
    - Add an entry to the maintscript to install a symlink at
      /usr/share/php/libzend-framework-php, in case any end users are using the
      old path explicitly.
    - LP: #1574250, LP: #1066406

 -- Nishanth Aravamudan <email address hidden> Tue, 13 Dec 2016 10:10:59 -0800

Changed in zend-framework (Ubuntu Xenial):
status: Fix Committed → Fix Released
Revision history for this message
Chris Halse Rogers (raof) wrote : Update Released

The verification of the Stable Release Update for zend-framework 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 icingaweb2 - 2.1.0-1ubuntu1.2

---------------
icingaweb2 (2.1.0-1ubuntu1.2) xenial; urgency=medium

  * d/control: switch dependency from php to libapache2-mod-php
    (LP: #1574250).
    - 16.04's php package prefers php-fpm over libapache2-mod-php, but
      icingaweb2 only ships a configuration for apache.

 -- Nishanth Aravamudan <email address hidden> Fri, 09 Dec 2016 11:05:24 +0100

Changed in icingaweb2 (Ubuntu Xenial):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package zend-framework - 1.11.11-0ubuntu3.16.10.1

---------------
zend-framework (1.11.11-0ubuntu3.16.10.1) yakkety; urgency=medium

  * d/Makefile, d/dirs, d/p/series: install Zend into /usr/share/php
    rather than /usr/share/php/libzend-framework-php.
    - Add an entry to the maintscript to install a symlink at
      /usr/share/php/libzend-framework-php, in case any end users are using the
      old path explicitly.
    - LP: #1574250, LP: #1066406

 -- Nishanth Aravamudan <email address hidden> Tue, 13 Dec 2016 15:21:43 -0800

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

Other bug subscribers

Remote bug watches

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