wodby/mariadb

mariadb container fails to launch

Max-Zviagintsev opened this issue ยท 7 comments

Hello, guys!

I've tried to reinstall/redownload everything - docker, docker toolbox, docker4drupal, deleted all docker containers/images/local folder several times, but mariadb container is not launching.

I'm on freshly installed Win 10 pro, v.1703 build 15063.483. Hyper-V enabled

I've changed docker-compose.yml (mariadb section) and added a volume to manage db manually:

  • ./mariadb/:/var/lib/mysql

Here is a log of the error:

2017-07-31 19:41:16 140494438923080 [ERROR] InnoDB: auto-extending data file ./ibdata1 is of a different size 0 pages (rounded down to MB) than specified in the .cnf file: initial 640 pages, max 655360 (relevant if non-zero) pages!
2017-07-31 19:41:16 140494438923080 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!
2017-07-31 19:41:16 140494438923080 [ERROR] Plugin 'InnoDB' init function returned error.
2017-07-31 19:41:16 140494438923080 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2017-07-31 19:41:16 140494438923080 [Note] Plugin 'FEEDBACK' is disabled.
2017-07-31 19:41:16 140494438923080 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
2017-07-31 19:41:16 140494438923080 [ERROR] Unknown/unsupported storage engine: InnoDB
2017-07-31 19:41:16 140494438923080 [ERROR] Aborting

Try to recreate ./mariadb dir, run docker system prune to clean up all volumes and run again.

Thanks, but I did it many many times. Looks like it is an issue of Hyper-V and the latest Mariadb versions. I tried running Docker with a virtual machine - works fine. I've also managed to run your 2.0.0 release of Mariadb image with Hyper-V.

Yeah, your latest MariaDB images also work fine when installing DB inside a container, but I'm afraid of losing data.
Anyway, thanks for an excellent work!

so the solution workaround to run on Hyper-V aka docker for windows is use a container volume and make sure you don't nuke that container volume like this:

$ docker volume create mariadb_data

#docker-compose.yml
version: "2"

services:
  mariadb:
    image: wodby/mariadb:10.2-3.0.2
#    image: wodby/mariadb:10.1-3.0.2
    environment:
      MYSQL_ROOT_PASSWORD: password
      MYSQL_DATABASE: wordpress
      MYSQL_USER: wordpress
      MYSQL_PASSWORD: wordpress
    volumes:
      - ./mariadb-init:/docker-entrypoint-initdb.d # Place init .sql file(s) here.
      - mariadb_data:/var/lib/mysql # I want to manage volumes manually.
....
volumes:
  mariadb_data:
    external: true

ref: https://docs.docker.com/compose/compose-file/#external

being Docker for Windows inside a Hyper-V VM, the files are inside the VM, however at least they won't get demolished if you do a docker-composer down...

another solution is to use external volumes and use docker-sync to sync it to the host http://docker-sync.io/

OR

Simply fix that issue all together? I'm using host mounted volumes just fine on other images.

I managed to fix the issue by creating a local volume in the same docker host, with this config in my docker-compose.yml:

services:
    mariadb:
        container_name: mariadb
        image: mariadb
        environment:
            - MYSQL_ROOT_PASSWORD=root
        volumes:
            - mariadbdata:/var/lib/mysql

...

volumes:
    mariadbdata:
        driver: local