Troubleshoot
Diagnose issues, debug failures, and resolve common Elastic Beanstalk problems using a structured workflow.
When to Use
- •Environment is unhealthy (red/yellow)
- •Deployment failed
- •Application errors or crashes
- •High latency or performance issues
- •Health check failures
- •502 Bad Gateway errors
- •Out of memory issues
- •Database connection problems
When NOT to Use
- •Routine status checks → use
statusskill - •Just viewing logs → use
logsskill - •Changing configuration → use
configskill
Diagnostic workflow: Status → Health → Events → Logs → Config → SSH
Step 1: Check Status and Health
bash
eb status eb health
Step 2: Check Recent Events
bash
eb events
Step 3: Get Logs
bash
eb logs eb logs --all
Step 4: Check Configuration
bash
eb config eb printenv
Step 5: Inspect Health via AWS CLI
Environment-level health (requires enhanced health reporting):
bash
aws elasticbeanstalk describe-environment-health \ --environment-name <env-name> \ --attribute-names All --output json
Per-instance health (requires enhanced health reporting):
bash
aws elasticbeanstalk describe-instances-health \ --environment-name <env-name> \ --attribute-names All --output json
Provisioned resources:
bash
aws elasticbeanstalk describe-environment-resources \ --environment-name <env-name> --output json
Check individual instance status:
bash
aws ec2 describe-instance-status --instance-ids <id> --output json
Check load balancer target health:
bash
aws elbv2 describe-target-health --target-group-arn <arn> --output json
Step 6: SSH to Instance
bash
eb ssh eb ssh --instance <instance-id>
Common SSH debugging:
bash
tail -f /var/log/web.stdout.log tail -f /var/log/web.stderr.log cat /var/log/eb-engine.log | grep -i error top free -m df -h curl localhost:80/health
Common Issues & Fixes
Health Check Failures (Red/Yellow):
- •Health check path wrong →
eb config→ setHealthCheckPath = /health - •App too slow to start → increase health check interval
- •Port mismatch → check
eb printenvfor PORT
Deployment Failures:
- •Build failed → check package.json/requirements.txt
- •App crash on start → check start command, verify env vars:
eb printenv - •Permissions → check IAM instance profile
High Latency:
- •Scale up:
eb config→ change InstanceType - •Add instances:
eb scale 3 - •Enable caching
Out of Memory:
- •Upgrade instance type
- •
eb ssh→dmesg | grep -i oom
Database Connection Issues:
- •Check env vars:
eb printenv | grep DATABASE - •Security groups: use
eb-infraskill (security) - •RDS status: use
eb-infraskill (database)
Error Reference
| Error | Solution |
|---|---|
| Not initialized | eb init |
| No environment found | eb list then eb use <env> |
| Credentials not configured | aws configure |
| CNAME already taken | eb create <env> --cname <different-prefix> |
| Environment limit reached | Terminate unused environments |
| Deployment in progress | eb status to check, eb abort to cancel |
Composability
- •View raw logs: Use
logsskill - •Check status/health: Use
statusskill - •Change configuration: Use
configskill - •Database/security issues: Use
eb-infraskill - •Documentation: Use
eb-docsskill