Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

InnoDB error on mariadb oficial docker image

I’m having a very strange error. I have been able to pin it down to a very simple case and I don’t know if I have found a bug or if I’m missing some point.

The thing is I need a mariadb container and I can run it perfectly with the following command:

docker run -e MYSQL_ROOT_PASSWORD=my-secret-pw mariadb

But it fails with the following docker-compose.yml file:

wordpress_db:
  image: mariadb
  environment:
    - MYSQL_ROOT_PASSWORD=foo

It ouptuts, amongst other things:

wordpress_db_1 | 2016-01-11 14:33:25 140183257745344 [Note] InnoDB: The  InnoDB memory heap is disabled

The first message I can clearly recognise as an error is this:

wordpress_db_1 | InnoDB: No valid checkpoint found.

(You can see the full output at the end of the post)

This does not happen if I switch mariadb for mysql.

Can anyone help me?

Thanks!

Output:

Starting miqueladell_wordpress_db_1
Attaching to miqueladell_wordpress_db_1
wordpress_db_1 | 2016-01-11 14:33:25 140183257745344 [Note] mysqld (mysqld 10.1.10-MariaDB-1~jessie) starting as process 1 ...
wordpress_db_1 | 2016-01-11 14:33:25 140183257745344 [Note] InnoDB: Using mutexes to ref count buffer pool pages
wordpress_db_1 | 2016-01-11 14:33:25 140183257745344 [Note] InnoDB: The InnoDB memory heap is disabled
wordpress_db_1 | 2016-01-11 14:33:25 140183257745344 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
wordpress_db_1 | 2016-01-11 14:33:25 140183257745344 [Note] InnoDB: Memory barrier is not used
wordpress_db_1 | 2016-01-11 14:33:25 140183257745344 [Note] InnoDB: Compressed tables use zlib 1.2.8
wordpress_db_1 | 2016-01-11 14:33:25 140183257745344 [Note] InnoDB: Using Linux native AIO
wordpress_db_1 | 2016-01-11 14:33:25 140183257745344 [Note] InnoDB: Using SSE crc32 instructions
wordpress_db_1 | 2016-01-11 14:33:25 140183257745344 [Note] InnoDB: Initializing buffer pool, size = 256.0M
wordpress_db_1 | 2016-01-11 14:33:25 140183257745344 [Note] InnoDB: Completed initialization of buffer pool
wordpress_db_1 | 2016-01-11 14:33:25 140183257745344 [Note] InnoDB: Highest supported file format is Barracuda.
wordpress_db_1 | InnoDB: No valid checkpoint found.
wordpress_db_1 | InnoDB: If this error appears when you are creating an InnoDB database,
wordpress_db_1 | InnoDB: the problem may be that during an earlier attempt you managed
wordpress_db_1 | InnoDB: to create the InnoDB data files, but log file creation failed.
wordpress_db_1 | InnoDB: If that is the case, please refer to
wordpress_db_1 | InnoDB: http://dev.mysql.com/doc/refman/5.6/en/error-creating-innodb.html
wordpress_db_1 | 2016-01-11 14:33:25 140183257745344 [ERROR] Plugin 'InnoDB' init function returned error.
wordpress_db_1 | 2016-01-11 14:33:25 140183257745344 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
wordpress_db_1 | 2016-01-11 14:33:25 140183257745344 [Note] Plugin 'FEEDBACK' is disabled.
wordpress_db_1 | 2016-01-11 14:33:25 140183257745344 [ERROR] Unknown/unsupported storage engine: InnoDB
wordpress_db_1 | 2016-01-11 14:33:25 140183257745344 [ERROR] Aborting
wordpress_db_1 |
miqueladell_wordpress_db_1 exited with code 1
like image 309
Miquel Adell Avatar asked Jan 11 '16 14:01

Miquel Adell


People also ask

How do I connect to Mariadb in Docker container?

Execute the following to connect to MariaDB using the command-line client: > docker exec -it mdb mariadb --user root -pPassword123! And that's it! That's all you need to connect to and start using (querying) MariaDB.


2 Answers

I had the same problem with Maria_DB official image from Docker Hub. It worked once with maria_DB version 10.5, but when i downgraded to 10.3, i had the same error.

The error is caused by the volume of the previous container, you have to delete it.

Firstly, stop the container (you can get the docker cotnainer id with docker ps) :

docker stop xxxxx

Then remove it :

docker rm xxxxx

Finally, delete the associated container :

docker volume ls
docker rm my_volume_name

Your container should now restart without issue.

like image 178
Zoidsky Avatar answered Oct 20 '22 14:10

Zoidsky


This works for me,

docker-compose up -d 

then

docker-compose down -v

You may need to kill the volume and recreate it. More on,

https://linuxize.com/post/how-to-remove-docker-images-containers-volumes-and-networks/#removing-docker-volumes.

like image 23
Isanka Wijerathne Avatar answered Oct 20 '22 16:10

Isanka Wijerathne