postinst fails with: mysql_upgrade failed with exit status 11

Bug #1584287 reported by Lucas
34
This bug affects 7 people
Affects Status Importance Assigned to Milestone
mysql-5.7 (Ubuntu)
Incomplete
High
Unassigned

Bug Description

I am update the system (apt-get upgrade)

ProblemType: Package
DistroRelease: Ubuntu 16.04
Package: mysql-server-5.7 5.7.12-0ubuntu1.1
ProcVersionSignature: Ubuntu 4.4.0-22.40-generic 4.4.8
Uname: Linux 4.4.0-22-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.1
Architecture: amd64
Date: Sat May 21 02:25:16 2016
ErrorMessage: sub-processo script post-installation instalado retornou estado de saída de erro 1
InstallationDate: Installed on 2016-04-21 (29 days ago)
InstallationMedia: Ubuntu 16.04 LTS "Xenial Xerus" - Release amd64 (20160420.1)
Logs.var.log.daemon.log:

MySQLConf.etc.mysql.conf.d.mysql.cnf: [mysql]
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: ['mysql_upgrade_info', 'ib_buffer_pool', 'mysql', 'sys', 'auto.cnf', 'ib_logfile0', 'ib_logfile1', 'debian-5.7.flag', 'performance_schema', 'ibdata1']
ProcCmdline: BOOT_IMAGE=/boot/vmlinuz-4.4.0-22-generic root=UUID=3498444f-0e9a-4202-9dda-18e889f326f8 ro quiet splash vt.handoff=7
RelatedPackageVersions:
 dpkg 1.18.4ubuntu1.1
 apt 1.2.12~ubuntu16.04.1
SourcePackage: mysql-5.7
Title: package mysql-server-5.7 5.7.12-0ubuntu1.1 failed to install/upgrade: sub-processo script post-installation instalado retornou estado de saída de erro 1
UpgradeStatus: No upgrade log present (probably fresh install)
modified.conffile..etc.init.mysql.conf: [modified]
mtime.conffile..etc.init.mysql.conf: 2016-04-27T01:08:17.085831

Revision history for this message
Lucas (lucasrochamota) wrote :
Frank Heimes (fheimes)
tags: added: bot-stop-nagging
Revision history for this message
Robie Basak (racb) wrote :

From log:

Configurando mysql-server-5.7 (5.7.12-0ubuntu1.1) ...
insserv: warning: current start runlevel(s) (empty) of script `mysql' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `mysql' overrides LSB defaults (0 1 6).
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: erro ao processar o pacote mysql-server-5.7 (--configure):
 sub-processo script post-installation instalado retornou estado de saída de erro 1

summary: - package mysql-server-5.7 5.7.12-0ubuntu1.1 failed to install/upgrade:
- sub-processo script post-installation instalado retornou estado de saída
- de erro 1
+ postinst fails with: mysql_upgrade failed with exit status 11
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
Lars Tangvald (lars-tangvald) wrote :

I couldn't spot anything in the log files that would explain the issue, which seems to be that either the server isn't running, or it's not writing a socket file to the default location.

The /etc/init/mysql.conf file is marked as modified. Could you paste the contents of it?

Revision history for this message
Alberto Salvia Novella (es20490446e) wrote :

After pasting the contents of it, please set this bug status back to "confirmed".

Changed in mysql-5.7 (Ubuntu):
importance: Undecided → High
status: Confirmed → Incomplete
Revision history for this message
TaNgO (tango-lugmen) wrote :
Download full text (3.2 KiB)

I have the same problem.
After some testing I think that mysql_upgrade is stopping the service and trying to connect to it.

tango@sn-c-c46:~$ sudo systemctl status mysql
● mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since vie 2016-07-22 09:45:28 ART; 11min ago
 Main PID: 5836 (code=exited, status=0/SUCCESS)

jul 22 09:45:15 sn-c-c46 systemd[1]: Starting MySQL Community Server...
jul 22 09:45:16 sn-c-c46 systemd[1]: Started MySQL Community Server.
jul 22 09:45:27 sn-c-c46 systemd[1]: Stopping MySQL Community Server...
jul 22 09:45:28 sn-c-c46 systemd[1]: Stopped MySQL Community Server.
jul 22 09:45:29 sn-c-c46 systemd[1]: Stopped MySQL Community Server.
jul 22 09:46:08 sn-c-c46 systemd[1]: Stopped MySQL Community Server.
jul 22 09:46:09 sn-c-c46 systemd[1]: Stopped MySQL Community Server.

tango@sn-c-c46:~$ sudo systemctl start mysql

tango@sn-c-c46:~$ sudo systemctl status mysql
● mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: active (running) since vie 2016-07-22 09:57:10 ART; 1s ago
  Process: 16693 ExecStartPost=/usr/share/mysql/mysql-systemd-start post (code=exited, status=0/S
  Process: 16687 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUC
 Main PID: 16692 (mysqld)
   CGroup: /system.slice/mysql.service
           └─16692 /usr/sbin/mysqld

jul 22 09:57:09 sn-c-c46 systemd[1]: Starting MySQL Community Server...
jul 22 09:57:10 sn-c-c46 systemd[1]: Started MySQL Community Server.

tango@sn-c-c46:~$ sudo dpkg --configure -a
Configurando mysql-server-5.7 (5.7.13-0ubuntu0.16.04.2) ...
Renaming removed key_buffer and myisam-recover options (if present)
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 al procesar el paquete mysql-server-5.7 (--configure):
 el subproceso instalado el script post-installation devolvió el código de salida de error 1
dpkg: problemas de dependencias impiden la configuración de mysql-server:
 mysql-server depende de mysql-server-5.7; sin embargo:
 El paquete `mysql-server-5.7' no está configurado todavía.

dpkg: error al procesar el paquete mysql-server (--configure):
 problemas de dependencias - se deja sin configurar
Se encontraron errores al procesar:
 mysql-server-5.7
 mysql-server
tango@sn-c-c46:~$
tango@sn-c-c46:~$ sudo systemctl status mysql
● mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since vie 2016-07-22 09:57:52 ART; 24s ago
 Main PID: 16692 (code=exited, status=0/SUCCESS)

jul 22 09:57:09 sn-c-c46 systemd[1]: Starting MySQL Community Server...
jul 22 09:57:10 sn-c-c46 systemd[1]: Started MySQL Community Server.
jul 22 09:57:50 sn-c-c46 systemd[1]: Stopping MySQL Community Server...
jul 22 09:57:52 sn-c-c46 systemd[1]: Stopped MySQL Community Server.
jul 22 09...

Read more...

Revision history for this message
Tim Brooks (morphit2k) wrote :

I encountered this problem on upgrade from 15.10 to 16.04. However, in my case I had the mysql.service disabled. After enabling the service (even with it stopped) the mysql_upgrade process ran correctly. I'm not sure why the service isn't started, being disabled shouldn't make a difference.

I note that Tango had the service enabled, so perhaps something else can inhibit it being started from inside dpkg.

Revision history for this message
Lars Tangvald (lars-tangvald) wrote :

Currently, d/postinst will try to start the service in order to run mysql_upgrade (which functions as a client, requiring a running server).

I think this is covered by LP: #1592669

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.