Skip to content

Troubleshooting

Find logs for one request

Use requestId from the error JSON, response header x-request-id, or the web client error object. Async jobs copy the same id on the SQS message attribute into Lambda logs.

In CloudWatch Logs Insights, filter JSON where requestId matches, optionally with service:

serviceWorkload
sophia-apiFargate API
sophia-interview-completedSettlement Lambda
sophia-report-generateReport Lambda

Look for request.completed / request.failed (status, duration, path) or central logs Unhandled error (5xx) / Request rejected (4xx). If the id is unknown, the failure likely happened before observability middleware or without async context.

Health

bash
curl -sS "$BASE_URL/health" | jq .
pnpm smoke

/health is always HTTP 200; degraded means Mongo is down while the process is up. ALB uses the same path—502/503 with local smoke OK often means targets or deploy, not the health JSON alone.

Quick fixes

SymptomCheck
401/403Token, user status, suspended org
No settlementUnset queue URL (API warn); SQS/DLQ
Report stuckReport queue backlog; Lambda ERROR + DLQ
Mongo issuesmongo.connection_failed; stage URI
StripeWebhook secret and signature logs

DLQ messages need manual inspect/redrive after root-cause fix. Schema-invalid SQS bodies are dropped and do not DLQ via retry.

Sophia AI Interview Platform — Internal Documentation