phpquery always returns 0

Bug #1699659 reported by Jason Short on 2017-06-22
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
php-defaults (Debian)
Fix Released
Unknown
php-defaults (Ubuntu)
Undecided
Unassigned
Xenial
Undecided
Nish Aravamudan
Yakkety
Undecided
Unassigned
Zesty
Undecided
Unassigned
Artful
Undecided
Unassigned

Bug Description

[Impact]

 * various PHP postinst uses php-defaults' scripts for determing what actions to perform.
 * The phpquery script has an error that does not propogate state correctly.

[Test Case]

[Regression Potential]

 * This is pure bug-fix backport from version 44 (in yakkety and on) to xenial. The regression potential is very low; most likely people were seeing the issue as reported in this bug and manually, e.g., disabling modules again on every upgrade. This will actually avoid having to do that.

---

In the course of diagnosing an issue with a PHP module (xdebug in this case) kept re-enabling itself during upgrades of libapache2-mod-php7.0, I found the following:

1. libapache2-mod-php7.0 postscript sources /usr/lib/php/php-maintscript-helper from php-common to re-enable modules that have not been administratively disabled.

2. php-maintscript-helper calls phpenmod based on the output and return codes of phpquery

3. phpquery calls its own action() function, which initializes the $ret variable to 0

4. phpquery action() calls into various other functions in the script, and sets the $ret variable based on their returns

5. phpquery action() returns 0

6. php-maintscript-helper correspondingly calls phpenmod on all available php modules for the apache2 SAPI

Source link for xenial: https://git.launchpad.net/~usd-import-team/ubuntu/+source/php-defaults/tree/phpquery?h=ubuntu/xenial#n162

the following addition to action() after the esac is necessary to bubble up the internal functions' returns:

return $ret

Nish Aravamudan (nacc) on 2017-06-22
Changed in php-defaults (Ubuntu Yakkety):
status: New → Fix Released
Changed in php-defaults (Ubuntu Zesty):
status: New → Fix Released
Changed in php-defaults (Ubuntu Artful):
status: New → Fix Released
Nish Aravamudan (nacc) wrote :

Hello and thank you for filing this bug report! This was fixed in src:php-defaults 44, which is in Y and on. I will submit a SRU for this to X.

Changed in php-defaults (Ubuntu Xenial):
status: New → Triaged
assignee: nobody → Nish Aravamudan (nacc)
Changed in php-defaults (Debian):
status: Unknown → Fix Released
Nish Aravamudan (nacc) wrote :

I have uploaded a potential fixed php-defaults to https://launchpad.net/~nacc/+archive/ubuntu/lp1699659. Could you please test and respond back if it fixes the issue for you?

Changed in php-defaults (Ubuntu Xenial):
status: Triaged → In Progress
Jason Short (shortj) wrote :

confirmed:

Get:1 http://ppa.launchpad.net/nacc/lp1699659/ubuntu xenial/main amd64 php-common all 1:35ubuntu6.1~ppa1 [12.3 kB]
...

# phpquery -v 7.0 -s apache2 -m xdebug
No module matches xdebug (Disabled for apache2 by local administrator)

# echo $?
32

Nish Aravamudan (nacc) on 2017-06-22
description: updated
Robie Basak (racb) wrote :

Accepting, but please provide a public test case and mark verification-done-xenial only once that case is fixed by the proposed update.

Changed in php-defaults (Ubuntu Xenial):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-xenial

Hello Jason, or anyone else affected,

Accepted php-defaults into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/php-defaults/35ubuntu6.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-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. 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!

Jason Short (shortj) wrote :

Confirmed:

apt-get install php-common excerpt:

Get:1 http://security.ubuntu.com/ubuntu xenial-proposed/main amd64 php-common all 1:35ubuntu6.1 [10.8 kB]

/var/log/dpkg.log:

2017-07-25 15:22:52 status installed php-common:all 1:35ubuntu6.1

# apt-get install --reinstall php-xdebug
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 53 not upgraded.
Need to get 0 B/316 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 144094 files and directories currently installed.)
Preparing to unpack .../php-xdebug_2.4.0-1_amd64.deb ...
Unpacking php-xdebug (2.4.0-1) over (2.4.0-1) ...
Setting up php-xdebug (2.4.0-1) ...
WARNING: Not enabling the xdebug module for PHP 7.0 cli SAPI since the module
WARNING: was disabled by local administrator.
WARNING: Not enabling the xdebug module for PHP 7.0 apache2 SAPI since the module
WARNING: was disabled by local administrator.
php_invoke xdebug: no action - module was disabled by maintainer for PHP 7.0 cli SAPI

tags: added: verification-done-xenial
removed: verification-needed verification-needed-xenial
Jason Short (shortj) wrote :

racb, the requested tag has been set, what else do you need from me here?

Nish Aravamudan (nacc) wrote :

@shortj, packages in -proposed take 7 days to be tested before they are propogated. Thank you for updating the tags correctly, in a few more days, the SRU team should release the update.

Robie Basak (racb) wrote :

There is a big list of autopkgtest failures in http://people.canonical.com/~ubuntu-archive/pending-sru.html against php-defaults. Please could someone check to see if they are relevant to this update, or have always been failing, etc?

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

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