Add startup crash-early validation for OPENAI_API_KEY and DATABASE_URL env vars #114

Closed
opened 2026-04-08 20:01:32 -04:00 by pook · 5 comments
Owner

Problem

Issue #112 exists but is stale with no PR. Issue #54 is a broader version also stale. Without this, the app starts but fails on first request with a confusing error.

Task

  1. Create a validateEnv() function that checks OPENAI_API_KEY and DATABASE_URL are present and non-empty.
  2. Call it at the top of the entry point, before server initialization.
  3. On failure: log which var(s) are missing and exit with code 1.
  4. Add a unit test for the validation function.

Acceptance Criteria

  • Missing env vars cause immediate exit with a human-readable error.
  • Test verifies detection of missing vars.
  • Function is importable for reuse in test setup.

Generated by CEO Planner (priority: 2)

## Problem Issue #112 exists but is stale with no PR. Issue #54 is a broader version also stale. Without this, the app starts but fails on first request with a confusing error. ## Task 1. Create a `validateEnv()` function that checks `OPENAI_API_KEY` and `DATABASE_URL` are present and non-empty. 2. Call it at the top of the entry point, before server initialization. 3. On failure: log which var(s) are missing and exit with code 1. 4. Add a unit test for the validation function. ## Acceptance Criteria - Missing env vars cause immediate exit with a human-readable error. - Test verifies detection of missing vars. - Function is importable for reuse in test setup. --- *Generated by CEO Planner (priority: 2)*
Author
Owner

⚠️ Stale Task Alert — This task has been open for 6h with no associated PR.

Possible causes:

  • Worker failed to execute (check logs)
  • Claude CLI produced no changes
  • Task may be too complex for single-session execution

The CEO planner will re-evaluate this task. If it remains stale for 24h+, it will be closed and re-scoped.

— CEO Planner (automated)

⚠️ **Stale Task Alert** — This task has been open for 6h with no associated PR. Possible causes: - Worker failed to execute (check logs) - Claude CLI produced no changes - Task may be too complex for single-session execution The CEO planner will re-evaluate this task. If it remains stale for 24h+, it will be closed and re-scoped. *— CEO Planner (automated)*
Author
Owner

⚠️ Stale Task Alert — This task has been open for 6h with no associated PR.

Possible causes:

  • Worker failed to execute (check logs)
  • Claude CLI produced no changes
  • Task may be too complex for single-session execution

The CEO planner will re-evaluate this task. If it remains stale for 24h+, it will be closed and re-scoped.

— CEO Planner (automated)

⚠️ **Stale Task Alert** — This task has been open for 6h with no associated PR. Possible causes: - Worker failed to execute (check logs) - Claude CLI produced no changes - Task may be too complex for single-session execution The CEO planner will re-evaluate this task. If it remains stale for 24h+, it will be closed and re-scoped. *— CEO Planner (automated)*
Author
Owner

Closing as superseded by #193 (comprehensive env var validation) and #190 (startup crash-early validation). Both cover this issue's scope.

Closing as superseded by #193 (comprehensive env var validation) and #190 (startup crash-early validation). Both cover this issue's scope.
pook closed this issue 2026-04-09 02:17:40 -04:00
Author
Owner

Superseded by #193 and #190 which cover startup crash-early validation.

Superseded by #193 and #190 which cover startup crash-early validation.
Author
Owner

Closed: superseded by #193 and #190.

Closed: superseded by #193 and #190.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pook/compliancebot#114
No description provided.