PHP7-ubuntu sessionclean searches for "php5" named binary

Bug #1579480 reported by Amael
36
This bug affects 7 people
Affects Status Importance Assigned to Milestone
php-defaults (Ubuntu)
Expired
High
Unassigned

Bug Description

I just upgraded from ubuntu 15.10 to ubuntu 16.04 and my root mail is spammed by an error of php tool "sessionclean". This tool is still installed in /usr/lib/php5/sessionclean, and searches for the php binary under the name "php5".

The php-cli version installed is php7.0-cli, and the php-common ist still in php5-common. I have the php-common metapackage, shouldn't it have upgraded to a php7-common or something like that ?

I fixed the issue by manually editing "/usr/lib/php5/sessionclean" file and use "php" instead of "php5".

---------------------------------------------------------
Message 4401:
From root@****.*** Fri May 6 15:09:01 2016
X-Original-To: root
From: root@****.*** (Cron Daemon)
To: root@****.***
Subject: Cron <root@*****> [ -x /usr/lib/php5/sessionclean ] && /usr/lib/php5/sessionclean
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>
Date: Fri, 6 May 2016 15:09:01 +0200 (CEST)

/usr/lib/php5/sessionclean: 12: /usr/lib/php5/sessionclean: php5: not found

---------------------------------------------------------
phpinfo()
PHP Version => 7.0.4-7ubuntu2

System => Linux ***** 4.4.0-22-generic #39-Ubuntu SMP Thu May 5 16:53:32 UTC 2016 x86_64
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /etc/php/7.0/cli
Loaded Configuration File => /etc/php/7.0/cli/php.ini
Scan this dir for additional .ini files => /etc/php/7.0/cli/conf.d

---------------------------------------------------------

Amael (amael)
affects: php5 (Ubuntu) → php-defaults (Ubuntu)
Revision history for this message
Ondřej Surý (ondrej) wrote :

Did you fully uninstalled and purged php5* packages, e.g. doing `apt-get purge php5-common`.

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

According to http://packages.ubuntu.com/xenial/all/php-common/filelist php-defaults provides sessionclean in /usr/lib/php/sessionclean. Perhaps this is an upgrade related bug? What version of the php-common package do you have installed after the upgrade? And what does "dpkg -S /usr/lib/php5/sessionclean" say?

Changed in php-defaults (Ubuntu):
importance: Undecided → High
Revision history for this message
Amael (amael) wrote :

Hello, i did not install php7 myself so i did no manual uninstall neither.
Looks indeed like an upgrade problem.

I have indeed both sessionclean binaries, provided both by php-common package :

amael@amserv:~$ dpkg -S /usr/lib/php/sessionclean
php-common: /usr/lib/php/sessionclean

amael@amserv:~$ dpkg -S /usr/lib/php5/sessionclean
php5-common: /usr/lib/php5/sessionclean

amael@amserv:~$ ls -al /usr/lib/php5/sessionclean /usr/lib/php/sessionclean
-rwxr-xr-x 1 root root 1,5K mai 8 10:07 /usr/lib/php5/sessionclean*
-rwxr-xr-x 1 root root 2,9K mars 1 16:28 /usr/lib/php/sessionclean*
amael@amserv:~$

Revision history for this message
Amael (amael) wrote :

Please find below details of php-common installed version on my system :

