Skip to main content

Common errors

From the API​

SymptomLikely causeWhat to do
404 on a route that exists in GoThe path is missing from authedRoutes in api-stack.ts, so API Gateway answers before the Lambda runs.Add the route there and update the route count in infra/test/api-stack.test.ts.
401 for a signed-in caregiverThe token expired, or the account is closed.Check the caller's user row in caregiver-{stage}-v1-user (status).
Invitations don't match, or a new caregiver has no emailThe app sent the Cognito access token instead of the ID token. API Gateway accepts either, but only the ID token carries email and name.Check the app's AuthMiddleware sends idToken().
403The caller is not on the record's care team, or the action needs the team's admin.Expected behavior. Check the caller's memberships in caregiver-{stage}-v1-membership.
404 for a record that existsThe record is archived, or its care team is closed.Expected behavior; see the API overview.
500 with a short messageA handler hit an error.Find the "server error" line for that request_id in Logs; err has the cause.
Every request fails after a deploy, with must be set in the logsA new environment variable is read in Go but not set in CDK. The Lambda exits at startup.Add it to the function's environment in api-stack.ts and redeploy, or revert.
429 on Send feedbackThat route allows 1 request a second, bursts of 5.Expected behavior.
A flag change doesn't take effectAppConfig answers are cached for about 45 seconds.Wait a minute.

From the generator​

SymptomLikely causeWhat to do
A new schedule shows no upcoming entriesWriting entries after the save failed ("schedule generation failed").The daily run fills them in, or run the generator by hand (see Alarms).
Coming up is empty for everyoneThe generator hasn't run for over two weeks.Check its log group for recent "run complete" lines and the EventBridge rule.

From CI and deploys​

SymptomLikely causeWhat to do
lint fails on PrettierUnformatted files.pnpm exec prettier --write <files> and commit.
Commit rejected by commitlintThe message isn't a Conventional Commit, or its subject starts with a capital letter.Reword, for example fix(api): ….
Codegen drift check failsThe contract changed but the generated files weren't regenerated.cd shared/types-go && make codegen, then commit. The pre-commit hook normally does this.
docs job failsA broken link in the docs, a page linking to a file that moved, or private data on a page.Run pnpm --filter @caregiver/docs build and python3 scripts/check-docs.py locally.
A deploy fails with "export … cannot be deleted"One stack still imports a value another stack is trying to remove.Deploy in two steps: stop using it, then remove it (Infrastructure).
cdk diff on the PR shows surprise changesSomeone changed AWS by hand, or CDK context drifted.Read the diff before merging. Merging applies it to prod.