mysql-server apport fails to report my.cnf

Bug #1969369 reported by Lena Voytek
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mysql-8.0 (Ubuntu)
Fix Released
Undecided
Lena Voytek
Focal
In Progress
Undecided
Lena Voytek
Impish
Won't Fix
Undecided
Lena Voytek
Jammy
Fix Released
Undecided
Lena Voytek

Bug Description

[Impact]

Whenever a mysql crash is reported to Launchpad through apport, the my.cnf attachment will often report back as:
MySQLConf.etc.mysql.my.cnf: Error: [Errno 40] Too many levels of symbolic links: '/etc/mysql/my.cnf'

This makes it difficult to debug a user's configuration issues, and can lead to an incorrect triage of the issue by those unfamiliar with mysql's apport reports.

The provided fix shows what my.cnf links to if it is a symbolic link, or outputs the content of the file if has been customized.

[Test Plan]

To test, create a local apport report of mysql-server:

# lxc launch images:ubuntu/[kinetic, jammy, impish, focal] test-mysql
# lxc exec test-mysql bash

# apt update && apt dist-upgrade -y

# apt install apport mysql-server

# ubuntu-bug mysql-server
V
- Under the my.cnf section the too many symbolic links error will be shown
C

[Where problems could occur]

Now that the apport script follows symlinks to find the actual contents of my.cnf, additional errors could be caused while the crash report is generated.

[Other Info]

This fix was uploaded to kinetic in 8.0.29-0ubuntu3

[Original Description]

Whenever an apport report is made for mysql-8.0 my.cnf goes unreported with the following message:

MySQLConf.etc.mysql.my.cnf: Error: [Errno 40] Too many levels of symbolic links: '/etc/mysql/my.cnf'

See the auto-generated report below which contains this. The report is from a focal vm with no other errors reported.

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: mysql-server 8.0.28-0ubuntu0.20.04.3
ProcVersionSignature: User Name 5.4.0-107.121-generic 5.4.174
Uname: Linux 5.4.0-107-generic x86_64
ApportVersion: 2.20.11-0ubuntu27.23
Architecture: amd64
CasperMD5CheckResult: skip
Date: Mon Apr 18 08:57:38 2022
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: False
PackageArchitecture: all
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=C.UTF-8
 SHELL=/bin/bash
SourcePackage: mysql-8.0
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

Revision history for this message
Lena Voytek (lvoytek) wrote :
Changed in mysql-8.0 (Ubuntu):
assignee: nobody → Lena Voytek (lvoytek)
Lena Voytek (lvoytek)
Changed in mysql-8.0 (Ubuntu):
status: New → In Progress
Lena Voytek (lvoytek)
Changed in mysql-8.0 (Ubuntu Focal):
status: New → In Progress
Changed in mysql-8.0 (Ubuntu Impish):
status: New → In Progress
Changed in mysql-8.0 (Ubuntu Focal):
assignee: nobody → Lena Voytek (lvoytek)
Changed in mysql-8.0 (Ubuntu Impish):
assignee: nobody → Lena Voytek (lvoytek)
Revision history for this message
Lena Voytek (lvoytek) wrote :

This error seems to show up because my.cnf has two levels of symbolic link:

my.cnf -> /etc/alternatives/my.cnf -> /etc/mysql/mysql.cnf

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mysql-8.0 - 8.0.29-0ubuntu3

---------------
mysql-8.0 (8.0.29-0ubuntu3) kinetic; urgency=medium

  * d/a/source_mysql-8.0.py: Fix apport too many symbolic
    links report for my.cnf (LP: #1969369)

 -- Lena Voytek <email address hidden> Thu, 12 May 2022 09:00:19 -0700

Changed in mysql-8.0 (Ubuntu):
status: In Progress → Fix Released
Lena Voytek (lvoytek)
description: updated
Revision history for this message
Steve Langasek (vorlon) wrote : Please test proposed package

Hello Lena, or anyone else affected,

Accepted mysql-8.0 into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/mysql-8.0/8.0.29-0ubuntu0.22.04.3 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in mysql-8.0 (Ubuntu Jammy):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-jammy
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (mysql-8.0/8.0.29-0ubuntu0.22.04.3)

All autopkgtests for the newly accepted mysql-8.0 (8.0.29-0ubuntu0.22.04.3) for jammy have finished running.
The following regressions have been reported in tests triggered by the package:

exim4/4.95-4ubuntu2.1 (ppc64el)
ruby-mysql2/0.5.3-3ubuntu4 (armhf, amd64, s390x, arm64, ppc64el)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/jammy/update_excuses.html#mysql-8.0

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Lena Voytek (lvoytek) wrote :

Impish support ending in a few days, marked as wont fix

Changed in mysql-8.0 (Ubuntu Impish):
status: In Progress → Won't Fix
Revision history for this message
Lena Voytek (lvoytek) wrote :

Verified the fix works through the following:

# lxc launch images:ubuntu/jammy test-jammy
# lxc exec test-jammy bash

# apt update && apt dist-upgrade -y

# apt install apport mysql-server software-properties-common

# ubuntu-bug mysql-server
V
- Under the my.cnf section the too many symbolic links error will be shown
C

# add-apt-repository ppa:lvoytek/mysql-8.0-fix-apport-my-cnf-kinetic

# cat <<EOF >/etc/apt/sources.list.d/ubuntu-$(lsb_release -cs)-proposed.list
# Enable Ubuntu proposed archive
deb http://archive.ubuntu.com/ubuntu/ $(lsb_release -cs)-proposed restricted main multiverse universe
EOF

# apt update && apt upgrade -y

# export APPORT_DISABLE_DISTRO_CHECK=1

- Check default config
# ubuntu-bug mysql-server
V
- The my.cnf section will now show "MySQLConf.etc.mysql.my.cnf: my.cnf links to /etc/mysql/mysql.cnf"
C

- Check custom config
# rm /etc/mysql/my.cnf
# cp /etc/mysql/mysql.cnf /etc/mysql/my.cnf

# ubuntu-bug mysql-server
V
- The my.cnf section will now show the contents of the file
C

tags: added: verification-done-jammy
removed: verification-needed-jammy
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mysql-8.0 - 8.0.29-0ubuntu0.22.04.3

---------------
mysql-8.0 (8.0.29-0ubuntu0.22.04.3) jammy; urgency=medium

  * d/a/source_mysql-8.0.py: Fix apport too many symbolic
    links report for my.cnf (LP: #1969369)
  * d/mysql-server-8.0.postinst: Confirm mysqld shuts down with stop_server
    after initialization to avoid overlapping use of port 3306 (LP: #1921378)

 -- Lena Voytek <email address hidden> Mon, 27 Jun 2022 10:55:12 -0700

Changed in mysql-8.0 (Ubuntu Jammy):
status: Fix Committed → Fix Released
Revision history for this message
Robie Basak (racb) wrote : Update Released

The verification of the Stable Release Update for mysql-8.0 has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

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.