package mysql-server-8.0 8.0.27-0ubuntu0.20.04.1 failed to install/upgrade: (exceeded timeout to shutdown for restart?)

Bug #1957013 reported by Jean Bosco Kalenga
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mysql-8.0 (Ubuntu)
Triaged
High
Unassigned

Bug Description

Sequence of events from dpkg terminal log:
Unpacking mysql-server (8.0.27-0ubuntu0.20.04.1) over (8.0.25-0ubuntu0.20.04.1)
...
Setting up mysql-server-core-8.0 (8.0.27-0ubuntu0.20.04.1)
...

Setting up mysql-server-8.0 (8.0.27-0ubuntu0.20.04.1)
mysqld will log errors to /var/log/mysql/error.log
mysqld is running as pid 34837
Error: Unable to shut down server with process id 34837
dpkg: error processing package mysql-server-8.0 (--configure):
 installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1

Meanwhile, in parallel to the above is this from the mysql error log:

20:45:57 /usr/sbin/mysqld: ready for connections. Version: '8.0.25-0ubuntu0.20.04.1' socket: '/var/run/mysqld/mysqld.sock' port: 3306 (Ubuntu).
21:08:34 Received SHUTDOWN from user <via user signal>. Shutting down mysqld (Version: 8.0.25-0ubuntu0.20.04.1).
21:08:35 /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.25-0ubuntu0.20.04.1) (Ubuntu).
21:29:26 /usr/sbin/mysqld (mysqld 8.0.27-0ubuntu0.20.04.1) starting as process 34835
21:29:26 InnoDB initialization has started.
21:29:30 InnoDB initialization has ended.
21:29:32 [ERROR] Plugin mysqlx reported: 'Preparation of I/O interfaces failed, X Protocol won't be accessible'
21:29:32 [ERROR] Plugin mysqlx reported: 'Setup of socket: '/var/run/mysqld/mysqlx.sock' failed, can't create lock file /var/run/mysqld/mysqlx.sock.lock'
21:31:13 Server upgrade from '80025' to '80027' started.
21:37:55 Server upgrade from '80025' to '80027' completed.
21:38:02 [Warning] A deprecated TLS version TLSv1 is enabled for channel mysql_main
21:38:02 [Warning] A deprecated TLS version TLSv1.1 is enabled for channel mysql_main
21:38:02 [Warning] CA certificate ca.pem is self signed.
21:38:02 Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
21:38:02 [Warning] Insecure configuration for --pid-file: Location '/tmp' in the path is accessible to all OS users. Consider choosing a different directory.
21:38:02 /usr/sbin/mysqld: ready for connections. Version: '8.0.27-0ubuntu0.20.04.1' socket: '/tmp/tmp.n8rxW19ofj/mysqld.sock' port: 0 (Ubuntu).
21:38:05 Received SHUTDOWN from user <via user signal>. Shutting down mysqld (Version: 8.0.27-0ubuntu0.20.04.1).

[Original Report]
i am not able to make an update for this one.

ProblemType: Package
DistroRelease: Ubuntu 20.04
Package: mysql-server-8.0 8.0.27-0ubuntu0.20.04.1
ProcVersionSignature: Ubuntu 5.11.0-46.51~20.04.1-generic 5.11.22
Uname: Linux 5.11.0-46-generic x86_64
ApportVersion: 2.20.11-0ubuntu27.21
Architecture: amd64
CasperMD5CheckResult: skip
Date: Mon Jan 10 23:39:35 2022
ErrorMessage: installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1
InstallationDate: Installed on 2021-01-27 (348 days ago)
InstallationMedia: Ubuntu 20.04.1 LTS "Focal Fossa" - Release amd64 (20200731)
Logs.var.log.daemon.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.my.cnf: Error: [Errno 40] Trop de niveaux de liens symboliques: '/etc/mysql/my.cnf'
MySQLVarLibDirListing: ['client-cert.pem', 'ib_logfile1', 'binlog.000104', 'binlog.000102', 'binlog.000105', 'binlog.000100', 'sys', 'debian-5.7.flag', 'ibdata1', 'binlog.000103', 'ib_logfile0', 'ib_buffer_pool', 'binlog.000097', 'binlog.000101', 'binlog.000107', 'mysql_upgrade_info', 'binlog.000098', 'jean-desktop.pid', 'binlog.index', 'public_key.pem', 'binlog.000108', 'binlog.000099', 'undo_002', 'mysql', 'undo_001', 'server-cert.pem', '#innodb_temp', 'ca.pem', 'ca-key.pem', 'binlog.000106', 'server-key.pem', '#ib_16384_0.dblwr', 'performance_schema', 'client-key.pem', 'auto.cnf', '#ib_16384_1.dblwr', 'private_key.pem', 'mysql.ibd', 'ibtmp1']
ProcCmdline: BOOT_IMAGE=/boot/vmlinuz-5.11.0-46-generic root=UUID=dcddafc6-2e54-4ad3-8798-5fb5f24419b1 ro quiet splash vt.handoff=7
Python3Details: /usr/bin/python3.8, Python 3.8.10, python3-minimal, 3.8.2-0ubuntu2
PythonDetails: N/A
RelatedPackageVersions:
 dpkg 1.19.7ubuntu3
 apt 2.0.6
