Description of problem: Mariadb server fail to start after fresh install Version-Release number of selected component (if applicable): mariadb-server-10.1.17-1.fc24.x86_64 How reproducible: Always Reproduceble Steps to Reproduce: 1. Install Fedora 24 2. Install mariadb-server 3. make "systemctl start mariadb" Actual results: Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details. Expected results: The service is started Additional info: /usr/lib/systemd/system/mariadb.service has ExecStartPre=/usr/libexec/mysql-prepare-db-dir /usr/libexec/mysql-prepare-db-dir failed. How to fix: --- /usr/libexec/mysql-prepare-db-dir.orig 2016-10-09 00:27:56.258271675 +0300 +++ /usr/libexec/mysql-prepare-db-dir 2016-10-09 00:26:32.261895113 +0300 @@ -20,7 +20,7 @@ should_initialize () { case `ls_check_datadir "$1"` in - ""|lost+found) true ;; + ""|lost+found|*.err) true ;; *) false ;; esac }
It works in my case on really fresh machine, so your machine was not as clear as mine :) Is it the reason of failing that there has been some log file from previous run, in the /var/lib/mysql directory?
This error is happens when /var/lib/mysql is empty. You can look into /usr/libexec/mysql-prepare-db-dir 1. The script creates errorlog at line 59 # Set up the errlogfile with appropriate permissions touch "$errlogfile" ret=$? 2. The script calls should_initialize() at line 79 ===== unpatched variant at line 20 should_initialize () { case `ls_check_datadir "$1"` in ""|lost+found) true ;; *) false ;; esac } ==== 3. should_initialize return false, because error log is created at step 1 4. The script skip lines 80..122 ("Initializing MariaDB database") and jumps to line 124 ("Database MariaDB is probably initialized in $datadir already, nothing is done."). But database is NOT initialized, only error log was created. My package is mariadb-server-10.1.17-1.fc24.x86_64 Your installation works, because your error log file is placed outside /var/lib/mysql via option log-error=/var/log/mariadb/mariadb.log in /etc/my.cnf.d/mariadb-server.cnf I use config file, based on /usr/share/mariadb/my-innodb-heavy-4G.cnf, without this option.
This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component.
You are right. It is unusual use-case, but it seems, nothing else should be impacted by your patch. I'll work on moving this patch into Rawhide. It should be released with 10.1.19.2, but I will notice you, when it comes live.
There is /usr/share/mariadb/my-innodb-heavy-4G.cnf in the mariadb package. Use case: 1. Install 2. Make config from my-innodb-heavy-4G.cnf I think, that log-error=/var/log/mariadb/mariadb.log option must be added into all config examples /usr/share/mariadb/*
I'm hitting the same problem in F25 because I'm also using a custom config with the log file in /var/lib/mysql/ Are there plans to get this patch into more than just rawhide or do I need to be fixing my config so that initialization doesn't blow up?
(In reply to Tim Flink from comment #6) > I'm hitting the same problem in F25 because I'm also using a custom config > with the log file in /var/lib/mysql/ > > Are there plans to get this patch into more than just rawhide or do I need > to be fixing my config so that initialization doesn't blow up? Reading that again, it sounds a bit more combative and less productive than I intended. I've already changed my config to move the log files in question. This took a bit longer to debug than I'd like to admit, though and it'd be nice to see the patch from the description applied to F24 and F25 and/or the example configs changed to move the log file. I also based my config off of an example from a past Fedora and I suspect that there are more of two of us who have.
I confirm that I plan to get this patch to all Fedora branches that use mariadb-10.1.* Actually, the suggested patch from [comment 1] is pushed to all - f24, f25, f26, but waiting to build. I would like to add missing options to all config examples in [comment 5], but it could take some time to find them all and test them. I can build current f25 branch for you, to have the patch faster, if you are interested.
I do most of my testing in COPR. Those builds could be what you are looking for: https://copr.fedorainfracloud.org/coprs/mschorm/MariaDB-F25/build/482243/ https://copr.fedorainfracloud.org/coprs/mschorm/MariaDB-F24/build/482244/ Those builds should contain patch in [comment 1], but not updated example config files. They are builded directly from content pushed in mariadb branches. Take a look, this could give me time to release this bugfix as a one.
https://bodhi.fedoraproject.org/updates/FEDORA-2016-a4879d8f3a https://bodhi.fedoraproject.org/updates/FEDORA-2016-96c333c654
Both builds has been successfully pushed to the stable repository.