Bug 1392203 - mariadb permissions don't allow access to /var/lib/mysql
Summary: mariadb permissions don't allow access to /var/lib/mysql
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: mariadb
Version: 25
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Michal Schorm
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: AcceptedFreezeException
Depends On:
Blocks: F25FinalFreezeException
TreeView+ depends on / blocked
 
Reported: 2016-11-06 03:40 UTC by Geoffrey Marr
Modified: 2023-09-14 03:33 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-30 13:51:30 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
journalctl -xe (1.89 KB, text/x-vhdl)
2016-11-06 03:40 UTC, Geoffrey Marr
no flags Details

Description Geoffrey Marr 2016-11-06 03:40:46 UTC
Created attachment 1217671 [details]
journalctl -xe

Description of problem:

Installed Fedora-Server-25-20161102-x86_64-dvd and installed mariadb. Attemped to run 'mysql' from the CLI and encountered error:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2 "No such file or directory")

Attempted manually starting mariadb.service. No dice, checked the log and found this:

-- Unit mariadb.service has begun starting up.
Nov 04 12:13:52 localhost.localdomain mysql-prepare-db-dir[3205]: chown: changing ownership of '/var/lib/mysql': Operation not permitted
Nov 04 12:13:52 localhost.localdomain mysql-prepare-db-dir[3205]: chmod: changing permissions of '/var/lib/mysql': Operation not permitted
Nov 04 12:13:52 localhost.localdomain mysql-prepare-db-dir[3205]: /sbin/restorecon set context /var/lib/mysql->unconfined_u:object_r:mysqld_db_t:s0 failed:'Operation not permitted'
Nov 04 12:13:52 localhost.localdomain mysql-prepare-db-dir[3205]: Initializing MariaDB database
Nov 04 12:13:53 localhost.localdomain mysql-prepare-db-dir[3205]: chown: changing ownership of '/var/lib/mysql': Operation not permitted
Nov 04 12:13:53 localhost.localdomain mysql-prepare-db-dir[3205]: Cannot change ownership of the database directories to the 'mysql'
Nov 04 12:13:53 localhost.localdomain mysql-prepare-db-dir[3205]: user.  Check that you have the necessary permissions and try again.
Nov 04 12:13:53 localhost.localdomain mysql-prepare-db-dir[3205]: Initialization of MariaDB database failed.
Nov 04 12:13:53 localhost.localdomain mysql-prepare-db-dir[3205]: Perhaps /etc/my.cnf is misconfigured or there is some problem with permissions of /var/lib/mysql.
Nov 04 12:13:53 localhost.localdomain mysql-prepare-db-dir[3205]: Initialization of MariaDB database was not finished successfully.
Nov 04 12:13:53 localhost.localdomain mysql-prepare-db-dir[3205]: Files created so far will be removed.
Nov 04 12:13:53 localhost.localdomain audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=mariadb comm="systemd" exe="/usr/lib/systemd/systemd" hostname=
Nov 04 12:13:53 localhost.localdomain systemd[1]: mariadb.service: Control process exited, code=exited status=1
Nov 04 12:13:53 localhost.localdomain systemd[1]: Failed to start MariaDB 10.1 database server.

Version-Release number of selected component (if applicable):


How reproducible:

Always


Steps to Reproduce:
1. Install Fedora-Server-25-20161102-x86_64-dvd
2. '$ sudo dnf install mariadb'
3. '$ mysql'

Actual results:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2 "No such file or directory")

Expected results:
mysql should successfully start.

Additional info:

Comment 1 Geoffrey Marr 2016-11-06 03:41:49 UTC
mariadb version 10.1.18-1.fc25

Comment 2 Fedora Blocker Bugs Application 2016-11-06 03:44:08 UTC
Proposed as a Freeze Exception for 25-final by Fedora user coremodule using the blocker tracking app because:

 Proposing as F25-Final Freeze Exception as this bug prohibits the user from starting 'mariadb.service' and 'mysql'. It would be nice to have fixed for the final release as many apps depend on mariadb for database interaction.

Comment 3 Geoffrey Marr 2016-11-07 18:39:45 UTC
Tested with mariadb-10.1.17-1.fc25 and mariadb-10.1.14-5.fc24 and did not encounter this issue. This seems to have occurred between 10.1.17-1 and 10.1.18-1.

Comment 4 Geoffrey Marr 2016-11-08 01:03:43 UTC
Discussed during the 2016-11-07 blocker review meeting: [1]

The decision was made to classify this bug as an AcceptedFreezeException.

[1] https://meetbot.fedoraproject.org/fedora-blocker-review/2016-11-07/f25-blocker-review.2016-11-07-17.01.txt

Comment 5 Fedora Admin XMLRPC Client 2016-11-15 10:33:01 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 6 Michal Schorm 2016-11-16 08:03:40 UTC
I'm trying to make live 1.19 release.

I encountered this issue with 1.19 too, so I'm going to have my eye on it.

Comment 7 Michal Schorm 2016-11-16 09:10:49 UTC
First of all, I will write down basic use of MariaDB.

1) dnf install mariadb
 - now you have mariadb client

2) dnf install mariadb-serever
 - to initiate some communication, you need serever first.

3) systemctl start mariadb
 - server is installed, now you need to start it
 - when serever starts, it will create /var/lib/mysql/mysql.sock, so local communication can be initiated

4) mysql
 - start client
_____________________________________

Server can't be accessed without server installed, or started.
Socket for local communication is created, when serevrt starts.
_____________________________________

Reproducer, as you wrote it, doesn't lead to broken state.

I'll mark this bug as needinfo, in case you meant something else.
If you agree, write down confirmation, and I'll close it as a NOTABUG.

Comment 8 Michal Schorm 2016-11-30 13:51:30 UTC
Now, after 2 weeks, I'm closing this as a NOTABUG.

If you don't agree with the reason in comment 7, or you meant something different, feel free to re-open this bug for further discussion.

Comment 9 Red Hat Bugzilla 2023-09-14 03:33:56 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days


Note You need to log in before you can comment on or make changes to this bug.