Common Issues
Auth errors, env mismatches, and local vs production discrepancies.
Quick reference for the most frequently encountered development issues and their fixes.
Authentication errors
"Invalid or expired token"
- Check that Cognito app client IDs match your
.env.local - Verify redirect URIs include your local URL
- Clear browser storage and re-login
- Confirm token hasn't expired (access tokens last 1 hour)
"Redirect URI mismatch"
Add your local URL to Cognito app client settings:
http://localhost:3000/callback
http://localhost:3000Environment mismatches
API calls fail locally but work in staging
- Compare
.env.localvalues with staging environment - Check
NEXT_PUBLIC_values were set before build (they're baked in) - Verify the API server is running on the expected port
Database connection refused
docker compose ps # Check if postgres is running
docker compose up -d postgres redis
pnpm db:migrate # Apply pending migrationsPort conflicts
lsof -i :3000 # Find process using port 3000
kill -9 <PID> # Stop the conflicting process
pnpm dev # Restart dev serverProduction rollback
If a deployment causes production issues:
kubectl -n production rollout history deployment/backend-api
kubectl -n production rollout undo deployment/backend-api
kubectl -n production rollout status deployment/backend-apiAlways communicate in the engineering channel before rolling back.