Skip to content

ECS Fargate issue on aws cicd deploy stage

0

I am receiving error on ecs fargate on aws cicd deoloy stage as below TaskSet <ecs-svc/8484996920922109149> is behind prod listener arn:aws:elasticloadbalancing:ap-southeast-1:791367083955:listener/app/ecs-dev-alb/72bfebe10b8ad3d2/8d5a7b137855163b. Verify that the TaskSet <ecs-svc/8484996920922109149> is still serving production traffic and update the listener rule if required. Refer to https://docs.aws.amazon.com/console/elasticloadbalancing/listeners/rules for information on updating listener rules

I have created this cluster usinig terraform

asked a year ago308 views

1 Answer
0
Accepted Answer

The error you're encountering suggests that there's an issue with the connection between your ECS Fargate task set and the Application Load Balancer (ALB) listener. This could be due to a few reasons:

  1. Listener Rule Configuration: The ALB listener rule might not be correctly configured to route traffic to your new task set. You may need to update the listener rule to ensure it's directing traffic to the correct target group associated with your new task set.

  2. Health Check Issues: The new task set might be failing health checks, preventing it from receiving traffic. This could be due to misconfigured health check settings or issues with the application itself.

  3. Network Configuration: There might be network-related problems preventing the ALB from communicating with the Fargate tasks. This could include issues with security groups, subnets, or VPC configuration.

To resolve this issue, you can try the following steps:

  1. Review your ALB listener rules and ensure they're correctly configured to route traffic to your new task set.

  2. Check the health status of your tasks in the ECS console. Look for any failed health checks or other issues preventing the tasks from becoming healthy.

  3. Verify that your VPC, subnet, and security group configurations allow proper communication between the ALB and your Fargate tasks.

  4. If you're using blue/green deployment, make sure the new task set is properly registered with the target group and that the listener rules are updated accordingly.

  5. Review your Terraform configuration to ensure all necessary resources and permissions are correctly defined for the ECS service, tasks, and ALB integration.

If the issue persists after these checks, you may need to investigate your application logs or CloudWatch metrics for more detailed information about why the task set is not serving production traffic as expected.
Sources
Fargate deployment can not pull from ECR | AWS re:Post
errorECS Deployment Circuit Breaker was triggered | AWS re:Post

answered a year ago

  • still this error The ELB could not be updated due to the following error: Primary taskset target group must be behind listener arn:aws:elasticloadbalancing:ap-southeast-1:791367083955:listener/app/ecs-dev-alb/72bfebe10b8ad3d2/8d5a7b137855163b. i have alb.tf resource "aws_lb" "ecs_alb" { name = "ecs-dev-alb" internal = false load_balancer_type = "application" security_groups = [aws_security_group.alb_sg.id] subnets = var.subnets }

    Define the green target group (active target group).

    resource "aws_lb_target_group" "green" { name = "ecs-green-tg" port = 3000 protocol = "HTTP" target_type = "ip" vpc_id = var.vpc_id

    health_check { path = "/healthcheck" interval = 30 matcher = "200-399" timeout = 5 healthy_threshold = 2 unhealthy_threshold = 2 } }

    Declare the blue target group for reference purposes.

    Although required by cicd.tf, this TG is not referenced in any listener rules.

    resource "aws_lb_target_group" "blue" { name = "ecs-blue-tg" port = 3000 protocol = "HTTP" target_type = "ip" vpc_id = var.vpc_id

    health_check { path = "/healthcheck" interval = 30 matcher = "200-399" timeout = 5 healthy_threshold = 2 unhealthy_threshold = 2 } }

    HTTPS listener: forward exclusively to the green target group.

    res

  • plz have a look on config and share fix

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.