简体   繁体   中英

MariaDB docker not starting due to Innodb error

I have a local docker environment (MAC) for my Laravel set-up. The mariadb container in docker-compose.yml is defined as

    image: mariadb:10.6
    container_name: ct-mariadb
    restart: unless-stopped
    ports:
      - "3306:3306"
    volumes:
      - ./docker/storage/mysql:/var/lib/mysql
    environment:
      MYSQL_DATABASE: ....
      MYSQL_USER: ....
      MYSQL_PASSWORD: ....
      MYSQL_ROOT_PASSWORD: ....
      SERVICE_TAGS: dev
      SERVICE_NAME: mysql
    networks:
      - laravel

The set-up used to work fine, but after testing some manual DB changes it corrupted. When (re-)starting the containers via docker-compose up -d --build the mariadb container fails to start. In the container logs the following can be found:

2022-05-05 23:13:17+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.6.7+maria~focal started.

2022-05-05 23:13:18+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'

2022-05-05 23:13:18+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.6.7+maria~focal started.

2022-05-05 23:13:18+00:00 [Note] [Entrypoint]: MariaDB upgrade not required

2022-05-05 23:13:19+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.6.7+maria~focal started.

2022-05-05 23:13:19+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'

2022-05-05 23:13:19+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.6.7+maria~focal started.

2022-05-05 23:13:19+00:00 [Note] [Entrypoint]: MariaDB upgrade not required

2022-05-05 23:13:20+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.6.7+maria~focal started.

2022-05-05 23:13:20+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'

2022-05-05 23:13:20+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.6.7+maria~focal started.

2022-05-05 23:13:21+00:00 [Note] [Entrypoint]: MariaDB upgrade not required

2022-05-05 23:13:18 0 [Note] mariadbd (server 10.6.7-MariaDB-1:10.6.7+maria~focal) starting as process 1 ...

2022-05-05 23:13:18 0 [Warning] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive

2022-05-05 23:13:18 0 [Note] InnoDB: Compressed tables use zlib 1.2.11

2022-05-05 23:13:18 0 [Note] InnoDB: Number of pools: 1

2022-05-05 23:13:18 0 [Note] InnoDB: Using ARMv8 crc32 + pmull instructions

2022-05-05 23:13:18 0 [Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts)

2022-05-05 23:13:18 0 [Note] InnoDB: Using Linux native AIO

2022-05-05 23:13:18 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728

2022-05-05 23:13:18 0 [Note] InnoDB: Completed initialization of buffer pool

2022-05-05 23:13:18 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=507568654,515471506

2022-05-05 23:13:18 0 [ERROR] InnoDB: Missing FILE_CREATE, FILE_DELETE or FILE_MODIFY before FILE_CHECKPOINT for tablespace 230

2022-05-05 23:13:18 0 [ERROR] InnoDB: Plugin initialization aborted with error Data structure corruption

2022-05-05 23:13:18 0 [Note] InnoDB: Starting shutdown...

2022-05-05 23:13:19 0 [ERROR] Plugin 'InnoDB' init function returned error.

2022-05-05 23:13:19 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.

2022-05-05 23:13:19 0 [Note] Plugin 'FEEDBACK' is disabled.

2022-05-05 23:13:19 0 [ERROR] Unknown/unsupported storage engine: InnoDB

2022-05-05 23:13:19 0 [ERROR] Aborting

I've tried to delete all containers, images and volumes several times via the Docker Desktop UI and with docker rm -f $(docker ps -a -q) docker rmi -f $(docker images -q) but after starting up the containers I get the exact same error again.

I fail to understand why/how after completely deleting all containers, images and volumes this error can still come back.

Any help is much appreciated.

For who it might help.....

Although I cleaned the docker containers, images and volumes with the below commands.

docker rm -f $(docker ps -a -q)
docker rmi -f $(docker images -q)
docker volume rm $(docker volume ls -q)
docker system prune

My mariadb definition referred to a local volume located in ./docker/storage/mysql

  mariadb:
image: mariadb:10.6
container_name: ct-mariadb
restart: unless-stopped
ports:
  - "3306:3306"
volumes:
  - ./docker/storage/mysql:/var/lib/mysql
environment:
  MYSQL_DATABASE: homestead
  MYSQL_USER: homestead
  MYSQL_PASSWORD: secret
  MYSQL_ROOT_PASSWORD: secret
  SERVICE_TAGS: dev
  SERVICE_NAME: mysql
networks:
  - laravel

After cleaning my project docker >> storage folder (basically getting a fresh pull of my project. I could start the docker again without the above errors.

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM