Skip to content

Config Validation: 5 critical config issues found (2026-05-08) #722

Closed

Description

@vybe

Automated Config Validation Report

Date: 2026-05-08
Result: 5 critical config issues require attention


P0 — Production Deployment Failures

1. INTERNAL_API_SECRET missing from prod MCP server (docker-compose.prod.yml)

The local docker-compose.yml passes INTERNAL_API_SECRET to the MCP service. docker-compose.prod.yml does not. The MCP server uses this in src/mcp-server/src/audit.ts:18 for SEC-001 Phase 3 audit logging (all MCP tool calls). Without it, every POST /api/internal/audit call from the MCP server returns 401 — all MCP tool-call audit events silently fail in production.

Fix: Add - INTERNAL_API_SECRET=${INTERNAL_API_SECRET} to the mcp-server environment block in docker-compose.prod.yml.


2. EXTRA_CORS_ORIGINS missing from prod backend (docker-compose.prod.yml)

EXTRA_CORS_ORIGINS is documented in .env.example, read in config.py:90, and set in the local compose backend. It is absent from the prod compose backend environment block. Production deployments cannot configure CORS for external domains through compose — their external domains will be CORS-blocked unless the env var is manually injected outside compose.

Fix: Add - EXTRA_CORS_ORIGINS=${EXTRA_CORS_ORIGINS:-} to the backend environment block in docker-compose.prod.yml.


P1 — User/Deployment Confusion

3. GOOGLE_API_KEY used in code and both compose files but absent from .env.example

Both docker-compose.yml and docker-compose.prod.yml reference ${GOOGLE_API_KEY:-}. Backend config.py:104 uses it as a fallback when GEMINI_API_KEY is unset. settings_service.py:84 and agent_service/crud.py:398 read it directly for Gemini-powered agents. New deployers who set GOOGLE_API_KEY (common Google AI path) get no guidance.

Fix: Add GOOGLE_API_KEY= entry to .env.example under the Image Generation section, with a note that it is interchangeable with GEMINI_API_KEY for agent containers.


4. FRONTEND_URL appears twice in .env.example (lines 130 and 154)

Lines 130 and 154 both define FRONTEND_URL= with different descriptions. The duplicate is confusing and may cause copy-paste errors.

Fix: Remove the second occurrence (line 154). Keep the one at line 130 under SERVICE URLS and improve its comment.


5. TRINITY_DATA_PATH used in prod compose but absent from .env.example

docker-compose.prod.yml lines 64 and 157 use ${TRINITY_DATA_PATH:-./trinity-data} for the bind-mount data path (where trinity.db and agent files live on the host). This is not documented in .env.example. Production operators don't know they need to set this for custom data paths.

Fix: Add TRINITY_DATA_PATH=./trinity-data to .env.example under SERVICE URLS or a new DATA PATHS section.


Recommended Actions (Priority Order)

  1. docker-compose.prod.yml: Add INTERNAL_API_SECRET to MCP server env block
  2. docker-compose.prod.yml: Add EXTRA_CORS_ORIGINS to backend env block
  3. .env.example: Add GOOGLE_API_KEY= under Image Generation / Gemini section
  4. .env.example: Remove duplicate FRONTEND_URL (line 154)
  5. .env.example: Add TRINITY_DATA_PATH=./trinity-data with documentation

Additional Findings (Informational — no issue required)

20+ undocumented but optional tuning vars exist in backend code with sensible defaults:
VOICE_ENABLED, VOICE_MODEL, VOICE_MAX_DURATION, EMAIL_AUTH_ENABLED, SLACK_APP_TOKEN, SLACK_TRANSPORT_MODE, AUDIT_LOG_RETENTION_DAYS, AUDIT_RETENTION_ENABLED, OTEL_SAMPLE_RATE, TRUSTED_PROXIES, TRINITY_MCP_URL, SCHEDULER_URL, etc. These work out of the box but cannot be discovered by operators reading .env.example.


Generated by scheduled /validate-config run

Activity

  1. added
    priority-p1
    type-bug
    automated
    on May 8, 2026
  2. added
    theme-reliability
    on Jun 3, 2026
  3. added
    complexity-medium
    on Jun 3, 2026
  4. AndriiPasternak31 commented on Jun 14, 2026

    @AndriiPasternak31
    Contributor

    /claim

  5. added
    status-in-progress
    on Jun 14, 2026
  6. github-actions commented on Jun 14, 2026

    @github-actions

    Claimed by @AndriiPasternak31. Label status-in-progress added.

    Next steps:

    1. Create branch: feature/722-<short-slug>
    2. Implement the feature
    3. Open a PR with Fixes #722
  7. AndriiPasternak31 commented on Jun 14, 2026

    @AndriiPasternak31
    Contributor

    Verified each of the 5 items against current dev (fcfb93a2). 3 of 5 are already fixed; 2 remain valid. Scoping this issue down to the survivors.

    Still valid (real prod-deployment bugs)

    1. INTERNAL_API_SECRET missing from the prod mcp-server block — confirmed absent (docker-compose.prod.yml mcp-server env, ~L337–345). src/mcp-server/src/audit.ts:18 still reads it, so POST /api/internal/audit 401s and all MCP tool-call audit silently fails in prod. (Note: INTERNAL_API_SECRET is now wired into the backend (L97) and scheduler (L284) blocks — only mcp-server is missing it.)
    2. EXTRA_CORS_ORIGINS missing from the prod backend block — absent from prod compose; present in local compose (L87); read at src/backend/config.py:91. External domains stay CORS-blocked unless injected outside compose.

    Already fixed (no action)

    1. ✅ GOOGLE_API_KEY documented — .env.example:130
    2. ✅ duplicate FRONTEND_URL removed — single occurrence at .env.example:232
    3. ✅ TRINITY_DATA_PATH documented — .env.example:301–302

    Remaining fix is two compose lines:

    • add - INTERNAL_API_SECRET=${INTERNAL_API_SECRET} to the mcp-server env block
    • add - EXTRA_CORS_ORIGINS=${EXTRA_CORS_ORIGINS:-} to the backend env block
  8. added
    status-in-dev
    and removed
    status-in-progress
    on Jun 18, 2026
  9. removed
    status-in-dev
    on Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

automatedcomplexity-mediumpriority-p1theme-reliabilitytype-bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions