Issue
When installing Appsmith on AWS ECS using this setup guide, the task may get stuck in a pending state. This article explains how to troubleshoot such issues.
Resolution
The "context deadline exceeded" error is typically caused by configuration mistakes on the user's side. To diagnose the issue, check the server logs for error messages such as:
Error response from daemon: create ecs-appsmith_task-1-appsmith_stack-...:
Post "http://%2Frun%2Fdocker%2Fplugins%2Famazon-ecs-volume-plugin.sock/VolumeDriver.Create":
context deadline exceeded
You may also encounter the following service events indicating deployment issues:
-
Insufficient Memory:
service appsmith-prod was unable to place a task because no container instance met all of its requirements. The closest matching container-instance .... has insufficient memory available.
-
Deployment Configuration Error:
service appsmith-prod was unable to stop or start tasks during a deployment because of the service deployment configuration. Update the minimumHealthyPercent or maximumPercent value and try again.
To resolve these issues, follow these steps:
- Set Network Mode: Ensure that the network mode in your task definition is set to default. If a different network mode is selected, it may cause issues.
- Update Task Definition:
- Access your ECS task definition in the AWS console.
- Edit the task definition to set:
- Network mode: default
- Task role: default
- Task execution role: default
- Keep all other settings at their default values.
- Save and deploy the updated task definition.
- Check Memory Requirements: Confirm that your EC2 instances have sufficient memory for the task. If necessary, increase the instance size or adjust ECS memory settings.
- Adjust Deployment Configuration: If you experience task placement or deployment errors, update the minimumHealthyPercent or maximumPercent values in the service's deployment configuration.
For further guidance, refer to the AWS ECS Installation Guide for Appsmith.