amael@amserv:~$ dpkg -s php-common
Package: php-common
Status: install ok installed
Priority: optional
Section: php
Installed-Size: 60
Maintainer: Ubuntu Developers <email address hidden>
Architecture: all
Source: php-defaults (35ubuntu6)
Version: 1:35ubuntu6
Depends: psmisc (>= 22.15-1~), sed (>= 4.1.1-1)
Breaks: php-amqp (<< 1.7.0~alpha2-3~), php-apcu (<< 5.1.3+4.0.10-1~), php-apcu-bc (<< 1.0.3-2~), php-ast (<< 0.1.1-1~), php-geoip (<< 1.1.0-4~), php-gmagick (<< 2.0.1~rc3+1.1.7~rc3-2~), php-igbinary (<< 1.2.1-10-ge0e66b9+1.2.1-2~), php-imagick (<< 3.4.0~rc6-1~), php-memcache (<< 3.0.9~20151130.fdbd46b-2~), php-memcached (<< 2.2.0-51-ge573a6e+2.2.0-2build1), php-mongodb (<< 1.1.2-2~), php-msgpack (<< 2.0.0+0.5.7-2~), php-radius (<< 1.4.0~b1-0ubuntu1~), php-redis (<< 2.2.7-355-g799e0bc+2.2.7-4~), php-rrd (<< 2.0.0+1.1.3-3~), php-smbclient (<< 0.8.0~rc1-2~), php-ssh2 (<< 0.12-39-g3dfe336+0.12-1~), php-uploadprogress (<< 1.0.3.1-4-g95d8a0f-2~), php-uuid (<< 1.0.4-1~), php-xdebug (<< 2.4.0~rc4-1~), php-zmq (<< 1.1.3-2~), php5.6-common (<< 5.6.18+dfsg-10~), php5.6-json (<< 1.3.9-2~), php7.0-common (<< 7.0.3-11~)
Conffiles:
 /etc/cron.d/php 9a13f6612b6ee729da4fec9c2981d692
Description: Common files for PHP packages
 This package contains common utilities shared among all packaged PHP
 versions.
 .
 PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used
 open source general-purpose scripting language that is especially suited
 for web development and can be embedded into HTML.
Original-Maintainer: Debian PHP Maintainers <email address hidden>

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

I just tried an upgrade from Wily to Xenial. Using do-release-upgrade, php5-common was correctly removed as expected.

Please can you explain how you upgraded to Xenial? I think we need exact steps to reproduce to make any progress now. Please change the bug status back to New once you have this.

Changed in php-defaults (Ubuntu):
status: New → Incomplete
Revision history for this message
Amael (amael) wrote :

Hello, I upgraded with do-release-upgrade as well. My system is kind of old (June 26th of 2011) with different updates since (not all in a row, I skipped one or two).

I just checked what packages were flagged to "manually installed", this is probably the reason :
amael@amserv:~/Bureau/photos$ comm -23 <(apt-mark showmanual | sort -u) <(gzip -dc /var/log/installer/initial-status.gz | sed -n 's/^Package: //p' | sort -u) | grep php
php5-mysql
php-codesniffer
phpmyadmin
phpunit

And automatically installed :
amael@amserv:~/Bureau/photos$ comm -23 <(apt-mark showauto | sort -u) <(gzip -dc /var/log/installer/initial-status.gz | sed -n 's/^Package: //p' | sort -u) | grep php
libapache2-mod-php
libapache2-mod-php7.0
php7.0-cli
php7.0-common
php7.0-gd
php7.0-json
php7.0-mcrypt
php7.0-mysql
php7.0-opcache
php7.0-readline
php7.0-xml
php-cli
php-codecoverage
php-common
php-deepcopy
php-doctrine-instantiator
php-file-iterator
php-gd
php-gettext
php-invoker
php-mcrypt
php-mysql
php-pear
php-phpdocumentor-reflection-docblock
php-phpseclib
php-phpspec-prophecy
php-symfony-yaml
php-tcpdf
php-text-template
php-timer
php-token-stream
phpunit-code-unit-reverse-lookup
phpunit-comparator
phpunit-diff
phpunit-environment
phpunit-exporter
phpunit-global-state
phpunit-mock-object
phpunit-recursion-context
phpunit-resource-operations
phpunit-version
php-xml

Unflagging the php5-mysql as manually installed removes the php5-common package :
amael@amserv:~/Bureau/photos$ sudo aptitude markauto php5-mysql
Les paquets suivants seront ENLEVÉS :
  php5-common{u} php5-mysql{u}
