DockerのMySQLコンテナが立ち上がらなくなったけど無事解決した話
DockerMac
先日、Dockerでいつものようにコンテナを立ち上げようとしたら以下のようなエラー…
hoge-mysql.test | 2021-10-17 10:16:37 0 [ERROR] InnoDB: Tablespace 3308 was not found at ./hoge/#sql-alter-1-edf.ibd.
hoge-mysql.test | 2021-10-17 10:16:37 0 [ERROR] InnoDB: Tablespace 3312 was not found at ./hoge/#sql-alter-1-edf.ibd.
hoge-mysql.test | 2021-10-17 10:16:37 0 [ERROR] InnoDB: Tablespace 3316 was not found at ./hoge/#sql-alter-1-edf.ibd.
hoge-mysql.test | 2021-10-17 10:16:37 0 [ERROR] InnoDB: Tablespace 3319 was not found at ./hoge/#sql-alter-1-edf.ibd.
hoge-mysql.test | 2021-10-17 10:16:37 0 [ERROR] InnoDB: Tablespace 3321 was not found at ./hoge/#sql-alter-1-edf.ibd.
hoge-mysql.test | 2021-10-17 10:16:37 0 [ERROR] InnoDB: Tablespace 3323 was not found at ./hoge/#sql-alter-1-edf.ibd.
hoge-mysql.test | 2021-10-17 10:16:37 0 [ERROR] InnoDB: Tablespace 3325 was not found at ./hoge/#sql-alter-1-edf.ibd.
hoge-mysql.test | 2021-10-17 10:16:37 0 [ERROR] InnoDB: Tablespace 3329 was not found at ./hoge/#sql-alter-1-edf.ibd.
hoge-mysql.test | 2021-10-17 10:16:37 0 [ERROR] InnoDB: Tablespace 3331 was not found at ./hoge/#sql-alter-1-edf.ibd.
hoge-mysql.test | 2021-10-17 10:16:37 0 [ERROR] InnoDB: Tablespace 3334 was not found at ./hoge/#sql-alter-1-edf.ibd.
hoge-mysql.test | 2021-10-17 10:16:37 0 [ERROR] InnoDB: Plugin initialization aborted with error Tablespace not found
hoge-mysql.test | 2021-10-17 10:16:37 0 [Note] InnoDB: Starting shutdown...
hoge-laravel.test | 2021-10-17 19:16:37,739 INFO Set uid to user 0 succeeded
hoge-laravel.test | 2021-10-17 19:16:37,740 INFO supervisord started with pid 16
hoge-mysql.test | 2021-10-17 10:16:37 0 [ERROR] Plugin 'InnoDB' init function returned error.
hoge-mysql.test | 2021-10-17 10:16:37 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
hoge-mysql.test | 2021-10-17 10:16:37 0 [Note] Plugin 'FEEDBACK' is disabled.
hoge-mysql.test | 2021-10-17 10:16:37 0 [ERROR] Unknown/unsupported storage engine: InnoDB
hoge-mysql.test | 2021-10-17 10:16:37 0 [ERROR] Aborting
back_hoge-mysql.test_1 exited with code 1??
よくわかんないけど、laravelのコンテナは立ち上がっている。
MySQLのコンテナが立ち上がっていないことはわかった。
エラー文的に何か壊れていそうな気がする。
こうなったらコンテナごと削除して新しく作り直した方が手っ取り早い。
今回、DBのデータはseedで流せば同じのを作れる状態だったのでセーフ。
結論
以下のコマンドでコンテナを削除し、作り直した。
macbook-air-m1 test_dir % docker volume ls
DRIVER VOLUME NAME
local back_sailmysql
zmacbook-air-m1 test_dir % docker volume rm back_sailmysql
back_sailmysqlこの後にdocker-compose up -dなどでコンテナを立ち上げれば無事完了。
おまけ:原因
発生した環境
- M1 macbook air
- Docker Desktop
- mariaDB
原因となりそうなのは↑の3点。
エラー発生の直前にDocker Desktopのアプデをしたので、それが一番濃厚なのかな…?

zawa1205
webフロントエンドエンジニア