Skip to main content
Solutions for common issues encountered when deploying to AWS.

ECS Task Issues

Cause: Container not responding to health checksVerify the /health endpoint works:
Should return: {"status": "ok", "instantiated_at": "..."}If this fails, check CloudWatch logs for startup errors:
Cause: Container starts but fails health checksCheck the logs for the startup sequence:
Look for:
  • Application startup complete - Container started
  • SIGTERM - Health check failed, container being killed
Common causes:
  • Database connection failing (check DB_HOST, DB_PASS)
  • Missing environment variables
  • App crashes after startup
Cause: Multiple uvicorn workers with DuckDBDuckDB requires single-writer access. Ensure your command uses one worker:
Do NOT increase --workers if using Pal agent.
Cause: No EFS configuredPal stores data in DuckDB at /data/pal.db. Without EFS, this is lost on container restart.See: EFS Setup Guide
Cause: IAM permissions or secret doesn’t existVerify secrets exist:
If missing, redeploy with ag infra up prd:aws to create them from your YAML files.

Docker & ECR Issues

Cause: Docker not authenticated to ECRRun the authentication script:
Or manually:
ECR tokens expire after 12 hours. Re-run if you get this error after a break.
Large images can timeout on slow connections. Try:
  1. Build with -f flag to ensure fresh layers
  2. Check your network connection
  3. Consider using GitHub Actions for CI/CD builds

Database Issues

Cause: Special characters in passwordAvoid @, #, %, & in DB_PASS. These require URL encoding and cause silent connection failures.Safe characters: alphanumeric, !, -, _
Check security group allows ECS to access RDS:
The database security group must allow inbound port 5432 from the ECS security group.
RDS must be in a public subnet with publicly_accessible=True (the default).Add your IP to the security group or use a bastion host.

EFS Issues

Ensure mount targets exist in the same subnets as your ECS tasks:
Each subnet in aws_subnet_ids needs its own mount target.
Check that your access point uses UID/GID 61000 to match the container user:
The POSIX user should be Uid: 61000, Gid: 61000.

Debugging Commands

SSH Access

Local Development

Production (ECS)