package mysql-server-5.5 5.5.32-0ubuntu0.12.04.2 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1

Bug #1210380 reported by Dan Jones
442
This bug affects 97 people
Affects Status Importance Assigned to Milestone
mysql-5.5 (Ubuntu)
High
Unassigned
Trusty
Undecided
Unassigned

Bug Description

Affected: mysql-server-5.5 versions 5.5.32-0ubuntu0.13.04.2, 5.5.32-0ubuntu0.12.10.2, 5.5.32-0ubuntu0.12.04.2 and maybe 5.5.32-0ubuntu2.

Fix: downgrade to 5.5.32-0ubuntu0.13.04.1, 5.5.32-0ubuntu0.12.10.1 or 5.5.32-0ubuntu0.12.04.1 respectively.

Note: these updates were never issued. They entered -proposed for those participating in -proposed testing only. If this surprises you, then reverse the steps at https://wiki.ubuntu.com/Testing/EnableProposed to stop testing proposed updates.

Thanks to everyone testing proposed updates for flagging this within a few hours. Your help stopped us from issuing this incorrect update to all users.

[Original Description]
sudo aptitude update
sudo aptitude upgrade
and then the failure. I suspect this is a timing issue rather than an outright bug.

ProblemType: Package
DistroRelease: Ubuntu 12.04
Package: mysql-server-5.5 5.5.32-0ubuntu0.12.04.2
ProcVersionSignature: Ubuntu 3.5.0-38.59~precise1-generic 3.5.7.17
Uname: Linux 3.5.0-38-generic x86_64
ApportVersion: 2.0.1-0ubuntu17.4
Architecture: amd64
Date: Thu Aug 8 21:19:48 2013
ErrorMessage: subprocess installed post-installation script returned error exit status 1
InstallationMedia: Ubuntu 12.04.2 LTS "Precise Pangolin" - Release amd64 (20130213)
Logs.var.log.daemon.log:

MarkForUpload: True
MySQLConf.etc.mysql.conf.d.mysqld.safe.syslog.cnf:
 [mysqld_safe]
 syslog
MySQLVarLibDirListing: ['phpmyadmin', 'ib_logfile1', 'ibdata1', 'debian-5.5.flag', 'performance_schema', 'test', 'ib_logfile0', 'mysql', 'mysql_upgrade_info']
SourcePackage: mysql-5.5
Title: package mysql-server-5.5 5.5.32-0ubuntu0.12.04.2 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Dan Jones (dr-daniel-l-jones) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in mysql-5.5 (Ubuntu):
status: New → Confirmed
Revision history for this message
Lars Kneschke (lkneschke) wrote :

There are 2 problems.

The line breaks after the ALTER TABLE statements in mysql-server-5.5.postinst are missing.

    fix_privs=`echo -e \
        "USE mysql;\n" \
        "ALTER TABLE user ADD column Create_view_priv enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N';\n" \
        "ALTER TABLE user ADD column Show_view_priv enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N';\n" \
        "ALTER TABLE user ADD column Create_routine_priv enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N';\n" \
        "ALTER TABLE user ADD column Alter_routine_priv enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N';\n" \
        "ALTER TABLE user ADD column Create_user_priv enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N';\n" \
        "ALTER TABLE user ADD column Event_priv enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N';\n" \
        "ALTER TABLE user ADD column Trigger_priv enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N'; " `

And the /etc/init/mysql.conf pre-start script does not work. You have to comment following line, to be able to mysql server again. HINT: mysqld_get_param seems to be missing.

    datadir=`mysqld_get_param datadir`
    if LC_ALL=C BLOCKSIZE= df --portability $datadir/. | tail -n 1 | awk '{ exit ($4<4096) }'; then
      echo "$0: ERROR: The partition with $datadir is too full!" >&2
      echo "ERROR: The partition with $datadir is too full!" | $ERR_LOGGER
      exit 1
    fi

Revision history for this message
Thomas Winteler (Win-Soft) (thomi) wrote :

Is there a workaround til new package is build?

Revision history for this message
Gérald Sédrati-Dinet (Gibus) (gerald-sedrati-dinet) wrote :

The following patch will do the workaround by defining function mysqld_get_param in /etc/init/mysql.conf

Revision history for this message
Thomas Winteler (Win-Soft) (thomi) wrote :
Download full text (10.8 KiB)

