Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-9969

mysql_install_db error processing ignore_db_dirs

Details

    • 10.0.26

    Description

      `mysql_install_db` fails with `An error occurred while storing ignore_db_dirs to a hash.` when a `ignore_db_dirs` value is present in my.cnf.

      [root@mariadb tmp]# /usr/bin/mysql_install_db --basedir=/usr --defaults-extra-file=/etc/my.cnf --datadir=/var/lib/mysql --user=mysql
      Installing MariaDB/MySQL system tables in '/var/lib/mysql' ...
      2016-04-22  6:00:33 140718721837088 [Note] /usr/sbin/mysqld (mysqld 10.1.13-MariaDB) starting as process 30747 ...
      2016-04-22  6:00:33 140718721837088 [ERROR] An error occurred while storing ignore_db_dirs to a hash.
      2016-04-22  6:00:33 140718721837088 [ERROR] Aborting
      

      # my.cnf
      #
      # This group is read both both by the client and the server
      # use it for options that affect everything
      #
      [client-server]
       
      [mysqld]
      ignore-db-dirs = lost+found
       
      #
      # include all files from the config directory
      #
      !includedir /etc/my.cnf.d
      

      Attachments

        Activity

          Please check if any files in /etc/my.cnf.d also contain the same setting.

          elenst Elena Stepanova added a comment - Please check if any files in /etc/my.cnf.d also contain the same setting.
          jcotton1123 Jesse Cotton added a comment -

          I saw https://bugs.mysql.com/bug.php?id=69441. No, none of the files within /etc/my.cnf.d contain the same setting.

          I should probably also add that this only seems to affect mysql_install_db. If I remove ignore-db-dirs from my.cnf, run mysql_install_db, add ignore-db-dirs back to my.cnf, mysqld starts fine and processes ignore-db-dirs.

          jcotton1123 Jesse Cotton added a comment - I saw https://bugs.mysql.com/bug.php?id=69441 . No, none of the files within /etc/my.cnf.d contain the same setting. I should probably also add that this only seems to affect mysql_install_db. If I remove ignore-db-dirs from my.cnf, run mysql_install_db, add ignore-db-dirs back to my.cnf, mysqld starts fine and processes ignore-db-dirs.
          jcotton1123 Jesse Cotton added a comment - - edited

          It just dawned on me that the parameter to mysql_install_db, `defaults-extra-file=/etc/my.cnf` might be causing mysql_install_db to process /etc/my.cnf twice since `/etc/my.cnf` is the default file. That does seem to be the case. If I run mysql_install_db with `defaults-file=/etc/my.cnf` no error is thrown.

          jcotton1123 Jesse Cotton added a comment - - edited It just dawned on me that the parameter to mysql_install_db, `defaults-extra-file=/etc/my.cnf` might be causing mysql_install_db to process /etc/my.cnf twice since `/etc/my.cnf` is the default file. That does seem to be the case. If I run mysql_install_db with `defaults-file=/etc/my.cnf` no error is thrown.

          That's right. But if you ran mysqld with the same defaults-extra-file, you should have experienced the same problem.

          elenst Elena Stepanova added a comment - That's right. But if you ran mysqld with the same defaults-extra-file , you should have experienced the same problem.
          jcotton1123 Jesse Cotton added a comment -

          You're correct however mysqld isn't started with a `defaults-extra-file` parameter. I am using Puppet to deploy MariaDB and I am at the mercy of the Puppet module. I am not sure why they chose to use `defaults-extra-file` for mysql_install_db but I'll look into it.

          So this does look like a manifestation of https://bugs.mysql.com/bug.php?id=69441?

          jcotton1123 Jesse Cotton added a comment - You're correct however mysqld isn't started with a `defaults-extra-file` parameter. I am using Puppet to deploy MariaDB and I am at the mercy of the Puppet module. I am not sure why they chose to use `defaults-extra-file` for mysql_install_db but I'll look into it. So this does look like a manifestation of https://bugs.mysql.com/bug.php?id=69441?

          Okay, now it's clear. Thanks for the report.
          Yes, the problem you encountered is https://bugs.mysql.com/bug.php?id=69441. It's been fixed in MySQL 5.7, and the fix needs to be merged to MariaDB 10.x (or re-done, if it's not good enough).

          For a note, while experimenting with it, I've found another issue with mysql_install_db processing ignore_db_dirs.
          If the option is provided on the command line, even once and without any default files involved, it causes the exact same error

           scripts/mysql_install_db --no-defaults --ignore-db-dir=xxxx 
          Installing MariaDB/MySQL system tables in './data' ...
          2016-04-22 19:46:50 140679461701504 [Note] ./bin/mysqld (mysqld 10.1.13-MariaDB) starting as process 17497 ...
          2016-04-22 19:46:50 140679461701504 [ERROR] An error occurred while storing ignore_db_dirs to a hash.
          2016-04-22 19:46:50 140679461701504 [ERROR] Aborting
          

          It happens because while preparing the bootstrap command line, mysql_install_db goes through the arguments twice, so they end up being duplicated on final command line:

          > scripts/mysql_install_db --no-defaults --ignore-db-dir=xxxx --lock-wait-timeout=5
          ./bin/mysqld --no-defaults --lc-messages=en_US --bootstrap --basedir=. --datadir=./data --log-warnings=0 --enforce-storage-engine=  --ignore-db-dir=xxxx --lock-wait-timeout=5 --ignore-db-dir=xxxx --lock-wait-timeout=5 --max_allowed_packet=8M --net_buffer_length=16K
          

          The specific problem with ignore-db-dir will disappear after the server part is fixed, but still providing duplicate options is not good, so it would be useful to fix the script as well.
          In MySQL 5.6 it was fixed apparently when mysql_install_db was rewritten in Perl.

          elenst Elena Stepanova added a comment - Okay, now it's clear. Thanks for the report. Yes, the problem you encountered is https://bugs.mysql.com/bug.php?id=69441 . It's been fixed in MySQL 5.7, and the fix needs to be merged to MariaDB 10.x (or re-done, if it's not good enough). For a note, while experimenting with it, I've found another issue with mysql_install_db processing ignore_db_dirs . If the option is provided on the command line, even once and without any default files involved, it causes the exact same error scripts/mysql_install_db --no-defaults --ignore-db-dir=xxxx Installing MariaDB/MySQL system tables in './data' ... 2016-04-22 19:46:50 140679461701504 [Note] ./bin/mysqld (mysqld 10.1.13-MariaDB) starting as process 17497 ... 2016-04-22 19:46:50 140679461701504 [ERROR] An error occurred while storing ignore_db_dirs to a hash. 2016-04-22 19:46:50 140679461701504 [ERROR] Aborting It happens because while preparing the bootstrap command line, mysql_install_db goes through the arguments twice, so they end up being duplicated on final command line: > scripts/mysql_install_db --no-defaults --ignore-db-dir=xxxx --lock-wait-timeout=5 ./bin/mysqld --no-defaults --lc-messages=en_US --bootstrap --basedir=. --datadir=./data --log-warnings=0 --enforce-storage-engine= --ignore-db-dir=xxxx --lock-wait-timeout=5 --ignore-db-dir=xxxx --lock-wait-timeout=5 --max_allowed_packet=8M --net_buffer_length=16K The specific problem with ignore-db-dir will disappear after the server part is fixed, but still providing duplicate options is not good, so it would be useful to fix the script as well. In MySQL 5.6 it was fixed apparently when mysql_install_db was rewritten in Perl.
          holyfoot Alexey Botchkov added a comment - Patch for the server: http://lists.askmonty.org/pipermail/commits/2016-June/009456.html
          holyfoot Alexey Botchkov added a comment - Patch to the mysql_install_db scripts: http://lists.askmonty.org/pipermail/commits/2016-June/009457.html

          People

            holyfoot Alexey Botchkov
            jcotton1123 Jesse Cotton
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.