mysql upgrade fails when service is disabled

Bug #1574017 reported by John Wright
26
This bug affects 5 people
Affects Status Importance Assigned to Milestone
mysql-5.7 (Ubuntu)
Confirmed
High
Unassigned

Bug Description

package mysql-server-5.7 5.7.11-0ubuntu6 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1

ProblemType: Package
DistroRelease: Ubuntu 16.04
Package: mysql-server-5.7 5.7.11-0ubuntu6
ProcVersionSignature: Ubuntu 4.4.0-21.37-generic 4.4.6
Uname: Linux 4.4.0-21-generic x86_64
ApportVersion: 2.20.1-0ubuntu2
Architecture: amd64
Date: Sat Apr 23 14:06:37 2016
DistributionChannelDescriptor:
 # This is a distribution channel descriptor
 # For more information see http://wiki.ubuntu.com/DistributionChannelDescriptor
 canonical-oem-somerville-precise-amd64-20130203-1
ErrorMessage: subprocess installed post-installation script returned error exit status 1
InstallationDate: Installed on 2014-08-21 (611 days ago)
InstallationMedia: Ubuntu 12.04 "Precise" - Build amd64 LIVE Binary 20130203-13:50
Logs.var.log.daemon.log:

MySQLConf.etc.mysql.conf.d.mysql.cnf: [mysql]
MySQLConf.etc.mysql.conf.d.mysqld_safe_syslog.cnf:
 [mysqld_safe]
 syslog
MySQLConf.etc.mysql.conf.d.mysqldump.cnf:
 [mysqldump]
 quick
 quote-names
 max_allowed_packet = 16M
MySQLConf.etc.mysql.mysql.conf.d.mysqld_safe_syslog.cnf:
 [mysqld_safe]
 syslog
MySQLVarLibDirListing: ['debian-5.7.flag', 'ib_buffer_pool', 'wordpress', 'mysql', 'performance_schema', 'ib_logfile0', 'ibtmp1', 'mysql_upgrade_info', 'ibdata1', 'auto.cnf', 'debian-5.5.flag', 'ib_logfile1']
ProcCmdline: BOOT_IMAGE=/boot/vmlinuz-4.4.0-21-generic root=UUID=b7bc1425-63ac-45e5-be3a-ff56102aabc8 ro quiet splash vt.handoff=7
RelatedPackageVersions:
 dpkg 1.18.4ubuntu1
 apt 1.2.10ubuntu1
SourcePackage: mysql-5.7
Title: package mysql-server-5.7 5.7.11-0ubuntu6 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1
UpgradeStatus: Upgraded to xenial on 2016-04-23 (0 days ago)

Revision history for this message
John Wright (johngeorge-wright) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in mysql-5.7 (Ubuntu):
status: New → Confirmed
Revision history for this message
Robie Basak (racb) wrote :

From log:

Setting up mysql-server-5.7 (5.7.11-0ubuntu6) ...
Installing new version of config file /etc/apparmor.d/usr.sbin.mysqld ...
Installing new version of config file /etc/init.d/mysql ...
Installing new version of config file /etc/init/mysql.conf ...
Installing new version of config file /etc/logrotate.d/mysql-server ...
Installing new version of config file /etc/mysql/debian-start ...
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
insserv: warning: script 'orientdb' missing LSB tags and overrides
insserv: script virtualbox: service vboxdrv already provided!
insserv: script virtualbox: service virtualbox already provided!
insserv: warning: script 'screen-cleanup' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `screen-cleanup'
insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `screen-cleanup'
mysql_upgrade: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) while connecting to the MySQL server
Upgrade process encountered error and will not continue.
mysql_upgrade failed with exit status 11
dpkg: error processing package mysql-server-5.7 (--configure):
 subprocess installed post-installation script returned error exit status 1

Revision history for this message
David Girault (dfgweb) wrote :

Hi all. I'm on Yakketty but still have this error 11 in mysql_upgrade.
According to /etc/mysql/debian-start, I've got the latest version with patch from bug #1577712.

So this bug is not related to bug #1577712 and dupplicate should be remove.

After some tweak of mysql-server-5.7.postinst script, I saw that `invoke start` does nothing and dont start the daemon. An added 'invoke status' before the 'mysql_upgrade' call return:

invoke status
● mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
invoke-rc.d: initscript mysql, action "status" failed.
mysql_upgrade: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) while connecting to the MySQL server
Upgrade process encountered error and will not continue.
mysql_upgrade failed with exit status 11
dpkg: erreur de traitement du paquet mysql-server-5.7 (--configure) :
 le sous-processus script post-installation installé a retourné une erreur de sortie d'état 1
dpkg: des problèmes de dépendances empêchent la configuration de mysql-server :
 mysql-server dépend de mysql-server-5.7 ; cependant :
 Le paquet mysql-server-5.7 n'est pas encore configuré.

Aucun rapport « apport » n'a été créé car le message d'erreur indique une erreur consécutive à un échec précédent.
                                                                                                                  dpkg: erreur de traitement du paquet mysql-server (--configure) :
 problèmes de dépendances - laissé non configuré
Des erreurs ont été rencontrées pendant l'exécution :
 mysql-server-5.7
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

Revision history for this message
David Girault (dfgweb) wrote :

Not that this upgrade error is after a clean install of Yakketty during an 'apt full-upgrade'.

version info from dpkg.log:
upgrade mysql-server:all 5.7.16-0ubuntu0.16.10.1 5.7.17-0ubuntu0.16.10.1

Revision history for this message
David Girault (dfgweb) wrote :

Just found the root cause. I leave mysql service disabled (using it only for some testing).

So 'invoke-rc.d mysql start' is just a no-op in that case and since post-install script assume that the service is enabled and running upon start, it fail all time it require mysqld running!

No more mysql_upgrade error 11 with mysql.service correctly enabled!

summary: - mysql error during upgrade from ubuntu 14 - 16
+ package mysql-server-5.7 5.7.11-0ubuntu6 failed to install/upgrade:
+ subprocess installed post-installation script returned error exit status
+ 1
Changed in mysql-5.7 (Ubuntu):
importance: Undecided → High
summary: - package mysql-server-5.7 5.7.11-0ubuntu6 failed to install/upgrade:
- subprocess installed post-installation script returned error exit status
- 1
+ mysql upgrade fails when service is disabled
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.