Fix ClickHouse migration DSN handling for HTTP URLs in the webapp entrypoint#3723
Fix ClickHouse migration DSN handling for HTTP URLs in the webapp entrypoint#3723darshitp091 wants to merge 1 commit into
Conversation
Addresses issue triggerdotdev#3674 by avoiding unconditional secure=true on HTTP ClickHouse URLs in the webapp entrypoint.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe entrypoint script now generates Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Hi @darshitp091, thanks for your interest in contributing! This project requires that pull request authors are vouched, and you are not in the list of vouched users. This PR will be closed automatically. See https://github.com/triggerdotdev/trigger.dev/blob/main/CONTRIBUTING.md for more details. |
There was a problem hiding this comment.
Pull request overview
This PR fixes a startup failure in self-hosted deployments where ClickHouse migrations (via Goose) would reject valid http:// ClickHouse URLs due to secure=true being appended unconditionally in the webapp container entrypoint.
Changes:
- Reworks ClickHouse migration DSN construction to be scheme-aware (
https://→secure=true,http://→ nosecureflag). - Strips any existing
securequery parameter before constructingGOOSE_DBSTRINGto avoid mismatches.
This PR fixes the startup failure reported in issue #3674 for self-hosted Docker setups using ClickHouse over HTTP.
The bug was in entrypoint.sh, where the ClickHouse migration DSN was being built with secure=true appended unconditionally unless the URL already contained a secure parameter. That caused Goose to reject valid http:// ClickHouse URLs with an error like: clickhouse [dsn parse]: http with TLS specify
As a result, the webapp container failed during startup and entered a restart loop.
This change makes the DSN construction scheme-aware:
It strips any existing secure query parameter.
It only adds secure=true when the ClickHouse URL uses https://.
For http:// URLs, it leaves the URL unmodified so Goose can parse it correctly.
In short, the fix removes the mismatch between the URL scheme and the forced TLS flag, which was the root cause of the startup failure.