I have 13.04 64bit and upgraded today my system and also mysql-server to 5.5.32-0ubuntu0.13.04.2 and upgrade breaks.
I treid then to purge mysql-server-5.5 and reinstall it, but get same error:

.
thomi@hercules:~$ sudo apt-get install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libavahi-compat-libdnssd1 libmyth-0.26-0 libmyth-python libmythtv-perl libnet-upnp-perl libva-glx1 pwgen python-imdbpy python-urlgrabber transcode transcode-doc twolame wmctrl
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  mysql-client-5.5 mysql-server-5.5
Suggested packages:
  tinyca
The following NEW packages will be installed:
  mysql-client-5.5 mysql-server mysql-server-5.5
0 upgraded, 3 newly installed, 0 to remove and 1 not upgraded.
Need to get 0 B/17.0 MB of archives.
After this operation, 62.8 MB of additional disk space will be used.
Do you want to continue [Y/n]?
Preconfiguring packages ...
Selecting previously unselected package mysql-client-5.5.
(Reading database ... 409126 files and directories currently installed.)
Unpacking mysql-client-5.5 (from .../mysql-client-5.5_5.5.32-0ubuntu0.13.04.2_amd64.deb) ...
Selecting previously unselected package mysql-server-5.5.
Unpacking mysql-server-5.5 (from .../mysql-server-5.5_5.5.32-0ubuntu0.13.04.2_amd64.deb) ...
Selecting previously unselected package mysql-server.
Unpacking mysql-server (from .../mysql-server_5.5.32-0ubuntu0.13.04.2_all.deb) ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
Setting up mysql-client-5.5 (5.5.32-0ubuntu0.13.04.2) ...
Setting up mysql-server-5.5 (5.5.32-0ubuntu0.13.04.2) ...
130809 10:07:58 [Note] Plugin 'FEDERATED' is disabled.
130809 10:07:58 InnoDB: The InnoDB memory heap is disabled
130809 10:07:58 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130809 10:07:58 InnoDB: Compressed tables use zlib 1.2.7
130809 10:07:58 InnoDB: Using Linux native AIO
130809 10:07:58 InnoDB: Initializing buffer pool, size = 128.0M
130809 10:07:58 InnoDB: Completed initialization of buffer pool
130809 10:07:58 InnoDB: highest supported file format is Barracuda.
130809 10:07:58 InnoDB: Waiting for the background threads to start
130809 10:07:59 InnoDB: 5.5.32 started; log sequence number 1595675
130809 10:07:59 InnoDB: Starting shutdown...
130809 10:08:00 InnoDB: Shutdown completed; log sequence number 1595675
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
 subprocess installed post-installation script returned error exit status 1
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.5; however:
  Package mysql-server-5.5 is not configured yet.

dpkg: error processing mysql-server (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
               ...

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "mysql.conf-bug_1210380.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Thomas Winteler (Win-Soft) (thomi) wrote :

after applieing the patch i could upgrade/install mysql-server and this was output:

sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libavahi-compat-libdnssd1 libmyth-0.26-0 libmyth-python libmythtv-perl libnet-upnp-perl libva-glx1 pwgen python-imdbpy python-urlgrabber transcode transcode-doc twolame wmctrl
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up mysql-server-5.5 (5.5.32-0ubuntu0.13.04.2) ...
initctl: Unknown job: mysql
130809 10:21:55 [Note] Plugin 'FEDERATED' is disabled.
130809 10:21:55 InnoDB: The InnoDB memory heap is disabled
130809 10:21:55 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130809 10:21:55 InnoDB: Compressed tables use zlib 1.2.7
130809 10:21:55 InnoDB: Using Linux native AIO
130809 10:21:55 InnoDB: Initializing buffer pool, size = 128.0M
130809 10:21:55 InnoDB: Completed initialization of buffer pool
130809 10:21:55 InnoDB: highest supported file format is Barracuda.
130809 10:21:55 InnoDB: Waiting for the background threads to start
130809 10:21:56 InnoDB: 5.5.32 started; log sequence number 1595675
130809 10:21:56 InnoDB: Starting shutdown...
130809 10:21:57 InnoDB: Shutdown completed; log sequence number 1595675
initctl: Unknown job: mysql
Setting up mysql-server (5.5.32-0ubuntu0.13.04.2) ...
thomi@hercules:~$ ps ax | grep mysql
 2520 ? Sl 0:00 /usr/sbin/mysqld --defaults-file=/home/thomi/.local/share/akonadi/mysql.conf --datadir=/home/thomi/.local/share/akonadi/db_data/ --socket=/home/thomi/.local/share/akonadi/socket-hercules/mysql.socket
 3291 pts/5 S+ 0:00 tail -f /var/log/mysql/error.log
 4325 ? Sl 0:01 /usr/bin/kate -b /home/thomi/Temp/mysql/mysql.conf-bug_1210380.patch
 4628 pts/6 S+ 0:00 grep --color=auto mysql

sudo service mysql start also shows:
status: Unknown job: mysql

Revision history for this message
Gérald Sédrati-Dinet (Gibus) (gerald-sedrati-dinet) wrote :

Sorry, the function was not in the right place in the previous patch + the condition to check whether partition is too full was always returning true. Here is a proposed patch.

Revision history for this message
Kurt Huwig (k-huwig-f) wrote :

In the mysql.conf-bug_1210380.patch, the explanation for the kill timeout:

-# The default of 5 seconds is too low for mysql which needs to flush buffers
 kill timeout 300

has been moved after the function definition. I guess this was not intended.

Revision history for this message
Gérald Sédrati-Dinet (Gibus) (gerald-sedrati-dinet) wrote :

@Kurt Huwig, yes sorry for this

Revision history for this message
Alberto Pagliarini (batopa) wrote :

Same problem for me updating mysql-server-5.5.32 in Ubuntu 13.04 64 bit.
The patch proposed by Gérald in https://bugs.launchpad.net/ubuntu/+source/mysql-5.5/+bug/1210380/comments/9 works for me!

Revision history for this message
Thomas Winteler (Win-Soft) (thomi) wrote :

YESSS.... got it running THANKS...!!!

Patch https://bugs.launchpad.net/ubuntu/+source/mysql-5.5/+bug/1210380/comments/9 works perfect...

thanks a lot..
thomi

Revision history for this message
Alexander Broshevich (vcosvic) wrote :

@gerald My savior! Thanks!

Revision history for this message
Danky (danky) wrote :

Worked for me too. Thanks Gérald.

Ubuntu: fix it soon, it broked all my mysql servers when upgraded.

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

> Ubuntu: fix it soon, it broked all my mysql servers when upgraded.

I'm sorry this didn't work for you. However, it was only a -proposed update. We appreciate everyone who tests -proposed for us - I'll mark this update as verification-failed in bug 1121874 and the update won't land in -updates.

I'm not sure if it's clear to everyone affected by this bug that by using -proposed you are volunteering to test proposed updates. If you weren't aware of this and you don't want this to happen, then you should disable -proposed testing. Reverse the steps at: https://wiki.ubuntu.com/Testing/EnableProposed to disable -proposed.

If you have already installed a -proposed package, then you should downgrade to fix this issue. If on Precise, then you should downgrade to 5.5.32-0ubuntu0.12.04.1.

Revision history for this message
SKAL (sir-kalot) wrote :

Thanks to Gérald
the patch is working!

Robie Basak (racb)
description: updated
Revision history for this message
Dan Jones (dr-daniel-l-jones) wrote :

YAH Gérald- Yet Another Hooray for Gérald - the patch fixed the problem.

As was pointed out, -proposed is for testing and those of us who use it realize we may find some issues. The good part is to see how fast the problem can be fixed.

Thanks to all.

Revision history for this message
Lars Kneschke (lkneschke) wrote :

Just as reminder. There are 2 problems. One got fixed by the patch from Gerald.

The other problem is, that there is invalid SQL included in the postint file. With the patch from Gerald the MySQL server is starting again, but some SQL update statements were not executed. Which may lead to problems later.

Revision history for this message
Ole Wolf (ole.wolf) wrote :

The fix proposed by Gérald ibn step 9 worked for me, too.

I'm not sure there's actually invalid SQL in the postinst file as Lars suggests, because multiple MySQL queries can be added on the same line as long as they're separated by ';' as is the case in the script.

Revision history for this message
Lars Kneschke (lkneschke) wrote :

This is from /var/log/mysql/error.log before I added the line breaks.

130809 8:50:47 InnoDB: 5.5.32 started; log sequence number 6926705359
ERROR: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ALTER TABLE user ADD column Show_view_priv enum('N','Y') CHARACTER SET utf8 NOT ' at line 1
130809 8:50:47 [ERROR] Aborting

After I added the line breaks to the MySQL statements the update succeeded.

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

If you find this bug is still not fixed, mark it as "confirmed".

Changed in mysql-5.5 (Ubuntu):
status: Confirmed → Fix Committed
importance: Undecided → High
Revision history for this message
Levy (michel-levy) wrote :

I tried without success to apply the patch given in comment 9 by the command
patch mysql.conf mysql.conf-bug_1210380.patch
this command produced
Hunk #1 FAILED at 12.
Hunk #2 FAILED at 26.

Changed in mysql-5.5 (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Mitar (mitar) wrote :

Is this really fixed? I am getting this error with 5.5.43-0ubuntu0.14.04.1 version.

See attached log for example of a log after installation of the package.

Changed in mysql-5.5 (Ubuntu):
status: Fix Released → Confirmed
Revision history for this message
Stijn Tintel (stintel) wrote :
Download full text (4.9 KiB)

Seeing this on a clean install of mysql-server inside a trusty Docker container:

160825 12:36:59 [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.
160825 12:36:59 [Note] Plugin 'FEDERATED' is disabled.
160825 12:36:59 InnoDB: The InnoDB memory heap is disabled
160825 12:36:59 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160825 12:36:59 InnoDB: Compressed tables use zlib 1.2.8
160825 12:36:59 InnoDB: Using Linux native AIO
160825 12:36:59 InnoDB: Initializing buffer pool, size = 128.0M
160825 12:36:59 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
160825 12:36:59 InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
160825 12:36:59 InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
160825 12:36:59 InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: 127 rollback segment(s) active.
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
160825 12:36:59 InnoDB: Waiting for the background threads to start
160825 12:37:00 InnoDB: 5.5.50 started; log sequence number 0
160825 12:37:00 InnoDB: Starting shutdown...
160825 12:37:01 InnoDB: Shutdown completed; log sequence number 1595675
160825 12:37:01 [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.
160825 12:37:01 [Note] Plugin 'FEDERATED' is disabled.
160825 12:37:01 InnoDB: The InnoDB memory heap is disabled
160825 12:37:01 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160825 12:37:01 InnoDB: Compressed tables use zlib 1.2.8
160825 12:37:01 InnoDB: Using Linux native AIO
160825 12:37:01 InnoDB: Initializing buffer pool, size = 128.0M
160825 12:37:01 InnoDB: Completed initialization of buffer pool
160825 12:37:01 InnoDB: highest supported file format is Barracuda.
160825 12:37:01 InnoDB: Waiting for the background threads to start
160825 12:37:02 InnoDB: 5.5.50 started; log sequence number 1595675
ERROR: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ALTER TABLE user ADD column Show_view_priv enum('N','Y') CHARACTER SET utf8 NOT ' at line 1
160825 12:37:02 [ERROR] Aborting

160825 12:37:02 InnoDB: Starting shutdown...
160825 12:37:03 InnoDB: Shutdown completed; log sequence number 1595675
160825 12:37:03 [Note] /usr/sbin/mysqld: Shutdown complete

160825 12:37:03 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Pleas...

Read more...

Revision history for this message
Alex (alexman) wrote :

I realize this is an old one, but we just got hit by the same problem when "unattended upgrades" installed the latest 5.5.52 security fix on Ubuntu 14.04 last night. (http://www.ubuntu.com/usn/usn-3078-1/)

160914 6:37:33 InnoDB: 5.5.52 started; log sequence number 50715712437
ERROR: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ALTER TABLE user ADD column Show_view_priv enum('N','Y'
) CHARACTER SET utf8 NOT ' at line 1
160914 6:37:33 [ERROR] Aborting

This took our application down, so we resorted to putting back an upgrade.

Revision history for this message
Alex (alexman) wrote :

...putting back a backup*

Revision history for this message
Nish Aravamudan (nacc) wrote :

I think the issues mentioned by Lars in c#2 are partially fixed. mysql-5.5 in trusty has the mysqld_get_param function. But the newlines in the postinst alter statements is still missing (the version of mysql in 16.04+ does not have these lines).

Changed in mysql-5.5 (Ubuntu):
status: Confirmed → Invalid
Changed in mysql-5.5 (Ubuntu Trusty):
status: New → Triaged
To post a comment you must log in.