Apport hook failures: missing conf dir; add_info() takes 1 positional argument but 2 were given

Bug #1958641 reported by Jarjan Fisher
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mysql-8.0 (Ubuntu)
Fix Released
Medium
Bryce Harrington

Bug Description

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport/report.py", line 228, in _run_hook
    symb['add_info'](report, ui)
TypeError: add_info() takes 1 positional argument but 2 were given

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport/report.py", line 233, in _run_hook
    symb['add_info'](report)
  File "/usr/share/apport/package-hooks/source_mysql-8.0.py", line 56, in add_info
    for f in os.listdir(d):
FileNotFoundError: [Errno 2] No such file or directory: '/etc/mysql/conf.d'

### Original Report ###
Tried re-installing mysql server after uninstalling

ProblemType: Package
DistroRelease: Ubuntu 20.04
Package: mysql-server-8.0 8.0.27-0ubuntu0.20.04.1
ProcVersionSignature: Ubuntu 5.13.0-27.29~20.04.1-generic 5.13.19
Uname: Linux 5.13.0-27-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.20.11-0ubuntu27.21
Architecture: amd64
CasperMD5CheckResult: skip
Date: Fri Jan 21 12:49:56 2022
ErrorMessage: installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1
InstallationDate: Installed on 2022-01-15 (5 days ago)
InstallationMedia: Ubuntu 20.04.3 LTS "Focal Fossa" - Release amd64 (20210819)
Logs.var.log.daemon.log:

Logs.var.log.mysql.error.log:
MySQLConf.etc.mysql.my.cnf: Error: [Errno 40] Too many levels of symbolic links: '/etc/mysql/my.cnf'
ProcCmdline: BOOT_IMAGE=/boot/vmlinuz-5.13.0-27-generic root=UUID=ca44c4aa-b984-4c55-b9be-a12dcc4637ed 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)

Related branches

Revision history for this message
Jarjan Fisher (jjf-f) wrote :
Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

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

Looking at your DpkgTerminalLog.txt file, I see the following excerpt:

Setting up mysql-server-8.0 (8.0.27-0ubuntu0.20.04.1) ...
update-alternatives: warning: alternative /etc/mysql/mariadb.cnf (part of link group my.cnf) doesn't exist; removing from list of alternatives
update-alternatives: warning: alternative /etc/mysql/my.cnf.fallback (part of link group my.cnf) doesn't exist; removing from list of alternatives
update-alternatives: warning: /etc/alternatives/my.cnf is dangling; it will be updated with best choice
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Renaming removed key_buffer and myisam-recover options (if present)
ERROR: Unable to start MySQL server:
mysqld: Can't read dir of '/etc/mysql/conf.d/' (OS errno 2 - No such file or directory)
mysqld: [ERROR] Stopped processing the 'includedir' directive in file /etc/mysql/my.cnf at line 20.
mysqld: [ERROR] Fatal error in defaults handling. Program aborted!
Please take a look at https://wiki.debian.org/Teams/MySQL/FAQ for tips on fixing common upgrade issues.
Once the problem is resolved, run apt-get --fix-broken install to retry.
dpkg: error processing package mysql-server-8.0 (--configure):
 installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1

This tells me a few things:

1) You probably had (or still have) MariaDB installed. MySQL will conflict with MariaDB and they will not play well together. I would recommend that you purge your MariaDB installation before proceeding with the MySQL one. However, if you already have both MySQL and MariaDB installed and you purged MariaDB, this will have the side effect of purging files that are actually needed by MySQL (for example, configuration files; see below). In this scenario, when you upgrade MySQL after having purged MariaDB, you will unfortunately see errors like you saw above.

