Skip to content

fix(ci): inject DATABASE_SSL=false into dev env file before restarting services#986

Merged
zbigniewsobiecki merged 1 commit intodevfrom
fix/dev-router-ssl-env
Mar 23, 2026
Merged

fix(ci): inject DATABASE_SSL=false into dev env file before restarting services#986
zbigniewsobiecki merged 1 commit intodevfrom
fix/dev-router-ssl-env

Conversation

@zbigniewsobiecki
Copy link
Copy Markdown
Member

Problem

After PR #979 tightened DB SSL defaults to rejectUnauthorized: true, the dev router began crashing at every startup with:

Error: self-signed certificate in certificate chain
  at seedAgentDefinitions → upsertAgentDefinition → DB query

Root cause: The deploy workflow correctly added -e DATABASE_SSL=false to the one-off migration containers (commit d6bbf6ca), but the long-running cascade-router-dev and cascade-dashboard-dev containers read their environment from /opt/services/cascade-dev.env via env_file in docker compose — and that file never had DATABASE_SSL=false added.

Fix

Add a single idempotent step before the router/dashboard restart that writes DATABASE_SSL=false into the shared env file:

sed -i '/^DATABASE_SSL=/d' /opt/services/cascade-dev.env  # remove any existing line
echo 'DATABASE_SSL=false' >> /opt/services/cascade-dev.env # append correct value

Because both containers share the same env_file, this one write fixes both services on every deploy going forward.

Test plan

  • Merge to dev → workflow runs → "Configure DATABASE_SSL" step passes
  • Router container starts cleanly — no Sentry self-signed certificate error
  • seedAgentDefinitions completes successfully in router logs
  • Dashboard container also healthy

🤖 Generated with Claude Code

…g services

PR #979 tightened DB SSL defaults to rejectUnauthorized: true, but the
dev database uses a self-signed certificate. The deploy workflow already
passed DATABASE_SSL=false to one-off migration containers via -e flags,
but the long-running router and dashboard containers read their env from
/opt/services/cascade-dev.env — which never had this variable set.

Result: every router startup since that PR crashed at seedAgentDefinitions
with "self-signed certificate in certificate chain" before the process
could serve any traffic.

Add an idempotent step (sed removes any existing line, echo appends the
correct value) that runs once per deploy, before docker compose restarts
both services. Since both containers share the same env_file, a single
write fixes both the router and the dashboard.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@zbigniewsobiecki zbigniewsobiecki merged commit 5b05e3f into dev Mar 23, 2026
8 checks passed
@zbigniewsobiecki zbigniewsobiecki deleted the fix/dev-router-ssl-env branch March 23, 2026 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant