Public bug reported:

Hello,


The corresponding apt error message looks like this:

...
Do you want to continue? [Y/n] 
Setting up mysql-server-5.7 (5.7.17-0ubuntu0.16.04.1) ...
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 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
No apport report written because the error message indicates its a followup 
error from a previous failure.
                                                                                
                          Errors were encountered while processing:
 mysql-server-5.7
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)


The workaround is to put a `sleep 3` on the 320. line of 
mysql-server-5.7.postinst script (right before `mysql_upgrade 
--defaults-file=/etc/mysql/debian.cnf || result=$?` )

The root cause seems to be that invoke-rc.d does not execute systemctl
--wait, and systemctl without wait doesn't wait until the database
server daemon is up and listening.

And of course it could be mitigated by using a systemd socket for mysql.

** Affects: mysql-5.7 (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1670629

Title:
  postinst runs mysql_upgrade before server is properly started

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/mysql-5.7/+bug/1670629/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to