Docker4drupal: Mariadb doesn't start

Created on 25 Feb 2018  Â·  10Comments  Â·  Source: wodby/docker4drupal

MariaDB does not start at all.

I have read the other issues about problems with Mariadb for ideas. The first thing I tried was to restart docker. I tried https://github.com/wodby/mariadb/issues/2#issuecomment-319327867. I have deleted all the containers and images, restarted docker. I tried with both wodby/mariadb:10.2-3.0.2and wodby/mariadb:10.1-3.0.2. In all cases Mariadb doesn't start.

Codebase

mounted codebase

Host OS

Debian Stretch

Docker info output

Containers: 6
 Running: 5
 Paused: 0
 Stopped: 1
Images: 6
Server Version: 17.12.0-ce
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 89623f28b87a6004d4b785663257362d1658a729
runc version: b2567b37d7b75eb4cf325b77297b140ea686ce8f
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.9.0-5-amd64
Operating System: Debian GNU/Linux 9 (stretch)
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 15.6GiB
Name: ithilien
ID: ZXR4:MQLX:4HLZ:YQNH:EJJE:5S4Q:RXA2:V4OO:T7VF:MGMQ:2ISN:246V
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

Docker compose file

There are 5 changes to the docker-compose.yml file.
1) Comment out drupal 8 vanilla
2) Uncomment   image: wodby/drupal-php:7.1-3.3.1
3) change php volumes to  - ./:/var/www/html
4) Change nginx server root  NGINX_SERVER_ROOT: /var/www/html
5) change nginx volumes to  - ./:/var/www/html

Logs output

With image: wodby/mariadb:10.2-3.0.2

Attaching to drupal_mariadb_1
mariadb_1    | Initializing database
mariadb_1    | 2018-02-25 10:59:36 140547351575368 [ERROR] InnoDB: preallocating 10485760 bytes for file ./ibdata1 failed with error 95
mariadb_1    | 2018-02-25 10:59:36 140547351575368 [ERROR] InnoDB: Could not set the file size of './ibdata1'. Probably out of disk space
mariadb_1    | 2018-02-25 10:59:36 140547351575368 [ERROR] InnoDB: Database creation was aborted with error Generic error. You may need to delete the ibdata1 file before trying to start up again.
mariadb_1    | 2018-02-25 10:59:36 140547351575368 [ERROR] Plugin 'InnoDB' init function returned error.
mariadb_1    | 2018-02-25 10:59:36 140547351575368 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
mariadb_1    | 2018-02-25 10:59:37 140547351575368 [ERROR] Unknown/unsupported storage engine: InnoDB
mariadb_1    | 2018-02-25 10:59:37 140547351575368 [ERROR] Aborting
mariadb_1    |
mariadb_1    |
mariadb_1    | Installation of system tables failed!  Examine the logs in
mariadb_1    | /var/lib/mysql/ for more information.
mariadb_1    |
mariadb_1    | The problem could be conflicting information in an external
mariadb_1    | my.cnf files. You can ignore these by doing:
mariadb_1    |
mariadb_1    |     shell> /usr/bin/mysql_install_db --defaults-file=~/.my.cnf
mariadb_1    |
mariadb_1    | You can also try to start the mysqld daemon with:
mariadb_1    |
mariadb_1    |     shell> /usr/bin/mysqld --skip-grant --general-log &
mariadb_1    |
mariadb_1    | and use the command line tool /usr/bin/mysql
mariadb_1    | to connect to the mysql database and look at the grant tables:
mariadb_1    |
mariadb_1    |     shell> /usr/bin/mysql -u root mysql
mariadb_1    |     mysql> show tables;
mariadb_1    |
mariadb_1    | Try 'mysqld --help' if you have problems with paths.  Using
mariadb_1    | --general-log gives you a log in /var/lib/mysql/ that may be helpful.
mariadb_1    |
mariadb_1    | The latest information about mysql_install_db is available at
mariadb_1    | https://mariadb.com/kb/en/installing-system-tables-mysql_install_db
mariadb_1    | MariaDB is hosted on launchpad; You can find the latest source and
mariadb_1    | email lists at http://launchpad.net/maria
mariadb_1    |
mariadb_1    | Please check all of the above before submitting a bug report
mariadb_1    | at http://mariadb.org/jira

With wodby/mariadb:10.1-3.0.2

