mysql server crashes with port 3306 already in use
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mysql-8.0 (Ubuntu) |
Fix Released
|
High
|
Lena Voytek | ||
Focal |
Fix Released
|
High
|
Lena Voytek | ||
Impish |
Won't Fix
|
High
|
Lena Voytek | ||
Jammy |
Fix Released
|
High
|
Lena Voytek |
Bug Description
[Impact]
When a user attepts to install mysql-server to their system, there is a chance that it will fail due to a race condition in the post-install script.
In this situation, the user will be provided with the error:
dpkg: error processing package mysql-server-8.0 (--configure):
installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1
The only way to fix this is to uninstall then retry the install again.
The provided fix resolves the race condition by making sure mysql is shut down completely after setup before it boots back up again for use by the user.
[Test Plan]
Since this is a race condition, it can take a while to reproduce. However, using less cores and lower CPU speeds makes it appear more often. Testing with the following code many times will eventually show that, prior to the update, this issue appears. Meanwhile after the update it does not.
# lxc launch images:
# lxc exec test-mysql bash
# apt update && apt dist-upgrade -y
# apt install mysql-server
[Where problems could occur]
Since this update has the postinst script enforce shutdown after configuration, mysql may be cut off abruptly, which could cause internal problems that it may need to address on the following startup.
[Other Info]
The fix was released to kinetic in 8.0.29-0ubuntu4
[Original Description]
mysql server not running
ProblemType: Package
DistroRelease: Ubuntu 20.04
Package: mysql-server-8.0 8.0.23-
ProcVersionSign
Uname: Linux 5.8.0-48-generic x86_64
ApportVersion: 2.20.11-
Architecture: amd64
CasperMD5CheckR
Date: Thu Mar 25 15:33:48 2021
ErrorMessage: installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1
InstallationDate: Installed on 2021-03-24 (0 days ago)
InstallationMedia: Ubuntu 20.04.2.0 LTS "Focal Fossa" - Release amd64 (20210209.1)
Logs.var.
MySQLConf.
MySQLConf.
[mysqldump]
quick
quote-names
max_allowed_packet = 16M
MySQLVarLibDirL
ProcCmdline: BOOT_IMAGE=
Python3Details: /usr/bin/python3.8, Python 3.8.5, python3-minimal, 3.8.2-0ubuntu2
PythonDetails: N/A
RelatedPackageV
dpkg 1.19.7ubuntu3
apt 2.0.4
SourcePackage: mysql-8.0
Title: package mysql-server-8.0 8.0.23-
UpgradeStatus: No upgrade log present (probably fresh install)
Related branches
- Bryce Harrington (community): Approve
- Canonical Server Reporter: Pending requested
-
Diff: 44 lines (+16/-1)2 files modifieddebian/changelog (+7/-0)
debian/mysql-server-8.0.postinst (+9/-1)
- Robie Basak: Approve
- git-ubuntu bot: Approve
- Canonical Server Reporter: Pending requested
-
Diff: 44 lines (+16/-1)2 files modifieddebian/changelog (+7/-0)
debian/mysql-server-8.0.postinst (+9/-1)
- git-ubuntu bot: Approve
- Christian Ehrhardt (community): Approve
- Canonical Server Reporter: Pending requested
-
Diff: 65 lines (+25/-2)3 files modifieddebian/additions/source_mysql-8.0.py (+7/-1)
debian/changelog (+9/-0)
debian/mysql-server-8.0.postinst (+9/-1)
- git-ubuntu bot: Approve
- Robie Basak: Approve
- Canonical Server Reporter: Pending requested
- Canonical Server Reporter: Pending requested
- Canonical Server Reporter: Pending requested
- Canonical Server: Pending requested
-
Diff: 44 lines (+16/-1)2 files modifieddebian/changelog (+7/-0)
debian/mysql-server-8.0.postinst (+9/-1)
tags: | removed: need-duplicate-check |
Changed in mysql-8.0 (Ubuntu): | |
status: | Confirmed → In Progress |
summary: |
- package mysql-server-8.0 8.0.23-0ubuntu0.20.04.1 failed to - install/upgrade: installed mysql-server-8.0 package post-installation - script subprocess returned error exit status 1 + mysql server crashes with port 3306 already in use |
Changed in mysql-8.0 (Ubuntu Focal): | |
status: | New → Confirmed |
Changed in mysql-8.0 (Ubuntu Jammy): | |
status: | New → Confirmed |
Changed in mysql-8.0 (Ubuntu Focal): | |
assignee: | nobody → Lena Voytek (lvoytek) |
Changed in mysql-8.0 (Ubuntu Impish): | |
assignee: | nobody → Lena Voytek (lvoytek) |
Changed in mysql-8.0 (Ubuntu Jammy): | |
assignee: | nobody → Lena Voytek (lvoytek) |
Changed in mysql-8.0 (Ubuntu Focal): | |
status: | Confirmed → In Progress |
Changed in mysql-8.0 (Ubuntu Impish): | |
status: | Confirmed → In Progress |
Changed in mysql-8.0 (Ubuntu Jammy): | |
status: | Confirmed → In Progress |
Changed in mysql-8.0 (Ubuntu Focal): | |
importance: | Undecided → High |
Changed in mysql-8.0 (Ubuntu Impish): | |
importance: | Undecided → High |
Changed in mysql-8.0 (Ubuntu Jammy): | |
importance: | Undecided → High |
description: | updated |
tags: | removed: verification-needed |
Hello Raghvendra,
Thanks for taking out time to file a bug and making Ubuntu server better.
This bug is a duplicate of LP: #1899248 (cf: https:/ /bugs.launchpad .net/ubuntu/ +source/ mysql-8. 0/+bug/ 1899248) and thus I've marked the same. This is being worked out and people are aware of this already.
In case you think this isn't a duplicate or should you need any further assistance, please don't hesitate to reach out. Thanks, again.