wodby/docker4wordpress

Cannot mount mariadb volume

stefanpl opened this issue · 3 comments

Hi,

I'm trying to create a bind mount to persist mariadb data on my host. Having this in my mariadb service definition in docker-compose.yml:

    volumes:
     - ./db-volume-data:/var/lib/mysql

I created the folder db-volume-data in the root directory. mariadb containers fails with the following error:

Initializing database
2019-09-14  9:54:56 0 [Warning] InnoDB: Failed to set O_DIRECT on file./ibdata1; OPEN: Invalid argument, continuing anyway. O_DIRECT is known to result in 'Invalid argument' on Linux on tmpfs, see MySQL Bug#26662.
2019-09-14  9:54:56 0 [ERROR] InnoDB: The Auto-extending innodb_system data file './ibdata1' is of a different size 0 pages than specified in the .cnf file: initial 640 pages, max 655360 (relevant if non-zero) pages!
2019-09-14  9:54:56 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2019-09-14  9:54:57 0 [ERROR] Plugin 'InnoDB' init function returned error.
2019-09-14  9:54:57 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2019-09-14  9:54:57 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2019-09-14  9:54:57 0 [ERROR] Aborting
Installation of system tables failed!  Examine the logs in
/var/lib/mysql/ for more information.
The problem could be conflicting information in an external
my.cnf files. You can ignore these by doing:
    shell> /usr/bin/mysql_install_db --defaults-file=~/.my.cnf
You can also try to start the mysqld daemon with:
    shell> /usr/bin/mysqld --skip-grant-tables --general-log &
and use the command line tool /usr/bin/mysql
to connect to the mysql database and look at the grant tables:
    shell> /usr/bin/mysql -u root mysql
    mysql> show tables;
Try 'mysqld --help' if you have problems with paths.  Using
--general-log gives you a log in /var/lib/mysql/ that may be helpful.
The latest information about mysql_install_db is available at
https://mariadb.com/kb/en/installing-system-tables-mysql_install_db
You can find the latest source at https://downloads.mariadb.org and
the maria-discuss email list at https://launchpad.net/~maria-discuss
Please check all of the above before submitting a bug report
at http://mariadb.org/jira

Happens for both vanilla installs and mounted wordpress. I'm on Linux Mint 18.3, which is based on Ubuntu 16.04. Even tried to slap a 777 on the db-volume-data folder, did not help.

Any insights here would be greatly appreciated, as this problem renders your (very promising-looking!) product useless. I don't want to lose my data every time I docker-compose down

Thanks a lot in advance!

Have you tried googling? Looks like docker-library/mysql#345 (comment)

@csandanov yes, I've tried googling the issue. Frankly I don't have time on my hands to post a github issue every time something's not running – I'm on Linux, after all … ;-)
The issue you linked is someone on Mac OS, where apparently his VM size is limited. Got nothing to do with my setup, tried his suggestion anyway, did not help, same error still.

Thanks for digging it out anyway! Any other suggestions?

Your log output looks like a known issue with mariadb bind mounts described in the readme of https://github.com/wodby/mariadb. But this is a windows/macos issue. Since you're on linux perhaps there's something specific about your host disk mount where you bind mounts located. Try searching under https://github.com/wodby/docker4drupal/issues (I remember seeing something similar) or maybe MariaDB/mariadb-docker#95 has a working solution