Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 689412 - dev-db/mariadb-10.4.6 - pkg_config(): Failed to initialize mysqld. Please review /var/log/mysql/mysqld.err AND /var/tmp/portage/dev-db/mariadb-10.4.6/temp/mysql_install_db.log
Summary: dev-db/mariadb-10.4.6 - pkg_config(): Failed to initialize mysqld. Please rev...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Linux MySQL bugs team
URL:
Whiteboard:
Keywords:
: 689600 690158 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-07-07 15:33 UTC by klaus818
Modified: 2019-08-01 00:34 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
mariadb-10.4.6-fix-path.patch (mariadb-10.4.6-fix-path.patch,744 bytes, patch)
2019-07-21 21:38 UTC, Anna Tikhomirova
Details | Diff
mariadb-10.4.6.ebuild.patch (mariadb-10.4.6.ebuild.patch,1.07 KB, patch)
2019-07-21 21:39 UTC, Anna Tikhomirova
Details | Diff
mariadb-10.4.6.ebuild.patch (mariadb-10.4.6.ebuild.patch,1.51 KB, patch)
2019-07-21 22:36 UTC, Anna Tikhomirova
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description klaus818 2019-07-07 15:33:19 UTC
The result was:
emerge --config =dev-db/mariadb-10.4.6


Configuring pkg...

 * Trying to get password for mysql 'root' user from 'mysql' section ...
/var/tmp/portage/dev-db/mariadb-10.4.6/temp/environment: line 4319: usr/libexec/mariadb/my_print_defaults: No such file or directory
 * Trying to get password for mysql 'root' user from 'client' section ...
