Resource Initialization error in ECS fargate service

0

I have created task defintion with cft and passed the environment variable through the arn of s3 bucket. Its working for one service but for another its giving resource initialization errror.

The env file is available in the s3 bucket still I am getting this error and permission to get object from s3 bucket is also given.

These are the permissions which are given to the execution role:

s3:ListBucket,s3:PutObject,s3:GetObject,s3:GetBucketLocation,sqs:sendmessage,ecr:GetAuthorizationToken,ecr:BatchCheckLayerAvailability,ecr:GetDownloadUrlForLayer,ecr:BatchGetImage,logs:CreateLogStream,logs:PutLogEvents,ecs:RunTask,iam:PassRole

Enter image description here

1개 답변
0

Ref: https://repost.aws/knowledge-center/ecs-task-environment-variables

"ResourceInitializationError: failed to download env files: file download command: non empty error stream"

You might face issues when you pass environment variables to your Amazon ECS tasks due to the following reasons:

Your Amazon ECS task execution role doesn't have the required AWS Identity and Management (IAM) permissions. There are issues with your network configuration. Your application is unable to read the environment variable. The format of variable in the container definition is incorrect. The environment variable isn't automatically refreshed. To troubleshoot the errors for Amazon ECS tasks that fail to start, use the AWSSupport-TroubleshootECSTaskFailedToStart runbook. Then, refer to the relevant troubleshooting steps for your issue.

It could also be linking wrong security group to the service or attaching internet gateway to route table . Check if public ip is enabled on ECS

profile picture
답변함 5달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