package mysql-server-8.0 8.0.27-0ubuntu0.20.04.1 failed to install/upgrade: Unable to shut down server, could not get apt cache lock

Bug #1953243 reported by Aditya Tripathi
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mysql-8.0 (Ubuntu)
Triaged
Undecided
Unassigned

Bug Description

Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend

ProblemType: Package
DistroRelease: Ubuntu 20.04
Package: mysql-server-8.0 8.0.27-0ubuntu0.20.04.1
ProcVersionSignature: Ubuntu 5.11.0-27.29~20.04.1-generic 5.11.22
Uname: Linux 5.11.0-27-generic x86_64
ApportVersion: 2.20.11-0ubuntu27.18
AptOrdering:
 mysql-client-8.0:amd64: Install
 mysql-server-8.0:amd64: Install
 mysql-server-core-8.0:amd64: Install
 NULL: ConfigurePending
Architecture: amd64
CasperMD5CheckResult: skip
Date: Sun Dec 5 13:57:12 2021
ErrorMessage: installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1
InstallationDate: Installed on 2021-04-07 (241 days ago)
InstallationMedia: Ubuntu 20.04.2.0 LTS "Focal Fossa" - Release amd64 (20210209.1)
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] Too many levels of symbolic links: '/etc/mysql/my.cnf'
MySQLVarLibDirListing: ['auto.cnf', 'binlog.000102', 'ca-key.pem', 'ib_logfile1', 'binlog.000096', '#ib_16384_0.dblwr', 'test_db', 'binlog.000103', 'private_key.pem', 'ibdata1', 'binlog.000100', 'undo_001', 'ib_buffer_pool', 'client-cert.pem', 'public_key.pem', 'binlog.000101', 'binlog.000099', 'debian-5.7.flag', '#ib_16384_1.dblwr', 'mysql_upgrade_info', 'server-key.pem', 'binlog.000098', 'ib_logfile0', 'sys', 'performance_schema', 'mysql', 'binlog.000094', 'binlog.000097', 'binlog.000095', 'mysql.ibd', 'ca.pem', 'undo_002', '#innodb_temp', 'binlog.index', 'server-cert.pem', 'client-key.pem']
ProcCmdline: BOOT_IMAGE=/boot/vmlinuz-5.11.0-27-generic root=UUID=4104740b-a188-424d-8c28-3007883c3091 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
Aditya Tripathi (adirewa-01) wrote :
Bryce Harrington (bryce)
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: Unable to shut down server
summary: package mysql-server-8.0 8.0.27-0ubuntu0.20.04.1 failed to
- install/upgrade: Unable to shut down server
+ install/upgrade: Unable to shut down server, could not get cache lock
Revision history for this message
Bryce Harrington (bryce) wrote : Re: package mysql-server-8.0 8.0.27-0ubuntu0.20.04.1 failed to install/upgrade: Unable to shut down server, could not get cache lock

Thanks for reporting this bug. Offhand it's not entirely clear what happened, however the error message "Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend" generally crops up when two apt processes collide, such as a user-requested apt operation while unattended-upgrade is running (or vice versa maybe). From the log files I can't identify if that was the case. The mysql error log shows a couple other errors:

2021-12-05T08:15:14.339858Z 0 [ERROR] [MY-011292] [Server] Plugin mysqlx reported: 'Preparation of I/O interfaces failed, X Protocol won't be accessible'
2021-12-05T08:15:14.339935Z 0 [ERROR] [MY-011300] [Server] Plugin mysqlx reported: 'Setup of socket: '/var/run/mysqld/mysqlx.sock' failed, can't create lock file /var/run/mysqld/mysqlx.sock.lock'
2021-12-05T08:17:19.168919Z 4 [System] [MY-013381] [Server] Server upgrade from '80026' to '80027' started.
2021-12-05T08:25:19.923278Z 4 [System] [MY-013381] [Server] Server upgrade from '80026' to '80027' completed.

Hopefully you've already resolved this problem, but if not there are many support articles on how to fix the locking situation in general, such as https://askubuntu.com/questions/1109982/e-could-not-get-lock-var-lib-dpkg-lock-frontend-open-11-resource-temporari

Feel free to add clarification if I've missed something. In particular, it would be super helpful to understand how to reproduce this particular broken condition.

I suspect whatever situation led to the locking issue is unrelated to mysql. However, we may want to adjust the mysql apport hook to not trigger bug reports for this type of issue.

Bryce Harrington (bryce)
Changed in mysql-8.0 (Ubuntu):
status: New → Triaged
summary: package mysql-server-8.0 8.0.27-0ubuntu0.20.04.1 failed to
- install/upgrade: Unable to shut down server, could not get cache lock
+ install/upgrade: Unable to shut down server, could not get apt cache
+ lock
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.