14

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
6
  • ...but log file creation failed. ... whatever's going on, it didn't create the innodb DB properly.
    – Marc B
    Jan 11, 2016 at 14:43
  • Yes, I can see that... but docker containers should not need interaction on the "deployer" part so I should be able to solve that just via docker commands. I guess... Jan 11, 2016 at 14:48
  • try docker-compose stop and then docker-compose rm before restarting your container. This is to ensure the associated volumes get lost and that you start from scratch Jan 11, 2016 at 15:58
  • Stop your mariadb server...then start you server again, adding --skip-innodb-use-sys-malloc to your start command
    – Hackerman
    Jan 11, 2016 at 19:06
  • Hey, thanks for all the suggestions. I solved the error but I'm not sure how. I had some different problems with my configuration and I solved this one as a side effect. Sorry that I can't give this question "closure" :-P Jan 13, 2016 at 16:56

3 Answers 3

10

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 volume :

docker volume ls
docker volume rm my_volume_name

Your container should now restart without issue.

5
  • 1
    it's docker volume rm my_volume_name
    – FrodmanG
    Jan 7, 2022 at 11:11
  • Then what would you answer when all customers data gone? Jun 2, 2022 at 6:51
  • @PhyoArkarLwin I strongly advise against using databases in containers with customer or prod data.
    – Paul Legac
    Jun 8, 2022 at 8:37
  • volumes are outside of containers Aug 4, 2022 at 19:57
  • You're right, but it's not stable if you don't use the image Docker properly (crashs, unwanted updates like in this case ...).
    – Paul Legac
    Aug 5, 2022 at 15:48
4

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.

1
  • 1
    This did work for me thank you why didn't i do this in the first place. Dec 17, 2021 at 15:39
0

I'm not sure if this should be a comment or an answer but I don't want to hit the character limit so…

Mainly to answer @tjheslin1 and I doubt it would be of any use to anoyone else.

I haven't used docker for quite some months now but, at some point I did manage to make this work with this code:

https://github.com/MiquelAdell/mariadb-utf8mb4/blob/master/Dockerfile

I'm not sure what was and my environment at the moment had a lot of moving pieces.

I don't have time to re-create said environment now to provide more assistance but I don't want to keep people that stumble there waiting forever.

I guess I should close the question as unanswered as I will not be able to follow up on it any time soon.

Sorry :-\

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.