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
eb status
eb health
Step 2: Check Recent Events
eb events
Step 3: Get Logs
eb logs
eb logs --all
Step 4: Check Configuration
# View config (non-interactive):
aws elasticbeanstalk describe-configuration-settings \
--application-name <app-name> \
--environment-name <env-name> --output json
# View environment variables:
eb printenv
Step 5: Inspect Health via AWS CLI
Environment-level health (requires enhanced health reporting):
aws elasticbeanstalk describe-environment-health \
--environment-name <env-name> \
--attribute-names All --output json
Per-instance health (requires enhanced health reporting):
aws elasticbeanstalk describe-instances-health \
--environment-name <env-name> \
--attribute-names All --output json
Provisioned resources:
aws elasticbeanstalk describe-environment-resources \
--environment-name <env-name> --output json
Check individual instance status:
aws ec2 describe-instance-status --instance-ids <id> --output json
Check load balancer target health:
aws elbv2 describe-target-health --target-group-arn <arn> --output json
Step 6: SSH to Instance
eb ssh
eb ssh --instance <instance-id>
eb ssh --setup # Configure SSH key if not set up
Common SSH debugging:
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)
For common EB CLI error messages and solutions, see the eb skill (Error Reference table).
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
Additional Resources
Converted and distributed by TomeVault — claim your Tome and manage your conversions.