Closed5

ECSからECRがpullできない問題&サービス作成できない問題

おすしおすし

ECSでタスク定義からサービス作成しようとしたところ下記エラーが出た

ResourceInitializationError: unable to pull secrets or registry auth: execution resource retrieval failed: unable to retrieve ecr registry auth: service call has been retried 3 time(s): RequestError: send request failed caused by: Post "https://api.ecr.ap-northeast-1.amazonaws.com/": dial tcp x.x.x.x:443: i/o timeout. Please check your task network configuration.

https://stackoverflow.com/questions/61265108/aws-ecs-fargate-resourceinitializationerror-unable-to-pull-secrets-or-registry

fargateのバージョンが1.4だとエンドポイント設定する必要ありそうだったので一旦1.3で対応してみる

おすしおすし

1.3でやってみたけど

CannotPullContainerError: Error response from daemon: Get "https://xxxxx.dkr.ecr.ap-northeast-1.amazonaws.com/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

だったので

https://docs.aws.amazon.com/ja_jp/AmazonECS/latest/userguide/task_cannot_pull_image.html

プライベートサブネットのタスクでは、タスク起動時に [Auto-assign public IP] (自動割り当てパブリック IP) を [DISABLED] (無効) に指定し、VPC の NAT ゲートウェイを設定してリクエストをインターネットにルートします。詳細については、Amazon VPC ユーザーガイド の NAT ゲートウェイ を参照してください。

自動割り当てパブリックIPを無効にして作成してみる

おすしおすし

One or more target groups not found

で作成できない
ターゲットグループ設定してるんだけどなぁ

ECRpullするエラーではなくターゲットGのエラーになったからpullの問題は成功したのか?

おすしおすし

albのsecurity groupを追加したりecrのendpointを作ってたけどsubnetがecsが設置してあるsubnetじゃなかった(?)のと、<repository-name>.ecr.apiを追加した(すでに<repository-name>.ecr.dkrのエンドポイントはつくってた)りいろいろやったらDNS名アクセスすると503の画面が表示された

おすしおすし

普通にimaeにlatestタグついてなかったからだった・・・
タグつけたらいけた

このスクラップは2023/11/08にクローズされました