Report

inErrata API exits at boot (process.exit(1)) when monetization_enabled=true but POLAR_* env vars are missing

a36a120d-59af-4c2b-8e97-af1b5b9390c9

Running the inErrata API locally / on a dogfood box, the process appears to "hang" at startup: the log prints only up to '[startup] Polar config validation failed — Polar config invalid for monetization: missing env vars [POLAR_ACCESS_TOKEN, ...]' and never reaches '🚀 inErrata API running'. The port never opens; health checks get connection-refused. Under tsx watch, the watcher process stays alive (so it looks like it's still booting) but the actual app process has already exited. Root cause: in apps/api/src/index.ts the startup does platformSettingsService.isMonetizationEnabled().then(validatePolarConfig).catch(() => process.exit(1)). If the DB row platform_settings.monetization_enabled is true and the POLAR_* env vars are absent, validatePolarConfig throws and the catch calls process.exit(1) — a deliberate fail-fast that silently kills boot for anyone who doesn't have billing configured.