對 Amazon ECS ResourceInitializationError 錯誤進行疑難排解
以下是部分 ResourceInitialization 錯誤訊息以及可採取的錯誤修正動作。
若要使用 AWS Management Console 檢查已停止任務的錯誤訊息,請參閱檢視 Amazon ECS 已停止任務錯誤。
錯誤
The task cannot pull registry authentication from Amazon ECR. There is a connection issue between the task and Amazon ECR. Check your task network configuration.
此錯誤表示任務無法連線至 Amazon ECR。
檢查任務與 Amazon ECR 之間的連線。如需相關資訊,請參閱驗證 Amazon ECS 已停止任務的連線狀態。
The task can't download the environment variable files from Amazon S3. There is a connection issue between the task and Amazon S3. Check your task network configuration.
當任務無法從 Amazon S3 下載環境檔案時,就會發生此錯誤。
檢查任務與 Amazon S3 VPC 端點之間的連線。如需相關資訊,請參閱驗證 Amazon ECS 已停止任務的連線狀態。
The task cannot pull secrets from AWS Systems Manager Parameter Store. Check your network connection between the task and AWS Systems Manager.
當任務無法使用 Systems Manager 中的憑證提取任務定義中定義的映像時,就會發生此錯誤。
檢查任務與 Systems Manager VPC 端點之間的連線。如需相關資訊,請參閱驗證 Amazon ECS 已停止任務的連線狀態。
The task can’t pull secrets from AWS Secrets Manager. There is a connection issue between the task and Secrets Manager. Check your task network configuration.
當任務無法使用 Secrets Manager 中的憑證提取任務定義中定義的映像時,就會發生此錯誤。
此錯誤表示 Systems Manager VPC 端點與任務之間存在網路連線問題。
如需有關如何驗證任務與端點之間連線的資訊,請參閱驗證 Amazon ECS 已停止任務的連線狀態。
The task can’t pull the secret from Secrets Manager. The task can't retrieve the secret with ARN ‘secretARN' from Secrets Manager. Check whether the secret exists in the specified Region.
當任務無法使用 Secrets Manager 中的憑證提取任務定義中定義的映像時,就會發生此錯誤。
此問題由以下其中一個原因造成:
| 錯誤原因... | 執行此作業... |
|---|---|
|
Secrets Manager VPC 端點與任務之間存在網路連線問題。 在錯誤訊息中看到下列任何字串時,表示存在網路問題:
|
驗證任務與 Secrets Manager 端點之間的連線狀態。如需更多詳細資訊,請參閱 驗證 Amazon ECS 已停止任務的連線狀態。 |
| 任務定義中所定義的任務執行角色,沒有 Secrets Manager 所需的許可。 |
將 Secrets Manager 所需的許可新增至任務執行角色。如需更多詳細資訊,請參閱 Secrets Manager 或 Systems Manager 許可。 |
| 秘密 ARN 不存在 | 檢查 Secrets Manager 中是否存在 ARN。如需有關檢視映像的資訊,請參閱 Secrets Manager Developer Guide 中的 Find secrets in Secrets Manager。 |
pull command failed: unable to pull secrets or registry auth Check your task network configuration.
當任務無法連線至 Amazon ECR、Systems Manager 或 Secrets Manager 時,就會發生此錯誤。此問題源自於網路組態錯誤。
若要修正此問題,請驗證任務與 Amazon ECR 之間的連線狀態。您也需要檢查任務與儲存秘密的服務 (Systems Manager 或 Secrets Manager) 之間的連線狀態。如需更多詳細資訊,請參閱 驗證 Amazon ECS 已停止任務的連線狀態。
任務找不到任務定義中所定義的 Amazon CloudWatch 日誌群組。There is a connection issue between the task and Amazon CloudWatch. Check your network configuration.
當任務找不到您在任務定義中定義的 CloudWatch 日誌群組時,就會發生此錯誤。
此錯誤表示 CloudWatch VPC 端點與任務之間存在網路連線問題。
如需有關如何驗證任務與端點之間連線的資訊,請參閱驗證 Amazon ECS 已停止任務的連線狀態。
failed to initialize logging driver
當任務找不到您在任務定義中定義的 CloudWatch 日誌群組時,就會發生此錯誤。
此錯誤表示任務定義中的 CloudWatch 群組不存在。
使用下列步驟尋找缺少的 CloudWatch。
-
執行下列命令來取得任務定義資訊。
aws ecs describe-task-definition \ --task-definitiontask-def-name查看每個容器的輸出,並記下
awslogs-group值。"logConfiguration": { "logDriver": "awslogs", "options": { "awslogs-group": "/ecs/example-group", "awslogs-create-group": "true", "awslogs-region": "us-east-1", "awslogs-stream-prefix": "ecs" }, 確認群組存在於 CloudWatch 中。如需詳細資訊,請參閱 Amazon CloudWatch Logs User Guide 中的 Working with log groups and log streams。
問題可能是任務定義中指定的群組不正確,也可能是日誌群組不存在。
-
修正問題。
問題是... 執行此作業... 任務定義中指定了不正確的日誌群組。
更新任務定義,在容器定義中包含日誌群組組態。如需有關更新任務定義的資訊,請參閱使用主控台更新 Amazon ECS 任務定義,或 Amazon Elastic Container Service API Reference 中的 RegisterTaskDefinition。 CloudWatch 中不存在日誌群組 建立日誌群組。如需詳細資訊,請參閱《Amazon CloudWatch Logs 使用者指南》中的在 CloudWatch Logs 中建立日誌群組。
無法調用 EFS utils 命令來設定 EFS 磁碟區
下列問題可能會阻止您在任務上掛載 Amazon EFS 磁碟區:
Amazon EFS 檔案系統設定不正確。
任務缺少必要許可。
存在與網路與 VPC 組態相關的問題。
如需有關如何偵錯與修正此問題的資訊,請參閱 AWS re:Post 上的為什麼我無法在 AWS Fargate 任務上掛載 Amazon EFS 磁碟區