/var/tmp/portage/dev-db/mariadb-10.4.6/temp/environment: line 4319: usr/libexec/mariadb/my_print_defaults: No such file or directory
/var/tmp/portage/dev-db/mariadb-10.4.6/temp/environment: line 4319: usr/libexec/mariadb/my_print_defaults: No such file or directory
/var/tmp/portage/dev-db/mariadb-10.4.6/temp/environment: line 4319: usr/libexec/mariadb/my_print_defaults: No such file or directory
/var/tmp/portage/dev-db/mariadb-10.4.6/temp/environment: line 4319: usr/libexec/mariadb/my_print_defaults: No such file or directory
 * Please provide a password for the mysql 'root'@'localhost' user now
 * or through the /root/.my.cnf file.
 * Avoid ["'\_%] characters in the password
 * Not entering a password defaults to UNIX authentication
    >
 * Retype the password
    >
 * Creating the mysql database and setting proper permissions on it ...
 * Command: usr/bin/mysql_install_db --basedir=/usr --loose-skip-grant-tables --loose-skip-host-cache --loose-skip-name-resolve --loose-skip-networking --loose-skip-slave-start --loose-skip-ssl --loose-skip-log-bin --loose-skip-relay-log --loose-skip-slow-query-log --loose-skip-external-locking --loose-skip-log-slave-updates --datadir=//var/lib/mysql --tmpdir=/
 * ERROR: dev-db/mariadb-10.4.6::gentoo failed (config phase):
 *   Failed to initialize mysqld. Please review /var/log/mysql/mysqld.err AND /var/tmp/portage/dev-db/mariadb-10.4.6/temp/mysql_install_db.log
 * 
 * Call stack:
 *     ebuild.sh, line 125:  Called pkg_config
 *   environment, line 4446:  Called die
 * The specific snippet of code:
 *           die "Failed to initialize mysqld. Please review ${EPREFIX}/var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log";
 * 
 * If you need support, post the output of `emerge --info '=dev-db/mariadb-10.4.6::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-db/mariadb-10.4.6::gentoo'`.
!!! When you file a bug report, please include the following information:
GENTOO_VM=  CLASSPATH="" JAVA_HOME=""
JAVACFLAGS="" COMPILER=""
and of course, the output of emerge --info =mariadb-10.4.6
 * The complete build log is located at '/var/log/portage/dev-db:mariadb-10.4.6:20190707-152808.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-db/mariadb-10.4.6/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-db/mariadb-10.4.6/temp'
 * S: '/var/tmp/portage/dev-db/mariadb-10.4.6/work/mariadb-10.4.6'

The build log is:
* Trying to get password for mysql 'root' user from 'mysql' section ...
/var/tmp/portage/dev-db/mariadb-10.4.6/temp/environment: line 4319: usr/libexec/mariadb/my_print_defaults: No such file or directory
 * Trying to get password for mysql 'root' user from 'client' section ...
/var/tmp/portage/dev-db/mariadb-10.4.6/temp/environment: line 4319: usr/libexec/mariadb/my_print_defaults: No such file or directory
/var/tmp/portage/dev-db/mariadb-10.4.6/temp/environment: line 4319: usr/libexec/mariadb/my_print_defaults: No such file or directory
/var/tmp/portage/dev-db/mariadb-10.4.6/temp/environment: line 4319: usr/libexec/mariadb/my_print_defaults: No such file or directory
/var/tmp/portage/dev-db/mariadb-10.4.6/temp/environment: line 4319: usr/libexec/mariadb/my_print_defaults: No such file or directory
 * Please provide a password for the mysql 'root'@'localhost' user now
 * or through the /root/.my.cnf file.
 * Avoid ["'\_%] characters in the password
 * Not entering a password defaults to UNIX authentication
    >
 * Retype the password
    >
 * Creating the mysql database and setting proper permissions on it ...
 * Command: usr/bin/mysql_install_db --basedir=/usr --loose-skip-grant-tables --loose-skip-host-cache --loose-skip-name-resolve --loose-skip-networking --loose-skip-slave-start --loose-skip-ssl --loose-skip-log-bin --loose-skip-relay-log --loose-skip-slow-query-log --loose-skip-external-locking --loose-skip-log-slave-updates --datadir=//var/lib/mysql --tmpdir=/
 * ERROR: dev-db/mariadb-10.4.6::gentoo failed (config phase):
 *   Failed to initialize mysqld. Please review /var/log/mysql/mysqld.err AND /var/tmp/portage/dev-db/mariadb-10.4.6/temp/mysql_install_db.log
 * 
 * Call stack:
 *     ebuild.sh, line 125:  Called pkg_config
 *   environment, line 4446:  Called die
 * The specific snippet of code:
 *           die "Failed to initialize mysqld. Please review ${EPREFIX}/var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log";
 * 
 * If you need support, post the output of `emerge --info '=dev-db/mariadb-10.4.6::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-db/mariadb-10.4.6::gentoo'`.
!!! When you file a bug report, please include the following information:
GENTOO_VM=  CLASSPATH="" JAVA_HOME=""
JAVACFLAGS="" COMPILER=""
and of course, the output of emerge --info =mariadb-10.4.6
 * The complete build log is located at '/var/log/portage/dev-db:mariadb-10.4.6:20190707-152808.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-db/mariadb-10.4.6/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-db/mariadb-10.4.6/temp'
 * S: '/var/tmp/portage/dev-db/mariadb-10.4.6/work/mariadb-10.4.6'
Comment 1 Larry the Git Cow gentoo-dev 2019-07-08 13:21:26 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3a44bac7032fd5b21e884bff7c2a0afc37d9ddd9

commit 3a44bac7032fd5b21e884bff7c2a0afc37d9ddd9
Author:     Brian Evans <grknight@gentoo.org>
AuthorDate: 2019-07-08 13:13:08 +0000
Commit:     Brian Evans <grknight@gentoo.org>
CommitDate: 2019-07-08 13:21:04 +0000

    dev-db/mariadb: Fix EAPI 7 paths, drop client-libs USE
    
    Closes: https://bugs.gentoo.org/689412
    Package-Manager: Portage-2.3.68, Repoman-2.3.16
    Signed-off-by: Brian Evans <grknight@gentoo.org>

 dev-db/mariadb/mariadb-10.4.6.ebuild | 20 +++++---------------
 1 file changed, 5 insertions(+), 15 deletions(-)
Comment 2 Larry the Git Cow gentoo-dev 2019-07-08 13:27:17 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fcbd9a5ed9fbc9a4ae705885debe51f3b9c2bcd0

commit fcbd9a5ed9fbc9a4ae705885debe51f3b9c2bcd0
Author:     Brian Evans <grknight@gentoo.org>
AuthorDate: 2019-07-08 13:27:03 +0000
Commit:     Brian Evans <grknight@gentoo.org>
CommitDate: 2019-07-08 13:27:03 +0000

    dev-db/mariadb: Fix one further EAPI 7 path
    
    Bug: https://bugs.gentoo.org/689412
    Package-Manager: Portage-2.3.68, Repoman-2.3.16
    Signed-off-by: Brian Evans <grknight@gentoo.org>

 dev-db/mariadb/mariadb-10.4.6.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 3 klaus818 2019-07-08 15:17:24 UTC
i tried to rebuild mariadb after a sync. An the result was:

emerge -av1 mariadb   

These are the packages that would be merged, in order:

Calculating dependencies          ... done!              
[ebuild   R    ] dev-db/mariadb-10.4.6:0/18::gentoo  USE="backup pam perl server systemd xml -bindist -cracklib -debug -extraengine -galera -innodb-lz4 -innodb-lzo -innodb-snappy -jdbc -jemalloc -kerberos -latin1 -libressl -mroonga -numa -odbc -oqgraph -profiling -rocksdb (-selinux) -sphinx -sst-mariabackup -sst-rsync -static -systemtap -tcmalloc -test -tokudb -yassl (-client-libs%)" 0 KiB
[blocks B      ] dev-db/mariadb[client-libs(+)] ("dev-db/mariadb[client-libs(+)]" is blocking dev-db/mysql-connector-c-6.1.11-r1)

Total: 1 package (1 reinstall), Size of downloads: 0 KiB
Conflict: 1 block (1 unsatisfied)

 * Error: The above package list contains packages which cannot be
 * installed at the same time on the same system.

  (dev-db/mariadb-10.4.6:0/18::gentoo, ebuild scheduled for merge) pulled in by
    mariadb
    >=dev-db/mariadb-10.0[embedded(-)?,server?,static?] (>=dev-db/mariadb-10.0[server]) required by (virtual/mysql-5.6-r12:0/18::gentoo, installed)

  (dev-db/mysql-connector-c-6.1.11-r1:0/18::gentoo, installed) pulled in by
    dev-db/mysql-connector-c required by (dev-db/mysql-init-scripts-2.3:0/0::gentoo, installed)
    dev-db/mysql-connector-c:0/18[static-libs?,abi_x86_32(-)?,abi_x86_64(-)?,abi_x86_x32(-)?,abi_mips_n32(-)?,abi_mips_n64(-)?,abi_mips_o32(-)?,abi_riscv_lp64d(-)?,abi_riscv_lp64(-)?,abi_s390_32(-)?,abi_s390_64(-)?] (dev-db/mysql-connector-c:0/18[abi_x86_64(-)]) required by (virtual/libmysqlclient-18-r1:0/18::gentoo, installed)
    dev-db/mysql-connector-c:= required by (dev-qt/qtsql-5.12.4:5/5.12.4::gentoo, installed)
    dev-db/mysql-connector-c:0/18= required by (dev-qt/qtsql-5.12.4:5/5.12.4::gentoo, installed)
Comment 4 klaus818 2019-07-08 21:13:03 UTC
Ok, after the last sync I can build the new mariadb. But no difference. Same problem.

emerge --config =dev-db/mariadb-10.4.6


Configuring pkg...

 * Trying to get password for mysql 'root' user from 'mysql' section ...
 * Trying to get password for mysql 'root' user from 'client' section ...
 * Please provide a password for the mysql 'root'@'localhost' user now
 * or through the /root/.my.cnf file.
 * Avoid ["'\_%] characters in the password
 * Not entering a password defaults to UNIX authentication
    >
 * Retype the password
    >
 * Creating the mysql database and setting proper permissions on it ...
 * Command: /usr/share/mariadb/scripts/mysql_install_db --basedir=/usr --loose-skip-grant-tables --loose-skip-host-cache --loose-skip-name-resolve --loose-skip-networking --loose-skip-slave-start --loose-skip-ssl --loose-skip-log-bin --loose-skip-relay-log --loose-skip-slow-query-log --loose-skip-external-locking --loose-skip-log-slave-updates --datadir=//var/lib/mysql --tmpdir=//tmp/
 * ERROR: dev-db/mariadb-10.4.6::gentoo failed (config phase):
 *   Failed to initialize mysqld. Please review /var/log/mysql/mysqld.err AND /var/tmp/portage/dev-db/mariadb-10.4.6/temp/mysql_install_db.log
 * 
 * Call stack:
 *     ebuild.sh, line 125:  Called pkg_config
 *   environment, line 4441:  Called die
 * The specific snippet of code:
 *           die "Failed to initialize mysqld. Please review ${EPREFIX}/var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log";
 * 
 * If you need support, post the output of `emerge --info '=dev-db/mariadb-10.4.6::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-db/mariadb-10.4.6::gentoo'`.
!!! When you file a bug report, please include the following information:
GENTOO_VM=  CLASSPATH="" JAVA_HOME="/etc/java-config-2/current-system-vm"
JAVACFLAGS="" COMPILER=""
and of course, the output of emerge --info =mariadb-10.4.6
 * The complete build log is located at '/var/log/portage/dev-db:mariadb-10.4.6:20190708-210847.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-db/mariadb-10.4.6/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-db/mariadb-10.4.6/temp'
 * S: '/var/tmp/portage/dev-db/mariadb-10.4.6/work/mariadb-10.4.6'
Comment 5 klaus818 2019-07-14 17:03:52 UTC
Nothing is fixed. The problem still exists.

emerge --config mariadb


Configuring pkg...

 * Trying to get password for mysql 'root' user from 'mysql' section ...
 * Trying to get password for mysql 'root' user from 'client' section ...
 * Please provide a password for the mysql 'root'@'localhost' user now
 * or through the /root/.my.cnf file.
 * Avoid ["'\_%] characters in the password
 * Not entering a password defaults to UNIX authentication
    >
 * Retype the password
    >
 * Creating the mysql database and setting proper permissions on it ...
 * Command: /usr/share/mariadb/scripts/mysql_install_db --basedir=/usr --loose-skip-grant-tables --loose-skip-host-cache --loose-skip-name-resolve --loose-skip-networking --loose-skip-slave-start --loose-skip-ssl --loose-skip-log-bin --loose-skip-relay-log --loose-skip-slow-query-log --loose-skip-external-locking --loose-skip-log-slave-updates --datadir=//var/lib/mysql --tmpdir=//tmp/
 * ERROR: dev-db/mariadb-10.4.6::gentoo failed (config phase):
 *   Failed to initialize mysqld. Please review /var/log/mysql/mysqld.err AND /var/tmp/portage/dev-db/mariadb-10.4.6/temp/mysql_install_db.log
 * 
 * Call stack:
 *     ebuild.sh, line 125:  Called pkg_config
 *   environment, line 4441:  Called die
 * The specific snippet of code:
 *           die "Failed to initialize mysqld. Please review ${EPREFIX}/var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log";
 * 
 * If you need support, post the output of `emerge --info '=dev-db/mariadb-10.4.6::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-db/mariadb-10.4.6::gentoo'`.
!!! When you file a bug report, please include the following information:
GENTOO_VM=  CLASSPATH="" JAVA_HOME="/etc/java-config-2/current-system-vm"
JAVACFLAGS="" COMPILER=""
and of course, the output of emerge --info =mariadb-10.4.6
 * The complete build log is located at '/var/log/portage/dev-db:mariadb-10.4.6:20190714-165320.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-db/mariadb-10.4.6/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-db/mariadb-10.4.6/temp'
 * S: '/var/tmp/portage/dev-db/mariadb-10.4.6/work/mariadb-10.4.6'
Comment 6 Conrad Kostecki gentoo-dev 2019-07-14 22:13:13 UTC
I also emerged on a new fresh system dev-db/mariadb and it fails for me.
Comment 7 Brian Evans Gentoo Infrastructure gentoo-dev 2019-07-18 16:12:53 UTC
*** Bug 690158 has been marked as a duplicate of this bug. ***
Comment 8 Anna Tikhomirova 2019-07-21 15:29:23 UTC
I have the same issue. No one has posted mysql_install_db.log though.

# cat /var/tmp/portage/dev-db/mariadb-10.4.6/temp/mysql_install_db.log
chown: cannot access '/auth_pam_tool_dir': No such file or directory
Cannot change ownership of the '/auth_pam_tool_dir' directory
 to the 'mysql' user. Check that you have the necessary permissions and try again.

Corresponding lines from mysql_install_db:

  chown $user "$pamtooldir/auth_pam_tool_dir"
  if test $? -ne 0
  then
      echo "Cannot change ownership of the '$pamtooldir/auth_pam_tool_dir' directory"
      echo " to the '$user' user. Check that you have the necessary permissions and try again."
      exit 1


It seems there is something wrong with $pamtooldir variable.
Comment 9 Anna Tikhomirova 2019-07-21 21:38:31 UTC
Created attachment 583986 [details, diff]
mariadb-10.4.6-fix-path.patch

mysql_install_db has hardcoded mysql/plugin path which is fine for other Linux distributions but it causes fail on Gentoo because Gentoo uses mariadb/plugin directory.
Comment 10 Anna Tikhomirova 2019-07-21 21:39:15 UTC
Created attachment 583988 [details, diff]
mariadb-10.4.6.ebuild.patch

mysql_install_db must be run as root. Otherwise chown will fail.
Comment 11 Anna Tikhomirova 2019-07-21 21:43:30 UTC
With these patches emerge --config successfully executes mysql_install_db.

However one issue remains and I don't know how to fix it. Root password is not set. SET PASSWORD statement cannot be executed while server is running with the --skip-grant-tables option.


 * Setting root password ...
ERROR 1290 (HY000) at line 1: The MariaDB server is running with the --skip-grant-tables option so it cannot execute this statement
Comment 12 Anna Tikhomirova 2019-07-21 22:36:11 UTC
Created attachment 583990 [details, diff]
mariadb-10.4.6.ebuild.patch

Oh, I've fixed it too. It seems that the FLUSH PRIVILEGES statement was erroneously removed. Note that in MariaDB 10.4 it should be executed before setting the password, not after.
Comment 13 klaus818 2019-07-22 17:06:49 UTC
I tried the patch. No difference.
Comment 14 Brian Evans Gentoo Infrastructure gentoo-dev 2019-07-22 17:37:28 UTC
(In reply to Andrey Tikhomirov from comment #12)
> Created attachment 583990 [details, diff] [details, diff]
> mariadb-10.4.6.ebuild.patch
> 
> Oh, I've fixed it too. It seems that the FLUSH PRIVILEGES statement was
> erroneously removed. Note that in MariaDB 10.4 it should be executed before
> setting the password, not after.

No, this is intentional.  What should be done is the removal of --skip-grant-tables.
Comment 15 Anna Tikhomirova 2019-07-22 18:55:40 UTC
(In reply to Brian Evans from comment #14)
> No, this is intentional.  What should be done is the removal of
> --skip-grant-tables.

Why? According to this article: https://mariadb.org/authentication-in-mariadb-10-4/ you just need to execute FLUSH PRIVILEGES before setting the password, not after as in versions <=10.3.

3. run FLUSH PRIVILEGES (note, before 10.4 it would’ve been the last step, not anymore)


Also there is no need to set the password at all because root account is now secured by default. You may remove all the code that sets the root password because it is actually not needed anymore.
Comment 16 Anna Tikhomirova 2019-07-22 19:15:29 UTC
(In reply to klaus818 from comment #13)
> I tried the patch. No difference.

You need both patches - patch for the ebuild and patch for the mariadb itself - and you need to re-emerge mariadb.
Comment 17 Larry the Git Cow gentoo-dev 2019-07-22 19:21:17 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/mysql-extras.git/commit/?id=6a716a7a98ae6fe077bca7b5e7f6716086301eec

commit 6a716a7a98ae6fe077bca7b5e7f6716086301eec
Author:     Brian Evans <grknight@gentoo.org>
AuthorDate: 2019-07-22 19:20:20 +0000
Commit:     Brian Evans <grknight@gentoo.org>
CommitDate: 2019-07-22 19:20:20 +0000

    Fix custom plugin location for MariaDB >=10.4
    
    Bug: https://bugs.gentoo.org/show_bug.cgi?id=689412
    
    Signed-off-by: Brian Evans <grknight@gentoo.org>

 20018_all_mariadb-10.4.5-without-clientlibs-tools.patch | 9 +++++++++
 1 file changed, 9 insertions(+)
Comment 18 Brian Evans Gentoo Infrastructure gentoo-dev 2019-07-31 22:02:14 UTC
*** Bug 689600 has been marked as a duplicate of this bug. ***
Comment 19 Larry the Git Cow gentoo-dev 2019-08-01 00:34:55 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6c1b434333e109b516b56e76ecec1a58f8990385

commit 6c1b434333e109b516b56e76ecec1a58f8990385
Author:     Brian Evans <grknight@gentoo.org>
AuthorDate: 2019-08-01 00:28:45 +0000
Commit:     Brian Evans <grknight@gentoo.org>
CommitDate: 2019-08-01 00:28:45 +0000

    dev-db/mariadb: Version bump: 10.4.7 10.3.17 10.2.26 10.1.41 and 5.5.65
    
    Closes: https://bugs.gentoo.org/688482
    Closes: https://bugs.gentoo.org/689412
    Closes: https://bugs.gentoo.org/691090
    Signed-off-by: Brian Evans <grknight@gentoo.org>

 dev-db/mariadb/Manifest               |   6 +
 dev-db/mariadb/mariadb-10.1.41.ebuild | 889 ++++++++++++++++++++++++++++++
 dev-db/mariadb/mariadb-10.2.26.ebuild | 974 +++++++++++++++++++++++++++++++++
 dev-db/mariadb/mariadb-10.3.17.ebuild | 975 +++++++++++++++++++++++++++++++++
 dev-db/mariadb/mariadb-10.4.7.ebuild  | 992 ++++++++++++++++++++++++++++++++++
 dev-db/mariadb/mariadb-5.5.65.ebuild  | 831 ++++++++++++++++++++++++++++
 6 files changed, 4667 insertions(+)