4.1.7 Debug Service Integration Issues
Debug Service Integration Issues
Common Integration Issues
| Issue | Cause | Solution |
|---|
| Lambda 502 from API GW | Wrong response format | Return statusCode, headers, body |
| Lambda 504 from API GW | Timeout > 29s | Optimize or use async |
| Lambda no internet in VPC | No NAT Gateway | Add NAT GW or VPC Endpoint |
| DynamoDB throttling | Hot partition | Better key design, on-demand |
| SQS reprocessing | Visibility timeout too short | Set ≥ 6x Lambda timeout |
| Kinesis IteratorAge ↑ | Consumer too slow | Increase parallelization factor |
Debugging Checklist
1. CloudWatch Logs → Error messages, stack traces
2. CloudWatch Metrics → Throttling, errors, latency
3. X-Ray → Request path, bottleneck service
4. CloudTrail → API calls, permission denied
5. VPC Flow Logs → Network connectivity
DynamoDB Issues
| Error | Cause | Fix |
|---|
| ProvisionedThroughputExceededException | Hot partition / low capacity | Better keys, on-demand |
| ValidationException | Item > 400KB | Reduce item size |
| ConditionalCheckFailedException | Condition not met | Handle in code |
SQS Issues
| Issue | Fix |
|---|
| Messages reprocessed | Visibility timeout ≥ 6x Lambda timeout |
| Messages in DLQ | Fix consumer, redrive |
| Duplicates (Standard) | Idempotency or FIFO |
Kinesis Issues
| Issue | Fix |
|---|
| IteratorAge increasing | Parallelization factor, optimize code |
| ReadProvisionedThroughputExceeded | Enhanced fan-out |
Exam Tip: SQS visibility timeout ≥ 6x Lambda timeout. DynamoDB throttling = hot partition. Kinesis IteratorAge = consumer lag. Lambda VPC no internet = NAT Gateway.