mysql_upgrade fails with exit status 11

Bug #1726656 reported by wesley gibson
34
This bug affects 5 people
Affects Status Importance Assigned to Milestone
mysql-5.7 (Ubuntu)
Confirmed
High
Unassigned

Bug Description

c

ProblemType: Package
DistroRelease: Ubuntu 16.04
Package: mysql-server-5.7 5.7.20-0ubuntu0.16.04.1
ProcVersionSignature: Ubuntu 4.10.0-37.41~16.04.1-generic 4.10.17
Uname: Linux 4.10.0-37-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.10
Architecture: amd64
Date: Tue Oct 24 09:29:40 2017
ErrorMessage: subprocess installed post-installation script returned error exit status 1
InstallationDate: Installed on 2017-10-13 (10 days ago)
InstallationMedia: Ubuntu 16.04.3 LTS "Xenial Xerus" - Release amd64 (20170801)
Logs.var.log.daemon.log:

Logs.var.log.mysql.error.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: ['ibdata1', 'opencart', 'ib_logfile0', 'debian-5.7.flag', 'phpmyadmin', 'performance_schema', 'sys', 'ib_buffer_pool', 'magento', 'ib_logfile1', 'auto.cnf', 'mysql']
ProcCmdline: BOOT_IMAGE=/boot/vmlinuz-4.10.0-37-generic root=UUID=0f8a9339-4481-460d-a0a8-42d8d5db0c63 ro quiet splash vt.handoff=7
RelatedPackageVersions:
 dpkg 1.18.4ubuntu1.2
 apt 1.2.24
SourcePackage: mysql-5.7
Title: package mysql-server-5.7 5.7.20-0ubuntu0.16.04.1 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1
UpgradeStatus: No upgrade log present (probably fresh install)
upstart.mysql.override: manual

Revision history for this message
wesley gibson (wesley911) wrote :
information type: Private Security → Public
tags: removed: need-duplicate-check
Revision history for this message
Kees Hoekzema (kees-r) wrote :

I had the same problem. It turns out it was mysql_upgrade exiting with an 'Error occurred: The mysql.session exists but is not correctly configured. The mysql.session needs SELECT privileges in the performance_schema database and the mysql.db table and also SUPER privileges.'

The way mysql_upgrade tries to check this requirement is with the query 'SELECT SUM(count)=3 FROM ( SELECT COUNT(*) as count FROM mysql.tables_priv WHERE Table_priv='Select' and User='mysql.session' and Db='mysql' and Table_name='user' UNION ALL SELECT COUNT(*) as count FROM mysql.db WHERE Select_priv='Y' and User='mysql.session' and Db='performance_schema' UNION ALL SELECT COUNT(*) as count FROM mysql.user WHERE Super_priv='Y' and User='mysql.session') as user_priv' which is quite a stupid way to do that.

And this failed in my case because i have 2 mysql.session users, one on localhost and one with '%' as host, so even tho my users were set up _exactly_ as mysql_upgrade demanded, it didn't warn me about the multiple users. Great check... Deleting one caused mysql_upgrade to pass and the dpkg system to return to normal (with an apt-get install -f)

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
Badal Surana (badalsurana) wrote :

i am having the same problem does anyone have any temporary fix?

Revision history for this message
Ruben (fuxjezz) wrote :

The query Kees mentioned returned "0" for me as well. Did not have a duplicate user however.

This worked for me :

UPDATE mysql.user SET Super_priv ='Y' WHERE USER= 'mysql.session';
GRANT SELECT on performance_schema.* to 'mysql.session'@'localhost';
flush privielges;

Now the query Kees mentioned returns "1" and dpkg can continue its chores if I run "apt-get install -f)".

This is not an elegant workaround (only addresses a symptom) but good enough for me (since I'm not interested in the whole "debian-sys-maint framework" anyway) to get on my way...

Revision history for this message
Ruben (fuxjezz) wrote :

I meant "flush privileges;"

Joshua Powers (powersj)
Changed in mysql-5.7 (Ubuntu):
importance: Undecided → High
Robie Basak (racb)
summary: - package mysql-server-5.7 5.7.20-0ubuntu0.16.04.1 failed to
- install/upgrade: subprocess installed post-installation script returned
- error exit status 1
+ mysql_upgrade fails with exit status 11
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Hi,
I'm checking old bugs every now and then, and this one had no activity since 6 months.
Reading the comments so far it reads like a valid bug, but with too few leads to actually take action fixing or further debugging it :-/

Without being able to action as-is I'll drop the server-team subscription to it, if there is new insight/data it will show up in triage again and can be reconsidered.

Revision history for this message
Hugh Wells (winxp0922) wrote :

I can currently reproduce this - I have tried various troubleshooting steps but can't fix the issue. I'm going to just migrate to MySQL 8.

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

@Hugh

If you can provide exact steps to reproduce the issue from a fresh Ubuntu installation, please do - that would be helpful to get this bug addressed.

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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