ampache does not work on xenial/php7

Bug #1578201 reported by David Andersen
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
ampache (Ubuntu)
Fix Released
High
Unassigned
Xenial
Fix Released
High
Unassigned

Bug Description

[Impact]

 * Ampache does not allow logins on xenial with php7.

 * Upstream commit (https://github.com/ampache/ampache/commit/92fcb8467070733bc70e0e0dc6a6edd3bbb2a621) fixes it by renaming an internal class Error to AmpError, to not conflict with the PHP Error class.

[Test Case]

 * Attempt to login to the ampache page, it will error as a failure case.

[Regression Potential]

 * ampache as currently packaged in Xenial does not allow logins, so the chance for regression is low. This bugfix is identical to the one committed upstream for the same issue.

Ampache does not allow logins on xenial with php7. Here is the error using apache2

[Wed May 04 08:13:00.662067 2016] [:error] [pid 13376] [client xxx.xxx.xxx.xxx:52026] PHP Fatal error: Uncaught Error: Call to undefined method Error::display() in /usr/share/ampache/www/templates/show_login_form.inc.php:72\nStack trace:\n#0 /usr/share/ampache/www/login.php(170): require()\n#1 {main}\n thrown in /usr/share/ampache/www/templates/show_login_form.inc.php on line 72

This bug is fixed on ampache github - the xenial codebase should be updated to git.

Revision history for this message
David Andersen (k0rx) wrote :
Revision history for this message
David Andersen (k0rx) wrote :

Seems like it should be a simple fix. Anybody?

Jeremy Bícha (jbicha)
tags: added: php7
tags: added: patch
Revision history for this message
Nish Aravamudan (nacc) wrote :

Not a simple fix, because the upstream patch does not trivially apply to the Ubuntu source base. Will need some time to backport, I'll try post a PPA & debdiff tomorrow.

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

@David or anyone else affected,

Please test the versions of ampache available at: https://launchpad.net/~nacc/+archive/ubuntu/lp1578021.

For yakkety, 3.6-rzb2779+dfsg-0ubuntu11~ppa1

And for xenial: 3.6-rzb2779+dfsg-0ubuntu9.1

I have already attached the debdiffs. Thank you for bringing this issue to my attention!

-Nish

Revision history for this message
David Andersen (k0rx) wrote :

Works great. Thanks!

Nish Aravamudan (nacc)
description: updated
Mathew Hodson (mhodson)
Changed in ampache (Ubuntu):
importance: Undecided → High
Changed in ampache (Ubuntu Xenial):
importance: Undecided → High
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in ampache (Ubuntu Xenial):
status: New → Confirmed
Changed in ampache (Ubuntu):
status: New → Confirmed
Revision history for this message
Ole Wolf (ole.wolf) wrote :

The fix allows me to login but browsing the music catalog (whether browsing artists, song titles, or albums) reports "Not enough data."

However, the MySQL database is updated. Clicking, e.g., Random Album populates the playlist with a random album, and searching for artists returns valid results.

I'm not sure if this is related to this bug. (I've tried to delete the catalog and re-add it but this doesn't change anything.) There's nothing in the Apache error log.

Revision history for this message
Robie Basak (racb) wrote :

Uploaded to Yakkety and to the Xenial SRU queue. Thanks!

Changed in ampache (Ubuntu):
status: Confirmed → Fix Committed
Changed in ampache (Ubuntu Xenial):
status: Confirmed → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ampache - 3.6-rzb2779+dfsg-0ubuntu11

---------------
ampache (3.6-rzb2779+dfsg-0ubuntu11) yakkety; urgency=medium

  * debian/patches/04_rename_error_to_amperror.patch: Backport 'Rename
    Error class to AmpError (fix php7 Error class name conflict)'.
    Closes LP: #1578201.

 -- Nishanth Aravamudan <email address hidden> Fri, 24 Jun 2016 08:16:32 -0700

Changed in ampache (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello David, or anyone else affected,

Accepted ampache into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ampache/3.6-rzb2779+dfsg-0ubuntu9.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 ampache (Ubuntu Xenial):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Thomas Baudel (t-1) wrote :
Download full text (4.1 KiB)

I'm not sure I did the right thing to attempt to test the new package, but it did not work for me. Here is what I did:

$ sudo apt-get install ampache/xenial-proposed

... [skipping irrelevant blatter]

Selected version '3.6-rzb2779+dfsg-0ubuntu9.1' (Ubuntu:16.04/xenial-proposed [all]) for 'ampache'
Suggested packages:
  mysql-server eyed3 faad
The following packages will be upgraded:
  ampache
1 upgraded, 0 newly installed, 0 to remove and 39 not upgraded.
Need to get 23,4 kB of archives.
After this operation, 1 024 B of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu xenial-proposed/universe amd64 ampache all 3.6-rzb2779+dfsg-0ubuntu9.1 [23,4 kB]
Fetched 23,4 kB in 0s (327 kB/s)
Preconfiguring packages ...
(Reading database ... 297321 files and directories currently installed.)
Preparing to unpack .../ampache_3.6-rzb2779+dfsg-0ubuntu9.1_all.deb ...
Unpacking ampache (3.6-rzb2779+dfsg-0ubuntu9.1) over (3.6-rzb2779+dfsg-0ubuntu9) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up ampache (3.6-rzb2779+dfsg-0ubuntu9.1) ...
apache2_invoke ampache.conf: already enabled
apache2_invoke ampache: already enabled

Then, when I try running the ampache console, I can't login, and I get the following in the apache2/error.log:

[Sat Aug 06 22:38:41.792219 2016] [:error] [pid 18651] [client 2a01:e34:ec15:f600:426c:8fff:fe48:7723:59472] PHP Fatal error: Uncaught Error: Call to undefined method Error::display() in /usr/share/ampache/www/templates/show_login_form.inc.php:72\nStack trace:\n#0 /usr/share/ampache/www/login.php(170): require()\n#1 {main}\n thrown in /usr/share/ampache/www/templates/show_login_form.inc.php on line 72

Which is caused by the call to Error::display which should have been replaced by a call to AmError::display.

A check in the php folder confirms this:

t@thb-home:/var/log/apache2$ cd /usr/share/ampache/www/templates/
t@thb-home:/usr/share/ampache/www/templates$ grep Error::display *.php
error_page.inc.php: <?php Error::display('general'); ?>
show_account.inc.php:<?php Error::display('general'); ?>
show_account.inc.php: <?php Error::display('password'); ?>
show_add_access.inc.php:<?php Error::display('general'); ?>
show_add_access.inc.php: <?php Error::display('start'); ?>
show_add_access.inc.php: <?php Error::display('end'); ?>
show_add_catalog.inc.php:<?php Error::display('general'); ?>
show_add_live_stream.inc.php: <?php Error::display('name'); ?>
show_add_live_stream.inc.php: <?php Error::display('site_url'); ?>
show_add_live_stream.inc.php: <?php Error::display('url'); ?>
show_add_user.inc.php:<?php Error::display('general'); ?>
show_add_user.inc.php: <?php Error::display('username'); ?>
show_add_user.inc.php: <?php Error::display('password'); ?>
show_edit_access.inc.php: <?php Error::display('start'); ?>
show_edit_access.inc.php: <?php Error::display('end'); ?>
show_edit_user.inc.php:<?php Error::display('general'); ?>
show_edit_user.inc.php: <?php Error::display('username'); ?>
show_edit_user.inc.php: <?php Error::display('password'); ?>
show_install_account.inc.php: <?php Error::display('gener...

Read more...

Revision history for this message
Thomas Baudel (t-1) wrote :

Also, I note that I was using apache 3.8.0 with my previous ubuntu (15.10), while the latest version 3.8.1 available on the website of apache seems to fix the problem of php7 compatibility.

I'm torn between installing the new version from the developer's website and benefiting from automated releases via apt-get...

Revision history for this message
David Andersen (k0rx) wrote :

This works for me.
ampache 3.6-rzb2779+dfsg-0ubuntu9.1 from -proposed

David Andersen (k0rx)
tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ampache - 3.6-rzb2779+dfsg-0ubuntu9.1

---------------
ampache (3.6-rzb2779+dfsg-0ubuntu9.1) xenial; urgency=medium

  * debian/patches/04_rename_error_to_amperror.patch: Backport 'Rename
    Error class to AmpError (fix php7 Error class name conflict)'.
    Closes LP: #1578201.

 -- Nishanth Aravamudan <email address hidden> Fri, 24 Jun 2016 08:21:47 -0700

Changed in ampache (Ubuntu Xenial):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for ampache 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.

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.