$ docker-compose logs mariadb
Attaching to drupal_mariadb_1
mariadb_1    | 2018-02-25 11:48:11 140247401065288 [Note] mysqld (mysqld 10.1.29-MariaDB) starting as process 1 ...
mariadb_1    | 2018-02-25 11:48:11 140247401065288 [Note] InnoDB: Using mutexes to ref count buffer pool pages
mariadb_1    | 2018-02-25 11:48:11 140247401065288 [Note] InnoDB: The InnoDB memory heap is disabled
mariadb_1    | 2018-02-25 11:48:11 140247401065288 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
mariadb_1    | 2018-02-25 11:48:11 140247401065288 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
mariadb_1    | 2018-02-25 11:48:11 140247401065288 [Note] InnoDB: Compressed tables use zlib 1.2.11
mariadb_1    | 2018-02-25 11:48:11 140247401065288 [Note] InnoDB: Using Linux native AIO
mariadb_1    | 2018-02-25 11:48:11 140247401065288 [Note] InnoDB: Using SSE crc32 instructions
mariadb_1    | 2018-02-25 11:48:11 140247401065288 [Note] InnoDB: Initializing buffer pool, size = 1.0G
mariadb_1    | 2018-02-25 11:48:11 140247401065288 [Note] InnoDB: Completed initialization of buffer pool
mariadb_1    | 2018-02-25 11:48:11 140247401065288 [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!
mariadb_1    | 2018-02-25 11:48:11 140247401065288 [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!
mariadb_1    | 2018-02-25 11:48:11 140247401065288 [ERROR] Plugin 'InnoDB' init function returned error.
mariadb_1    | 2018-02-25 11:48:11 140247401065288 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
mariadb_1    | 2018-02-25 11:48:11 140247401065288 [Note] Plugin 'FEEDBACK' is disabled.
mariadb_1    | 2018-02-25 11:48:11 140247401065288 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
mariadb_1    | 2018-02-25 11:48:11 140247401065288 [ERROR] Unknown/unsupported storage engine: InnoDB
mariadb_1    | 2018-02-25 11:48:11 140247401065288 [ERROR] Aborting

macos mariadb windows

All 10 comments

I thought I was the only one, but I had this problem too. In my case it WAS fixed by removing and rebuilding the image and container though:
docker ps -a # To find mariadb, say abcdef1234567890
docker rmi -f abcdef1234567890
docker rm -f abcdef1234567890

@f1rf1n, No not the only one with this error and I'm glad you were able to get it working.

Not so for me. I tried once again, but no, it still fails. I am totally stuck.

  $ docker rmi 09be1c1e774d
  $ docker rmi 8a4adaadb9d9
  $ sudo systemctl restart docker
  $ docker-compose up -d
  $ docker ps -a
CONTAINER ID        IMAGE                             COMMAND                  CREATED             STATUS                     PORTS                  NAMES
06c23c43f0cc        wodby/drupal-nginx:8-1.13-3.0.2   "/docker-entrypoint.…"   4 minutes ago       Up 4 minutes               80/tcp                 drupal_nginx_1
3478f4538c74        wodby/drupal-php:7.1-3.3.1        "/docker-entrypoint.…"   4 minutes ago       Up 4 minutes               9000/tcp               drupal_php_1
15ac80b215d0        wodby/mariadb:10.2-3.0.2          "/docker-entrypoint.…"   4 minutes ago       Exited (1) 4 minutes ago                          drupal_mariadb_1
263bdb856cfc        portainer/portainer               "/portainer --no-aut…"   34 hours ago        Up 4 minutes               9000/tcp               drupal_portainer_1
a8791e2add40        mailhog/mailhog                   "MailHog"                34 hours ago        Up 4 minutes               1025/tcp, 8025/tcp     drupal_mailhog_1
3670e893c10e        traefik                           "/traefik -c /dev/nu…"   34 hours ago        Up 4 minutes               0.0.0.0:8000->80/tcp   drupal_traefik_1

For all macOS and windows users who has Probably out of disk space with MariaDB container with volumes mounted from the host – there's an issue with docker for mac/win filesystem and MariaDB. If a fix happen it will happen either in MariaDB or in docker for mac/win (unlikely), there's nothing we can do in the image to fix that. See https://github.com/docker-library/mariadb/issues/95 for more explanations. The solution is to not mount volume from the host or try using -2.x.x version of the image with older MariaDB, seems to be working fine.

Reported issue in MariaDB's JIRA: https://jira.mariadb.org/browse/MDEV-16015

TL;DR: don't use bind mounts for mariadb, let docker itself create and manage volumes. Since docker 17.06 you will lose volumes data only if you run docker system prune --volumes

For me I was able to disable use of of the persistent mount. Once started I then switched to persistent mount and then run docker-compose up -d again.

I also chmod the data directory to 777.

This fails on restarting docker-compose.

Maybe the persistent storage option is now redundant?

This is interesting

"all versions of MySQL work with a host mounted volume in Docker for Windows, as does Percona 5.5 and 5.6"

and "I don't have any insight as to why Percona 5.7 and all versions of MariaDB fail when using a host mounted volume on Docker for Windows."

Older versions of MariaDB container work fine, see https://github.com/wodby/docker4drupal/issues/126#issuecomment-395415202

I have the same problem, but only with the image: wodby/mariadb:10.3.*, wodby/mariadb:10.2.*

With the image: image: mariadb:10.3.9 everything is fine.

I had similar issue and had to remove the image 10.3 and run docker-compose up -d again to fix the issue

I had to go all the way down to 10.1-3.8.5.

It looks like I'm having the same issue all of a sudden... at first version mariadb:10.2.* was working fine for me, but now I'm getting mariadb docker [ERROR] InnoDB: preallocating xxxxxx bytes for file ./ibdata1 failed with error 28.
Using version image: mariadb:10.3.9 seems to be working fine.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jzavrl picture jzavrl  Â·  3Comments

rsanzante picture rsanzante  Â·  7Comments

2dareis2do picture 2dareis2do  Â·  11Comments

Vacilando picture Vacilando  Â·  7Comments

magick93 picture magick93  Â·  7Comments