Now domain-agnostic — configure any practice with Domain Packs (immigration is the reference pack)

Troubleshooting

Audience: Anyone running or deploying the Case Automation MCP Server who encounters an error.
What you will accomplish: Diagnose and resolve the most common setup, runtime, and deployment issues.
Estimated time: Varies by issue — most fixes take under 5 minutes.

Setup and installation

SymptomCauseFix
requires-python >=3.12 errorSystem Python is 3.11 or earlierAlways run commands through uv run …uv resolves the correct Python version
uv: command not founduv not installedInstall: curl -LsSf https://astral.sh/uv/install.sh | sh
uv sync fails with resolver errorLock file out of dateDelete .venv/ and uv.lock, then uv sync --extra dev
AttributeError: 'PrintLogger' in testsOutdated conftest.pyPull latest main; the _reset_global_singletons fixture handles this

Environment and configuration

SymptomCauseFix
RuntimeError: Intake services not configuredconfigure_services() not calledUse the official entry point cam.sidecar.main which bootstraps all services
KeyError: workflow 'intake' not registeredregister_intake_workflow() not calledSame — use the official entry point
Database connection refusedPostgreSQL not running or wrong URLVerify CAM_DATABASE_URL in .env; run docker ps to check containers
Redis connection refusedRedis not runningVerify CAM_REDIS_URL; run docker compose up -d redis
Encryption key error on startupInvalid KEK formatKEK must be base64-encoded 32 bytes; use python -c "import base64, os; print(base64.b64encode(os.urandom(32)).decode())" to generate

Database migrations

SymptomCauseFix
Can't locate revisionMigration directory out of syncRun uv run alembic current to check state; if stuck, uv run alembic stamp head to realign
alembic upgrade head fails with SQL errorSchema conflict from partial migrationInspect the failed migration; apply manually or reset: docker compose down -v && docker compose up -d postgres then re-run

Tests

SymptomCauseFix
Tests fail on PrintLoggerOutdated conftestPull latest main branch
424 passed becomes fewerNew test regressionRun uv run pytest -q --tb=short for failure details; check recent changes
Flaky test on test_reminder_fires_exactly_onceRace in scheduler mockThis test is intentionally skipped in CI — not a blocker

Workflow runtime

SymptomCauseFix
Workflow stuck in awaiting_approvalNo approver has acted on the gateCall workflow.approve via MCP tool, or visit /approvals/{token} in the sidecar
Workflow in parked statusFatal error or auth failureCheck audit log for the step that failed; fix the underlying issue, then re-drive from the sidecar
ConnectorError(auth)OAuth token expired or invalidRe-authorise the connector; check CAM_SECRET_BACKEND configuration
ConnectorError(rate_limit)Too many requests to vendor APIAutomatic retry with backoff; if persistent, reduce polling frequency
Duplicate email sentIdempotency key not providedAlways provide idem_key on email.send and write tools
Privileged document routed externallyShould never happen — this is a safety invariantIf observed, this is a critical bug — report immediately. The privilege gate should block this regardless of approval

Sidecar and webhooks

SymptomCauseFix
Webhook returns 401Invalid HMAC signatureVerify the webhook secret configuration matches the provider's dashboard
Webhook returns duplicateEvent already processedNormal behaviour — idempotent ingestion; check audit log for the original processing
Approval page shows "token expired"Gate TTL exceeded (default 24h)Re-trigger the workflow run; the expired token cannot be revived
Sidecar health endpoint returns 500Application startup failureCheck sidecar logs: uv run uvicorn cam.sidecar.main:app --port 8001 with --log-level debug

Deployment

SymptomCauseFix
Build fails with "Module not found"Missing npm dependenciesRun pnpm install or npm install before building
MDX pages not renderingNextra config issueVerify next.config.mjs has output: 'export' and nextra wrapper
Styles not loadingCSS import missingCheck _app.tsx imports ../styles/globals.css
404 on page refreshSPA routing without redirectsEnsure trailingSlash: true in next.config.mjs and redirects in netlify.toml
Search not workingMissing search indexNextra generates index at build time; check for build warnings
Still stuck?

If your issue isn't listed here, check the GitHub issues (opens in a new tab) or open a new one with the full error output and your environment details (python --version, uv --version, OS).


Last updated: 2026-06-01