SourcePackage: mysql-8.0
Title: package mysql-server-8.0 8.0.27-0ubuntu0.20.04.1 failed to install/upgrade: installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Jean Bosco Kalenga (boscokalenga) wrote :
Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Thank you for taking the time to file a bug report.

Checking the dpkg logs we can see:

Setting up mysql-server-8.0 (8.0.27-0ubuntu0.20.04.1) ...
mysqld will log errors to /var/log/mysql/error.log
mysqld is running as pid 34837
Error: Unable to shut down server with process id 34837
dpkg: error processing package mysql-server-8.0 (--configure):
 installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1

There is a mysql process running with PID 34837, and this process seems to not be created by the package, if you check the mysql logs you will not find any mention to this PID. I am wondering if you are running mysql in a different way in your system (i.e. using a container).

Since there is not enough information in your report to begin triage or to
differentiate between a local configuration problem and a bug in Ubuntu, I
am marking this bug as "Incomplete". We would be grateful if you would:
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".

For local configuration issues, you can find assistance here:
http://www.ubuntu.com/support/community

Changed in mysql-8.0 (Ubuntu):
status: New → Incomplete
Bryce Harrington (bryce)
description: updated
description: updated
Revision history for this message
Bryce Harrington (bryce) wrote :

21:31:13 Server upgrade from '80025' to '80027' started.
21:37:55 Server upgrade from '80025' to '80027' completed.

Notice the upgrade took >5 min to complete.
We have a number of bugs similar to this, like LP: #1901830, #1928493, #1929314, and maybe #1929430.

The postinst has this code:

stop_server(){
  local tmpdir=$1
  # Send kill signal
  server_pid=$(cat "$tmpdir/mysqld.pid")
  kill "$server_pid"

  for i in $(seq 1 60); do
    sleep 0.1 # A full second is too long, but we need to give the server _some_ time.
    if ! $(ps $server_pid >/dev/null 2>&1); then
      return 0
    fi
    sleep 1
  done
  # The server hasn't shut down in a timely manner
  echo "Error: Unable to shut down server with process id $server_pid" >&2
  return 1
}

If I read this right it suggests that it waits only 1 minute for the old server to shut down before considering it failed. Increasing the timeout to 10 minutes would seem excessive but from the logs it appears that would work around the problem...

Of course, if we expect a shutdown within a minute but it takes 7-10 minutes in practice sometimes, then that suggests examining why it sometimes takes so long.

summary: package mysql-server-8.0 8.0.27-0ubuntu0.20.04.1 failed to
- install/upgrade: installed mysql-server-8.0 package post-installation
- script subprocess returned error exit status 1
+ install/upgrade: (exceeded timeout to shutdown for restart?)
Changed in mysql-8.0 (Ubuntu):
status: Incomplete → Triaged
importance: Undecided → High
Revision history for this message
Bryce Harrington (bryce) wrote :

From the dmesg output:
   total RAM covered: 4014M
   Memory: 3862760K/4087216K
   CPU0: Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz

Ubuntu Server's minimum requirements are 1G, but this install looks like it has desktop elements (libreoffice, etc.) 4G is a bit on the lower side of the system requirements for Ubuntu Desktop, perhaps the upgrade process hit a resource limit that made mysql take longer than usual to shutdown?

tags: removed: need-duplicate-check
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.