apport hook fails if '/etc/mysql/conf.d' or '/etc/mysql/mysql.conf.d' don't exist
Bug #1922412 reported by
Bryce Harrington
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mysql-8.0 (Ubuntu) |
Fix Released
|
Undecided
|
Bryce Harrington |
Bug Description
As seen in https:/
Traceback (most recent call last):
File "/usr/lib/
symb[
File "/usr/share/
for f in os.listdir(d):
FileNotFoundError: [Errno 2] No existe el archivo o el directorio: '/etc/mysql/conf.d'
Related branches
~bryce/ubuntu/+source/mysql-8.0:fix-apport-hook-issues
Merged
into
ubuntu/+source/mysql-8.0:ubuntu/devel
at
revision c9edd2a77629ece4e0ac73735361f1bcc1dde9e6
- Lena Voytek (community): Approve
- Canonical Server packageset reviewers: Pending requested
- Canonical Server: Pending requested
-
Diff: 118 lines (+59/-16)2 files modifieddebian/additions/source_mysql-8.0.py (+46/-16)
debian/changelog (+13/-0)
Changed in mysql-8.0 (Ubuntu): | |
assignee: | nobody → Utkarsh Gupta (utkarsh) |
Changed in mysql-8.0 (Ubuntu): | |
status: | Triaged → Fix Committed |
assignee: | Utkarsh Gupta (utkarsh) → Bryce Harrington (bryce) |
To post a comment you must log in.
Hello Bryce,
Thanks for taking the time to file a bug and making Ubuntu server better! ^.^
In my opinion, I'd expect those two directories to be there, if they're not, then there's something wrong, really. Either a user manipulation or whatever. Maybe instead of the hook failing, it could gracefully exit, mentioning that both the directories aren't present which is somewhat unusual.
The code comes from debian/ additions/ source_ mysql-8. 0.py: mysql/conf. d', '/etc/mysql/ mysql.conf. d']: conf_files( report, os.path.join(d, f))
55 for d in ['/etc/
56 for f in os.listdir(d):
57 _add_my_
...maybe this could be be changed to something like: additions/ source_ mysql-8. 0.py additions/ source_ mysql-8. 0.py my_conf_ files(report, '/etc/mysql/ mysql.cnf' ) mysql/conf. d', '/etc/mysql/ mysql.conf. d']: conf_files( report, os.path.join(d, f)) conf_files( report, os.path.join(d, f)) mysql.conf. d should be present, exiting..")
report[ 'MySQLVarLibDir Listing' ] = str(os. listdir( '/var/lib/ mysql') )
```
--- a/debian/
+++ b/debian/
@@ -54,7 +54,10 @@ def add_info(report):
_add_
for d in ['/etc/
for f in os.listdir(d):
- _add_my_
+ try:
+ _add_my_
+ except FileNotFoundError:
+ print("Either of /etc/mysql/conf.d or /etc/mysql/
try:
except OSError:
```
what do you think?