0 paquets mis à jour, 0 nouvellement installés, 2 à enlever et 10 non mis à jour.
Il est nécessaire de télécharger 0 o d'archives. Après dépaquetage, 1 452 ko seront libérés.
Voulez-vous continuer ? [Y/n/?]
(Lecture de la base de données... 540556 fichiers et répertoires déjà installés.)
Suppression de php5-mysql (5.6.11+dfsg-1ubuntu3.2) ...
Suppression de php5-common (5.6.11+dfsg-1ubuntu3.2) ...

amael@amserv:~/Bureau/photos$

Changed in php-defaults (Ubuntu):
status: Incomplete → Invalid
Revision history for this message
Pascal Tempier (orogor) wrote :

Same symptoms that Amael

dpkg -S /usr/lib/php/sessionclean
php-common: /usr/lib/php/sessionclean

dpkg -S /usr/lib/php5/sessionclean
php5-common: /usr/lib/php5/sessionclean

ls -al /usr/lib/php5/sessionclean /usr/lib/php/sessionclean
-rwxr-xr-x 1 root root 1537 oct. 28 2015 /usr/lib/php5/sessionclean
-rwxr-xr-x 1 root root 2918 mars 1 2016 /usr/lib/php/sessionclean

apt-get remove php5-common
The following packages will be REMOVED:
  php5-adodb php5-common php5-gd php5-mysql

apt-get remove php-common
The following packages will be REMOVED:
  libapache2-mod-php libapache2-mod-php7.0 php-common php-gd php-gettext php-mcrypt php-mysql php-pear php-phpseclib php-xml php7.0-cli php7.0-common php7.0-gd php7.0-json php7.0-mcrypt php7.0-mysql php7.0-opcache php7.0-readline php7.0-xml phpmyadmin

ended up cleaning with :
apt-get remove php5-common
Removing php5-adodb (5.04-7ubuntu2) ...
Removing php5-gd (5.6.11+dfsg-1ubuntu3.1) ...
Removing php5-mysql (5.6.11+dfsg-1ubuntu3.1) ...
Removing php5-common (5.6.11+dfsg-1ubuntu3.1) ...

Changed in php-defaults (Ubuntu):
status: Invalid → Confirmed
Revision history for this message
Robie Basak (racb) wrote :

@martin suc

Please do not change the bug status without an explanation.

As I requested in comment 5, this bug still needs exact steps to reproduce in order to make any progress.

Changed in php-defaults (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Nish Aravamudan (nacc) wrote :

So I think I see a potential issue, based upon #c6.

In a trusty lxd, I did:

# apt install php5

The result of the 'manually installed packages' is:

# apt-mark showmanual | grep php
php5

Note that specifically, php5-common is not marked as manually installed. So I'm guessing, as Amael mentioned in #c6, that php5-mysql was installed after the fact, manually (as opposed to as a dependency resolution), and thus was kept over the release upgrade (I believe this is normal/expected, so things don't unexpectedly break). I wonder if Robie, during your test, you just installed php5 (as opposed to some php5- package like php5-mysql) before release upgrading?

I'm not sure what the right solution is here, as Amael noted, I would suggest, after completing the upgrade, to ensure all php5* packages are removed (apt remove php5*, I think, would do it -- without purging the configuration so you can migrate it).

I think the primary issue here, as well, is that php7.0-mysql doesn't really replace php5-mysql (as the extension was deprecated in php5 and removed in php7: https://wiki.php.net/rfc/mysql_deprecation), so perhaps for that specific package there is no transition path (and that is part of the migration to PHP7.0 generally).

no longer affects: debian
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for php-defaults (Ubuntu) because there has been no activity for 60 days.]

Changed in php-defaults (Ubuntu):
status: Incomplete → Expired
Revision history for this message
lszyba1 (szybalski) wrote :

For google searchers
solution here:
http://munin-monitoring.org/ticket/1364

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.