Troubleshooting Amazon ECS deployment strategy updates
This section provides solutions for common issues you might encounter when migrating deployment strategies.
Multiple service revisions or tasks sets
The following issues relate to having multiple service revisions for a deployment.
- Multiple task sets when updating ECS deployment controller
-
Error message:
Updating the deployment controller is not supported when there are multiple tasksets in the service. Please ensure your service has only one taskset and try again.Solution: This error occurs when attempting to change the deployment controller type of a service with multiple active task sets. To resolve this issue for the
CODE_DEPLOYorEXTERNALdeployment controller:-
Check current task sets:
aws ecs describe-services --clusteryour-cluster-name--servicesyour-service-name--query "services[0].taskSets" -
Wait for any in-progress deployments to complete.
-
Force a new deployment to clean up task sets:
aws ecs update-service --clusteryour-cluster-name--serviceyour-service-name--force-new-deployment -
If necessary, delete extra task sets manually:
aws ecs delete-task-set --clusteryour-cluster-name--serviceyour-service-name--task-settask-set-id -
After only one task set remains, retry updating the deployment controller.
For more information, see Amazon ECS service deployment controllers and strategies.
-
- Missing primary task set when updating
ECSdeployment controller -
Error message:
Updating the deployment controller requires a primary taskset in the service. Please ensure your service has a primary taskset and try again.Solution: This error occurs when attempting to change the deployment controller type of a service that doesn't have a primary task set. To resolve this issue:
-
Verify the service status and task sets. ). If a task set exists in the service, it should be marked as
ACTIVE.aws ecs describe-services --clusteryour-cluster-name--servicesyour-service-name--query "services[0].taskSets[*].[status,id]If there are no task sets in the
ACTIVEstate, migrate the deployment. For more information, see Migration approaches. -
If the service has no running tasks, deploy at least one task by updating the service:
aws ecs update-service-primary-task-set --clusteryour-cluster-name--serviceyour-service-name--primary-task-set your-taskset-idThis will mark the (previously
ACTIVE) task set in the service asPRIMARYstatus. -
Wait for the task to reach a stable running state. You can check the status with:
aws ecs describe-services --clusteryour-cluster-name--servicesyour-service-name--query "services[0].deployments" -
After the service has a primary task set with running tasks, retry updating the deployment controller.
For more information, see Amazon ECS service deployment controllers and strategies.
-
Mismatch between the deployment failure detection type and deployment controller
The following issues relate to a mismatch between the deployment failure detection type and deployment controller.
- Deployment circuit breaker with non-ECS controller
-
Error message:
Deployment circuit breaker feature is only supported with ECS deployment controller. Update to ECS deployment controller and try again.Solution: This error occurs when attempting to enable the deployment circuit breaker feature on a service that is not using the
ECSdeployment controller. The deployment circuit breaker is only compatible with theECSdeployment controller.-
Check your service's current deployment controller:
aws ecs describe-services --clusteryour-cluster-name--servicesyour-service-name--query "services[0].deploymentController" -
Update your service to use the
ECSdeployment controller:aws ecs update-service --clusteryour-cluster-name--serviceyour-service-name--deployment-controller type=ECS -
After the service is using the
ECSdeployment controller, enable the deployment circuit breaker:aws ecs update-service --clusteryour-cluster-name--serviceyour-service-name--deployment-configuration "deploymentCircuitBreaker={enable=true,rollback=true}"
For more information, see How the Amazon ECS deployment circuit breaker detects failures.
-
- Alarm-based rollback with non-ECS controller
-
Error message:
Alarm based rollback feature is only supported with ECS deployment controller. Update to ECS deployment controller and try again.Solution: This error occurs when attempting to configure alarm-based rollback on a service that is not using the
ECSdeployment controller. The alarm-based rollback feature is only compatible with theECSdeployment controller.-
Check your service's current deployment controller:
aws ecs describe-services --clusteryour-cluster-name--servicesyour-service-name--query "services[0].deploymentController" -
Update your service to use the
ECSdeployment controller:aws ecs update-service --clusteryour-cluster-name--serviceyour-service-name--deployment-controller type=ECS -
After the service is using the
ECSdeployment controller, configure alarm-based rollback:aws ecs update-service --clusteryour-cluster-name--servicesyour-service-name--deployment-configuration "alarms={alarmNames=[your-alarm-name],enable=true,rollback=true}"
For more information, see How CloudWatch alarms detect Amazon ECS deployment failures.
-
Mismatch between Service Connect and the deployment controller
The following issues relate to a mismatch between Service Connect and the deployment controller.
EXTERNALcontroller with Service Connect-
Error message:
The EXTERNAL deployment controller type is not supported for services using Service Connect.Solution: This error occurs when attempting to use the
EXTERNALdeployment controller with an service that has Service Connect enabled. TheEXTERNALcontroller is not compatible with Service Connect.-
Check if your service has Service Connect enabled:
aws ecs describe-services --clusteryour-cluster-name--services your-service-name --query "services[0].serviceConnectConfiguration" -
If you need to use the
EXTERNALdeployment controller, disable Service Connect by updating your service:aws ecs update-service --cluster your-cluster-name --service your-service-name --service-connect-configuration "{}" -
Alternatively, if you must use Service Connect, use the
ECSdeployment controller instead:aws ecs update-service --cluster your-cluster-name --service your-service-name --deployment-controller type=ECS
For more information, see Amazon ECS service deployment controllers and strategies.
-
- Service Connect with non-ECS controller
-
Error message:
Service Connect feature is only supported with ECS (rolling update) deployment controller. Update to ECS deployment controller and try again.Solution: This error occurs when attempting to enable Service Connect on a that is not using the
ECSdeployment controller. The Service Connect feature is only compatible with theECSdeployment controller.-
Check your service's current deployment controller:
aws ecs describe-services --clusteryour-cluster-name--servicesyour-service-name--query "services[0].deploymentController" -
Update your service to use the ECS deployment controller:
aws ecs update-service --clusteryour-cluster-name--serviceyour-service-name--deployment-controller type=ECS -
Once the service is using the ECS deployment controller, enable Service Connect:
aws ecs update-service --clusteryour-cluster-name--serviceyour-service-name--service-connect-configuration "enabled=true,namespace=your-namespace"
For more information, see Amazon ECS service deployment controllers and strategies.
-
Mismatch between controller type and scheduling strategy
The following issues relate to a mismatch between controller type and scheduling strategy.
CODE_DEPLOYcontroller withDAEMONscheduling strategy-
Error message:
The CODE_DEPLOY deployment controller type is not supported for services using the DAEMON scheduling strategy.Solution: This error occurs when attempting to use the CODE_DEPLOY deployment controller with a service that uses the
DAEMONscheduling strategy. TheCODE_DEPLOYcontroller is only compatible with theREPLICAscheduling strategy.-
Check your service's current scheduling strategy:
aws ecs describe-services --clusteryour-cluster-name--servicesyour-service-name--query "services[0].schedulingStrategy" -
If you need blue/green deployments, change your service to use the
REPLICAscheduling strategy:aws ecs update-service --clusteryour-cluster-name--serviceyour-service-name--scheduling-strategy REPLICA -
Alternatively, if you must use the
DAEMONscheduling strategy, use theECSdeployment controller instead:aws ecs update-service --clusteryour-cluster-name--serviceyour-service-name--deployment-controller type=ECS
For more information, see Amazon ECS service deployment controllers and strategies.
-
- EXTERNAL controller with DAEMON scheduling strategy
-
Error message:
The EXTERNAL deployment controller type is not supported for services using the DAEMON scheduling strategy.Solution: This error occurs when attempting to use the EXTERNAL deployment controller with an ECS service that uses the DAEMON scheduling strategy. The EXTERNAL controller is only compatible with the REPLICA scheduling strategy.
-
Check your service's current scheduling strategy:
aws ecs describe-services --clusteryour-cluster-name--servicesyour-service-name--query "services[0].schedulingStrategy" -
If you need to use the
EXTERNALdeployment controller, change your service to use theREPLICAscheduling strategy:aws ecs update-service --clusteryour-cluster-name--serviceyour-service-name--scheduling-strategy REPLICA -
Alternatively, if you must use the
DAEMONscheduling strategy, use theECSdeployment controller instead:aws ecs update-service --clusteryour-cluster-name--serviceyour-service-name--deployment-controller type=ECS
For more information, see Amazon ECS service deployment controllers and strategies.
-
- Service registries with external launch type
-
Error message:
Service registries are not supported for external launch type.Solution: This error occurs when attempting to configure service discovery (service registries) for a service that uses the
EXTERNALlaunch type. Service discovery is not compatible with theEXTERNALlaunch type.-
Check your service's current launch type:
aws ecs describe-services --clusteryour-cluster-name--servicesyour-service-name--query "services[0].launchType" -
If you need service discovery, change your service to use either the
EC2orFARGATElaunch type:aws ecs update-service --clusteryour-cluster-name--serviceyour-service-name--launch-type FARGATE -
Alternatively, if you must use the
EXTERNALlaunch type, remove the service registry configuration:aws ecs update-service --clusteryour-cluster-name--serviceyour-service-name--service-registries "[]"
For more information, see Amazon ECS service deployment controllers and strategies.
-
Revert a deployment controller update
If you decide that you want to return to the previous deployment controller, you can do one of the following:
-
If you used Amazon CloudFormation, you can use the previous template to create a new stack. For more information, see Create a stack from in the Amazon CloudFormation User Guide.
-
If you used the Amazon ECS console, or the Amazon CLI, you can update the service. For more information, see Updating an Amazon ECS service.
If you use the update-service command, use the
--deployment-controlleroption and set it to the previous deployment controller.