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

Bug #1567884 reported by Harish
100
This bug affects 23 people
Affects Status Importance Assigned to Milestone
mysql-5.7 (Ubuntu)
Incomplete
High
Unassigned

Bug Description

i had mysql 5.5
and it got upgraded after upgrading to ubuntu 16.04

I couldn't start mysql

status was active(exited) everytime after i start mysql

So i decided to install mysql-server one more time...then i got this bug

ProblemType: Package
DistroRelease: Ubuntu 16.04
Package: mysql-server-5.7 5.7.11-0ubuntu5
ProcVersionSignature: Ubuntu 4.4.0-18.34-generic 4.4.6
Uname: Linux 4.4.0-18-generic x86_64
ApportVersion: 2.20.1-0ubuntu1
Architecture: amd64
Date: Fri Apr 8 16:26:45 2016
ErrorMessage: subprocess installed post-installation script returned error exit status 1
InstallationDate: Installed on 2015-07-31 (252 days ago)
InstallationMedia: Ubuntu 14.04.1 LTS "Trusty Tahr" - Release amd64 (20140722.2)
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: ['auto.cnf', 'ibtmp1', 'ib_buffer_pool', 'ib_logfile0', 'mysql', 'performance_schema', 'test', 'ib_logfile1', 'debian-5.7.flag', 'ibdata1']
ProcCmdline: BOOT_IMAGE=/boot/vmlinuz-4.4.0-18-generic root=UUID=1045f991-e1a4-4984-96d2-a1432bac267f ro acpi quiet splash acpi=force vt.handoff=7
RelatedPackageVersions:
 dpkg 1.18.4ubuntu1
 apt 1.2.10
SourcePackage: mysql-5.7
Title: package mysql-server-5.7 5.7.11-0ubuntu5 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1
UpgradeStatus: Upgraded to xenial on 2016-04-03 (4 days ago)

Revision history for this message
Harish (harish-myemails) 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
claus (claus2) wrote :

I had a similar (or the same error) today. I found this in my syslog:

Apr 8 18:51:25 mail mysqld[30197]: 2016-04-08T16:51:25.015211Z 0 [ERROR] unknown variable 'myisam-recover=BACKUP'
Apr 8 18:51:25 mail mysqld[30197]: 2016-04-08T16:51:25.015314Z 0 [ERROR] Aborting

And an older message:
Apr 8 18:45:01 mail mysqld: 2016-04-08 18:45:01 28781 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the
full name instead.

For me disabling the line "myisam-recover=..." in /etc/mysql/mysql.conf.d/mysqld.cnf and rerunning apt-get upgrade fixed the problem.
HTH

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

