package mysql-server-5.7 5.7.21-0ubuntu0.16.04.1 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1 - nonstandard location

Bug #1748654 reported by Sandor
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mysql-5.7 (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

Modified the file
vi /etc/apparmor.d/tunables/alias

# Or if mysql databases are stored in /home:
alias /var/lib/mysql/ to an exist folder

ProblemType: Package
DistroRelease: Ubuntu 16.04
Package: mysql-server-5.7 5.7.21-0ubuntu0.16.04.1
ProcVersionSignature: Ubuntu 4.13.0-32.35~16.04.1-generic 4.13.13
Uname: Linux 4.13.0-32-generic i686
ApportVersion: 2.20.1-0ubuntu2.15
Architecture: i386
Date: Sat Feb 10 18:51:28 2018
ErrorMessage: subprocess installed post-installation script returned error exit status 1
InstallationDate: Installed on 2018-02-07 (2 days ago)
InstallationMedia: Ubuntu 16.04.3 LTS "Xenial Xerus" - Release i386 (20170801)
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.mysql.conf.d.mysqld_safe_syslog.cnf:
 [mysqld_safe]
 syslog
MySQLVarLibDirListing: ['debian-5.7.flag']
ProcCmdline: BOOT_IMAGE=/boot/vmlinuz-4.13.0-32-generic root=UUID=df742cda-13e9-424e-8bc6-2232223413b9 ro quiet splash vt.handoff=7
RelatedPackageVersions:
 dpkg 1.18.4ubuntu1.3
 apt 1.2.24
SourcePackage: mysql-5.7
Title: package mysql-server-5.7 5.7.21-0ubuntu0.16.04.1 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Sandor (cservencsik-sandor) wrote :
tags: removed: need-duplicate-check
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Yeah it fails to (re)start in your case.

From your mysql log:
2018-02-10T17:30:08.421243Z 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2018-02-10T17:30:08.421273Z 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2018-02-10T17:30:08.421297Z 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2018-02-10T17:30:08.421319Z 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2018-02-10T17:30:08.421340Z 0 [ERROR] InnoDB: Cannot open datafile './ibdata1'
2018-02-10T17:30:08.421364Z 0 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!
2018-02-10T17:30:08.421389Z 0 [ERROR] InnoDB: InnoDB Database creation was aborted with error Cannot open a file. You may need to delete the ibdata1 file before trying to start up again.

And very very likely related to that apparmor denies:
[17112.114807] audit: type=1400 audit(1518282130.859:38): apparmor="DENIED" operation="mknod" profile="/usr/sbin/mysqld" name="/db/mysql/N200.lower-test" pid=16095 comm="mysqld" requested_mask="c" denied_mask="c" fsuid=125 ouid=125
[17112.303168] audit: type=1400 audit(1518282131.047:39): apparmor="DENIED" operation="mknod" profile="/usr/sbin/mysqld" name="/db/mysql/N200.lower-test" pid=16095 comm="mysqld" requested_mask="c" denied_mask="c" fsuid=125 ouid=125
[17112.303241] audit: type=1400 audit(1518282131.047:40): apparmor="DENIED" operation="mknod" profile="/usr/sbin/mysqld" name="/db/mysql/N200.lower-test" pid=16095 comm="mysqld" requested_mask="c" denied_mask="c" fsuid=125 ouid=125

So your alias file /etc/apparmor.d/tunables/alias should maybe look like:
  alias /var/lib/mysql/ -> /db/mysql/,

It isn't attached, is that your content?

Changed in mysql-5.7 (Ubuntu):
status: New → Incomplete
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better.

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

If your file has the expected content we'd be grateful if you would then provide a more complete description of the problem, explain why you believe this is a bug in Ubuntu rather than a problem specific to your system configuration, and then change the bug status back to New.

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

[Expired for mysql-5.7 (Ubuntu) because there has been no activity for 60 days.]

Changed in mysql-5.7 (Ubuntu):
status: Incomplete → Expired
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.