postinst does not print a helpful message when the server will fail to start

Bug #1602763 reported by Robie Basak on 2016-07-13
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mysql-5.7 (Ubuntu)
Medium
Unassigned
Xenial
Undecided
Robie Basak

Bug Description

[Impact]

A common cause of upgrade failures are invalid configuration directives due to deprecation. In this kind of case, apport does not currently tell us the failure reason, and even if it did print a service start failure, the actual reason has to be dug out of the logs. Further, some users have a very old conffile that did not log output to the current location, so the real reason isn't always submitted in a bug report.

We can ask if mysqld will start by using: "mysqld --verbose --help --innodb-read-only 2>&1 > /dev/null". The postinst should do this so that it can fail early with a more useful error message.

This is fixed in Yakkety already (http://anonscm.debian.org/cgit/pkg-mysql/mysql.git/commit/?id=7897042ea6c65aeb608fb28b4b54639d3dbf3352) but should also be SRU'd to Xenial.

Also see bug 1596056 and bug 1571865. Fixing each of these will improve the situation in a different way. Fixing all three bugs would catch the most failure cases and be the most helpful.

mysqld --verbose --help doesn't currently catch all such issues (it returns 0 if datadir doesn't exist, for instance), but should be a help

[Test Case]
* Install previous version of MySQL (e.g. 5.5. in Trusty)
* Add something like 'invalid_mysql_option=foo' to the server config file
* Upgrade to Xenial and MySQL 5.7

Expected behavior:
A helpful error pointing to invalid_mysql_option

Actual behavior:
'subprocess installed post-installation script returned error exit status 1'

[Regression Potential]
Should there be any non-fatal issue that actually causes mysqld --verbose --help to fail but not the normal server startup to fail, the check will incorrectly cause installation to fail.

Robie Basak (racb) on 2016-07-13
Changed in mysql-5.7 (Ubuntu Xenial):
status: New → In Progress
assignee: nobody → Robie Basak (racb)
description: updated
Robie Basak (racb) on 2016-07-14
Changed in mysql-5.7 (Ubuntu Xenial):
milestone: none → xenial-updates
milestone: xenial-updates → ubuntu-16.04.1
description: updated
Robie Basak (racb) wrote :

Uploaded to Xenial. SRU team: you may find it easier to review if you verify my uploaded delta is the same as https://git.launchpad.net/~racb/ubuntu/+source/mysql-5.7/log/?h=mysql-5.7/ubuntu/xenial and then use that.

Hello Robie, or anyone else affected,

Accepted mysql-5.7 into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/mysql-5.7/5.7.12-0ubuntu1.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in mysql-5.7 (Ubuntu Xenial):
status: In Progress → Fix Committed
tags: added: verification-needed

Verified:
echo "invalid_mysql_option=foo" >> /etc/mysql/my.cnf.
Then on upgrade it should fail to start and complain - now with a reasonable message.
Going from Trusty -> Xenial-Proposed now with aforementioned change in place I see:

ERROR: Unable to start MySQL server:
2016-07-20T13:15:02.743028Z 0 [ERROR] unknown variable 'key_buffer=16M'
2016-07-20T13:15:02.746251Z 0 [ERROR] Aborting
Please take a look at https://wiki.debian.org/Teams/MySQL/FAQ for tips on fixing common upgrade issues.

That is one of the old variables (now key_buffer_size) which just reflects what would happen on old custom-config.
=> Verified

tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mysql-5.7 - 5.7.13-0ubuntu0.16.04.2

---------------
mysql-5.7 (5.7.13-0ubuntu0.16.04.2) xenial-security; urgency=medium

  * SECURITY UPDATE: Update to 5.7.13 to fix security issues (LP: #1604796)
    - http://www.oracle.com/technetwork/security-advisory/cpujul2016-2881720.html
    - CVE-2016-3424
    - CVE-2016-3459
    - CVE-2016-3477
    - CVE-2016-3486
    - CVE-2016-3501
    - CVE-2016-3518
    - CVE-2016-3521
    - CVE-2016-3588
    - CVE-2016-3614
    - CVE-2016-3615
    - CVE-2016-5436
    - CVE-2016-5437
    - CVE-2016-5439
    - CVE-2016-5440
    - CVE-2016-5441
    - CVE-2016-5442
    - CVE-2016-5443
  * debian/patches/mysql-export-scramble.patch: removed, upstream.

 -- Marc Deslauriers <email address hidden> Wed, 20 Jul 2016 08:44:25 -0400

Changed in mysql-5.7 (Ubuntu Xenial):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers