AR ホームベーカリー

オイラのアウトプット用ホームベーカリー!

CircleCI の MySQL コンテナが落ちた

ロケ地

CI がコケる

ドキュメント更新してシェルスクリプト追加しただけで落ちたので「絶対にワイのせいじゃない!」という顔で details を見てた。

2021-03-19 02:30:57+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.33-1debian10 started.
2021-03-19 02:30:57+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2021-03-19 02:30:57+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.33-1debian10 started.
2021-03-19 02:30:57+00:00 [ERROR] [Entrypoint]: MYSQL_USER="root", MYSQL_PASSWORD cannot be used for the root user
    Use one of the following to control the root user password:
    - MYSQL_ROOT_PASSWORD
    - MYSQL_ALLOW_EMPTY_PASSWORD
    - MYSQL_RANDOM_ROOT_PASSWORD

Exited with code 1

CircleCI received exit code 1

はぁーん!

なおす

こういうことらしい。

johnmanjiro13.hatenablog.com

qiita.com

MySQL 5.7.32 を使うことにする

ちょうど作業しているプロジェクトがこの週末土日で佳境なので対応してる暇はねえ! という気持ちで決断的にコンテナを変更する。 5.7.33 以前にすればヨイ。

- image: circleci/mysql:5.7 としていたので、 - image: circleci/mysql:5.7.32 とガッチリ指定してやる。

.circleci/config.yml

これを

version: 2
jobs:
  build:
    docker:
      - image: circleci/ruby:2.5.1-node
        environment:
          RAILS_ENV: test
      - image: circleci/mysql:5.7

#snip#

こうする。

version: 2
jobs:
  build:
    docker:
      - image: circleci/ruby:2.5.1-node
        environment:
          RAILS_ENV: test
      - image: circleci/mysql:5.7.32

#snip#

なおった

f:id:donbulinux:20210319133000p:plain
脳死で Rerun した履歴