2) mysqld (MySQL's daemon) expects to find the directory /etc/mysql/conf.d/, but in your scenario the directory did not exist. This was probably caused by purging MariaDB before upgrading the MySQL package.

Since it seems likely to me that this is a local configuration problem,
rather than a bug in Ubuntu, I am marking this bug as 'Incomplete'.

However, if you believe that this is really a bug in Ubuntu, then we would
be grateful if you would provide a more complete description of the problem
with steps to reproduce, 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
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
+ Apport hook failures: missing conf dir; add_info() takes 1 positional
+ argument but 2 were given
Changed in mysql-8.0 (Ubuntu):
status: Incomplete → Triaged
importance: Undecided → Medium
Revision history for this message
Bryce Harrington (bryce) wrote :

By chance, when you reinstalled did you manually delete /etc/mysql/conf.d? (The installer might not be accounting for manual steps done when removing the old package.)

Also, at one point did you have mariadb installed? I notice a mention in your logs:

Start-Date: 2022-01-16 18:13:21
Commandline: apt install libmariadb-dev
Requested-By: jarjan (1000)

(mariadb is known to interfere with mysql since they have some files named the same way. To work around that it can be worth force purging mariadb before fresh-installing mysql, and vice versa.)

Changed in mysql-8.0 (Ubuntu):
status: Triaged → Incomplete
Bryce Harrington (bryce)
Changed in mysql-8.0 (Ubuntu):
assignee: nobody → Bryce Harrington (bryce)
status: Incomplete → New
Bryce Harrington (bryce)
Changed in mysql-8.0 (Ubuntu):
status: New → Fix Committed
Revision history for this message
Jarjan Fisher (jjf-f) wrote : Re: [Bug 1958641] Re: Apport hook failures: missing conf dir; add_info() takes 1 positional argument but 2 were given
Download full text (3.4 KiB)

Thanks for the work and the updates.

I know I'm responding very late but to answer earlier questions:
I did not do any manual deletion of directories after uninstalling
But I did install the MariaDB package in R (through R Studio). So maybe the error did have something to do with the difficulties that MySQL and MariaDB have together.

I manually recreated the missing directory, after that the install did seem to work. But I've not really used MySQL since. (I installed it as part of a course in R that in following.)

Hope that helps, thanks again!
JJ

--
Jarjan Fisher

W: www.jarjan.net
T: @JarjanF

W: www.iomm.net
I: images.on.my.mind

E: <email address hidden>

On Tue, 22 Feb 2022, at 21:12, Bryce Harrington wrote:
> ** Changed in: mysql-8.0 (Ubuntu)
> Status: New => Fix Committed
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1958641
>
> Title:
> Apport hook failures: missing conf dir; add_info() takes 1 positional
> argument but 2 were given
>
> Status in mysql-8.0 package in Ubuntu:
> Fix Committed
>
> Bug description:
>
> Traceback (most recent call last):
> File "/usr/lib/python3/dist-packages/apport/report.py", line 228,
> in _run_hook
> symb['add_info'](report, ui)
> TypeError: add_info() takes 1 positional argument but 2 were given
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
> File "/usr/lib/python3/dist-packages/apport/report.py", line 233,
> in _run_hook
> symb['add_info'](report)
> File "/usr/share/apport/package-hooks/source_mysql-8.0.py", line
> 56, in add_info
> for f in os.listdir(d):
> FileNotFoundError: [Errno 2] No such file or directory:
> '/etc/mysql/conf.d'
>
>
> ### Original Report ###
> Tried re-installing mysql server after uninstalling
>
> ProblemType: Package
> DistroRelease: Ubuntu 20.04
> Package: mysql-server-8.0 8.0.27-0ubuntu0.20.04.1
> ProcVersionSignature: Ubuntu 5.13.0-27.29~20.04.1-generic 5.13.19
> Uname: Linux 5.13.0-27-generic x86_64
> NonfreeKernelModules: nvidia_modeset nvidia
> ApportVersion: 2.20.11-0ubuntu27.21
> Architecture: amd64
> CasperMD5CheckResult: skip
> Date: Fri Jan 21 12:49:56 2022
> ErrorMessage: installed mysql-server-8.0 package post-installation
> script subprocess returned error exit status 1
> InstallationDate: Installed on 2022-01-15 (5 days ago)
> InstallationMedia: Ubuntu 20.04.3 LTS "Focal Fossa" - Release amd64
> (20210819)
> Logs.var.log.daemon.log:
>
> Logs.var.log.mysql.error.log:
> MySQLConf.etc.mysql.my.cnf: Error: [Errno 40] Too many levels of
> symbolic links: '/etc/mysql/my.cnf'
> ProcCmdline: BOOT_IMAGE=/boot/vmlinuz-5.13.0-27-generic
> root=UUID=ca44c4aa-b984-4c55-b9be-a12dcc4637ed 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-se...

Read more...

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

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

---------------
mysql-8.0 (8.0.28-0ubuntu3) jammy; urgency=medium

  * d/a/source_mysql-8.0.py: Improve apport hook
    - Update call signature for add_info() (LP: #1922413)
    - Skip non-existing conf dirs (LP: #1958641)
    - If /etc/mysql missing, ask confirmation (LP: #1922412)
    - Fix all lint/flakes warnings
      + python3 -m py_compile source_mysql-8.0.py
      + pyflakes3 source_mysql-8.0.py
      + pylint source_mysql-8.0.py

 -- Bryce Harrington <email address hidden> Wed, 16 Feb 2022 19:07:41 -0800

Changed in mysql-8.0 (Ubuntu):
status: Fix Committed → Fix Released
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.