何が起きた?
.circleci/config.ymlを触っていないのに動いていたデプロイ機構が下記のエラーを吐いて動かなくなりました。
circleciのエラー文
#!/bin/bash -eo pipefail
sudo apt-get -y -qq update
sudo apt-get install python-pip python-dev build-essential
sudo pip install awscli awsebcli==3.14.6
W: The repository 'http://security.debian.org/debian-security stretch/updates Release' does not have a Release file.
W: The repository 'http://deb.debian.org/debian stretch Release' does not have a Release file.
W: The repository 'http://deb.debian.org/debian stretch-updates Release' does not have a Release file.
E: Failed to fetch http://security.debian.org/debian-security/dists/stretch/updates/main/binary-amd64/Packages 404 Not Found
E: Failed to fetch http://deb.debian.org/debian/dists/stretch/main/binary-amd64/Packages 404 Not Found
E: Failed to fetch http://deb.debian.org/debian/dists/stretch-updates/main/binary-amd64/Packages 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
Exited with code exit status 100
CircleCI received exit code 100
原因(結論)
image:circleci/php:7.3-apache-stretch
の中で使われているセキュリティファイル(security.debian.org)のサポートが終わったことで動かなくなっていました。
解決方法
image:circleci/php:7.3-apache-bullseye
を使用することで元通り動かすことができるようになりました。
余談
筆者の場合は古い環境でのデプロイをしていたため、bullseyeのバージョンに合わず、本題とは別の下記のエラーも出ていました。
circleciのエラー文
#!/bin/bash -eo pipefail
sudo apt-get -y -qq update
sudo apt-get install python-pip python-dev build-essential
sudo pip install awscli awsebcli==3.14.6
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'python-dev-is-python2' instead of 'python-dev'
Package python-pip is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
python3-pip
E: Package 'python-pip' has no installation candidate
Exited with code exit status 100
CircleCI received exit code 100
そのため、sudo apt-get install python-pip python-dev build-essential
をsudo apt-get install python3-pip python-dev-is-python2 build-essential
と変更する修正も必要でした。
ソースコード
circleciのソースコード(エラーが出たもの)
# ==略==
defaults: &defaults
environment:
NPM_CONFIG_LOGLEVEL: "info"
ARCH: "x64"
AWS_ACCOUNT_ID: "xxxxxxxxxxxx"
ECR_ENDPOINT: xxxxxxxxxxxx.dkr.ecr.ap-northeast-1.amazonaws.com
working_directory: ~/directory_name
docker:
- image: circleci/php:7.3-apache-stretch # ←ここがエラーを出した
# ==略==
references:
commands:
install_awscli_awsebcli: &install_awscli_awsebcli
name: Installing deployment dependencies
working_directory: /
command: |
sudo apt-get -y -qq update
sudo apt-get install python-pip python-dev build-essential # ←ここがエラーを出した
sudo pip install awscli awsebcli==3.14.6
# ==略==
circleciのソースコード(治したもの)
# ==略==
defaults: &defaults
environment:
NPM_CONFIG_LOGLEVEL: "info"
ARCH: "x64"
AWS_ACCOUNT_ID: "xxxxxxxxxxxx"
ECR_ENDPOINT: xxxxxxxxxxxx.dkr.ecr.ap-northeast-1.amazonaws.com
working_directory: ~/directory_name
docker:
- image: circleci/php:7.3-apache-bullseye # ←直した
# ==略==
references:
commands:
install_awscli_awsebcli: &install_awscli_awsebcli
name: Installing deployment dependencies
working_directory: /
command: |
sudo apt-get -y -qq update
sudo apt-get install python3-pip python-dev-is-python2 build-essential # ←直した
sudo pip install awscli awsebcli==3.14.6
# ==略==