Thanks for the info.
myisam-recover has been removed as a valid option (it's replaced by myisam-recover-options as mentioned in the deprecation warning in 5.6, so you should be able to just rename it).

Revision history for this message
Alex (normadize) wrote :
Download full text (14.9 KiB)

I'm posting this bug here, although the upgrade process in my case did finish (upgraded from 5.6 to 5.7 on Xenial) but left it in a failed state

<...SNIP...>
Installing new version of config file /etc/mysql/mysql.conf.d/mysqld.cnf ...
Job for mysql.service failed because the control process exited with error code. See "systemctl stat us mysql.service" and "journalctl -xe" for details.
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing package mysql-server-5.7 (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.7; however:
  Package mysql-server-5.7 is not configured yet.

dpkg: error processing package mysql-server (--configure):
 dependency problems - leaving unconfigured
Processing triggers for systemd (229-4ubuntu1) ...
Processing triggers for ureadahead (0.100.0-19) ...
Errors were encountered while processing:
 mysql-server-5.7
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

Logs say:

2016-04-12T17:12:04.333194Z 0 [ERROR] unknown variable 'key_buffer=16M'
2016-04-12T17:12:04.333206Z 0 [ERROR] Aborting

Commenting out the line 'key_buffer=16M' and running 'apt-get install -f' appeared to continue successfully, reporting upgrading the databases too.

However, looking in the log again, I saw this:

2016-04-12T17:18:17.643847Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2016-04-12T17:18:17.643990Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
2016-04-12T17:18:17.814693Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-04-12T17:18:17.815303Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.11-0ubuntu5) starting as process 14227 ...
2016-04-12T17:18:17.820389Z 0 [Note] InnoDB: PUNCH HOLE support available
2016-04-12T17:18:17.820440Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-04-12T17:18:17.820462Z 0 [Note] InnoDB: Uses event mutexes
2016-04-12T17:18:17.820494Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2016-04-12T17:18:17.820501Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2016-04-12T17:18:17.820511Z 0 [Note] InnoDB: Using Linux native AIO
2016-04-12T17:18:17.820783Z 0 [Note] InnoDB: Number of pools: 1
2016-04-12T17:18:17.820911Z 0 [Note] InnoDB: Using CPU crc32 instructions
2016-04-12T17:18:17.832665Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2016-04-12T17:18:17.842499Z 0 [Note] InnoDB: Completed initialization of buffer pool
2016-04-12T17:18:17.845028Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2016-04-12T17:18:17.857904Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2016-04-12T17:18:17.897639Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2016-04-12T...

Revision history for this message
Alex (normadize) wrote :
Download full text (5.3 KiB)

I just wiped all mysql server completely, including databases, and tried to install 5.7 in xenial but it still fails. I had to do quite a few manual steps ... Details below.

First, the my.cnf file has the line

!includedir /etc/mysql/conf.d/

... but the dir /etc/mysql/conf.d/ does not exist. This should be removed as it blocks the install!

Full steps (note that I'm wiping everything, including all databases!):

# apt-get purge mysql-server*
# rm -rf /etc/mysql /var/lib/mysql* /var/log/mysql*
# apt-get -V install mysql-server

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
   mysql-server-5.7 (5.7.11-0ubuntu5)
   mysql-server-core-5.7 (5.7.11-0ubuntu5)
Suggested packages:
   tinyca (0.7.5-6)
The following NEW packages will be installed:
   mysql-server (5.7.11-0ubuntu5)
   mysql-server-5.7 (5.7.11-0ubuntu5)
   mysql-server-core-5.7 (5.7.11-0ubuntu5)
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/10.1 MB of archives.
After this operation, 94.6 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Preconfiguring packages ...
Selecting previously unselected package mysql-server-core-5.7.
(Reading database ... 56768 files and directories currently installed.)
Preparing to unpack .../mysql-server-core-5.7_5.7.11-0ubuntu5_amd64.deb ...
Unpacking mysql-server-core-5.7 (5.7.11-0ubuntu5) ...
Selecting previously unselected package mysql-server-5.7.
Preparing to unpack .../mysql-server-5.7_5.7.11-0ubuntu5_amd64.deb ...
grep: /etc/mysql/: No such file or directory
Unpacking mysql-server-5.7 (5.7.11-0ubuntu5) ...
Selecting previously unselected package mysql-server.
Preparing to unpack .../mysql-server_5.7.11-0ubuntu5_all.deb ...
Unpacking mysql-server (5.7.11-0ubuntu5) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for systemd (229-4ubuntu1) ...
Processing triggers for ureadahead (0.100.0-19) ...
Setting up mysql-server-core-5.7 (5.7.11-0ubuntu5) ...
Setting up mysql-server-5.7 (5.7.11-0ubuntu5) ...
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing package mysql-server-5.7 (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.7; however:
  Package mysql-server-5.7 is not configured yet.
dpkg: error processing package mysql-server (--configure):
 dependency problems - leaving unconfigured
Processing triggers for systemd (229-4ubuntu1) ...
Processing triggers for ureadahead (0.100.0-19) ...
Errors were encountered while processing:
 mysql-server-5.7
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

# systemctl status mysql.service

● mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabl...

Read more...

Changed in mysql-5.7 (Ubuntu):
importance: Undecided → High
Revision history for this message
Robie Basak (racb) wrote :

> ... but the dir /etc/mysql/conf.d/ does not exist. This should be removed as it blocks the install!

The mysql-common package provides /etc/mysql/conf.d/mysql.cnf and others. If you have deleted it locally, then this user choice will be preserved. To fix your system, try purging all mysql packages and then reinstalling.

Since it seems likely to me that this is a local configuration problem, rather than a bug in Ubuntu, I'm marking this bug as Incomplete.

If indeed this is a local configuration problem, you can find pointers to get help for this sort of problem here: http://www.ubuntu.com/support/community

Or if you believe that this is really a bug, then you may find it helpful to read "How to report bugs effectively" http://www.chiark.greenend.org.uk/~sgtatham/bugs.html. We'd be grateful if you would then provide a more complete description of the problem, explain why you believe this is a bug in Ubuntu rather than a problem specific to your system, and then change the bug status back to New.

This relates to Harish's original report. claus and Alex, if you think you have separate issues and that they are bugs present in Ubuntu's packaging of MySQL (rather than local system misconfigurations), then please file separate reports.

Changed in mysql-5.7 (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Alex (normadize) wrote :

>> ... but the dir /etc/mysql/conf.d/ does not exist. This should be removed as it blocks the install!
>
> The mysql-common package provides /etc/mysql/conf.d/mysql.cnf and others. If you have deleted it locally, then this user choice will be preserved. To fix your system, try purging all mysql packages and then reinstalling.

Please read my previous message fully.

I specifically said I purged all mysql packages and installed fresh, and included very detailed steps about the problem, with error messages and with fixes I had to apply.

It is definitely not a local configuration problem.

Revision history for this message
Alex (normadize) wrote :

Apologies, I misread your message when you said "mysql-common". When I try to install that one, I get the error:

update-alternatives: error: alternative path /etc/mysql/my.cnf.fallback doesn't exist

I noticed there is already a bug open for that.

However: This current bug is valid. My first message in this bug shows that I was unable to upgrade from mysql 5.6 on Xenial. The configuration halted because:

[ERROR] unknown variable 'key_buffer=16M'

And the whole installation exited with the same message as the bug title.

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

We might be able to prevent this causing the installation to fail by ensuring the server doesn't read config files during installation (but need to test this to verify).

However if that is the case then the issue would be less visible as the server would simply fail to start after installation since the deprecated config values are still there, and will need to be removed from the configuration files

I'm not sure what the desired behavior is here, since this is likely to affect a number of people who upgrade from earlier versions of the server.

Revision history for this message
Alex (normadize) wrote :

It's actually worse than that, because:
  (1) apt leaves the package dangling, not fully installed, requires a fix with "apt-get install -f" ... and
  (2) it leaves the databases and tables in the old pre-5.6 format because it didn't finish installation

So it's a bit of a mess. After manually fixing the my.cnf problem and doing a -f, it goes ahead and converts the databases and tables as well and finishes.

It's not Ubuntu's responsibility to fix the my.cnf problem, but maybe Ubuntu could allow some easy way to revert to 5.6 after a failed 5.7 upgrade, because right now it's a little scary for those who don't have much expertise to fix it themselves.

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

A first step would be to give a more helpful error message than «It didn't work».
Running mysqld --verbose --help 2>&1 > /dev/null can let us detect errors without starting up the database fully:

lars@lars-xenial2:~/git/mysql-5.7$ mysqld --verbose --help 2>&1 > /dev/null
2016-04-15T05:19:25.553086Z 0 [ERROR] unknown variable 'myisam-recover=BACKUP'
2016-04-15T05:19:25.555137Z 0 [ERROR] Aborting

So if that command fails we can abort early and pass on the error

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

This looks like bug 1571865 to me. I wonder if it's possible that my.cnf.migrated remains with an alternative listed even if all packages are purged? That may be related to an issue with how the my.cnf symlink is handled.

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.