Altinity / Altinity/clickhouse-operator

HTTP requests fail if password contains reserved characters

Open
#1,822 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

possible bug research required
Dominant language
Go
Stars
2.6k
Forks
574
Avg merge
8d 6h
Merged PRs (30d)
6

Description

If the clickhouse_operator password contains a # character, HTTP requests using basic auth fail with a parse error.

It appears the metrics-exporter is not properly percent/URL-encoding.

E0916 22:38:06.764842 1 connection.go:90] connect():FAILED Ping(http://clickhouse_operator:***@HOSTNAME:8123/). Err: parse "http://clickhouse_operator:cs": invalid port ":cs" after host

In this case the password started with cs#.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at connection.go:90 in the metrics-exporter, where the failed Ping request is logged, and reproduce the request with a password containing # or another reserved character. Trace how the ClickHouse HTTP basic-auth URL is assembled; done means reserved password characters are encoded correctly and the request succeeds without a parse error.

Written by the indexing model from the issue text.

Assessment

Tech stack
clickhouse, go, kubernetes
Domain
backend, databases, observability
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.