Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .server-changes/fix-clickhouse-query-client-secure-param.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
area: webapp
type: fix
---

Strip `secure` query parameter from QUERY_CLICKHOUSE_URL before passing to ClickHouse client. This was already done for the main and logs ClickHouse clients but was missing for the query client, causing a startup crash with `Error: Unknown URL parameters: secure`.
3 changes: 3 additions & 0 deletions apps/webapp/app/services/clickhouseInstance.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ function initializeQueryClickhouseClient() {

const url = new URL(env.QUERY_CLICKHOUSE_URL);

// Remove secure param
url.searchParams.delete("secure");
Comment on lines +86 to +87
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 Pre-existing: runs replication ClickHouse clients also missing secure param stripping

While this PR correctly fixes the missing secure param deletion for the query ClickHouse client, two other call sites have the same pre-existing issue:

  1. apps/webapp/app/services/runsReplicationInstance.server.ts:25-26 passes env.RUN_REPLICATION_CLICKHOUSE_URL directly to new ClickHouse() without stripping secure.
  2. apps/webapp/app/routes/admin.api.v1.runs-replication.create.ts:80-81 does the same.

These use a different env var (RUN_REPLICATION_CLICKHOUSE_URL) which may or may not contain the secure query parameter depending on the deployment. If it does, these clients would also hit the same startup crash described in this PR's changelog. Worth a follow-up fix for consistency.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.


return new ClickHouse({
url: url.toString(),
name: "query-clickhouse",
Expand Down