getredash/redash · error · Exception
Connection error to: {} {}.
Error message
Connection error to: {} {}. What it means
ClickHouse runner's _send_query wraps requests.RequestException from the HTTP call and re-raises with the target URL, the exception class, and (when present) the HTTP status code. The HTTP layer failed before a valid ClickHouse response was parsed.
Source
Thrown at redash/query_runner/clickhouse.py:146
if not r.ok:
raise Exception(r.text)
# In certain situations the response body can be empty even if the query was successful, for example
# when creating temporary tables.
if not r.text:
return {}
response = r.json()
if "exception" in response:
raise Exception(response["exception"])
return response
except requests.RequestException as e:
if e.response:
details = "({}, Status Code: {})".format(e.__class__.__name__, e.response.status_code)
else:
details = "({})".format(e.__class__.__name__)
raise Exception("Connection error to: {} {}.".format(url, details))
@staticmethod
def _define_column_type(column):
c = column.lower()
f = re.search(r"^nullable\((.*)\)$", c)
if f is not None:
c = f.group(1)
if c.startswith("int") or c.startswith("uint"):
return TYPE_INTEGER
elif c.startswith("float"):
return TYPE_FLOAT
elif c == "datetime":
return TYPE_DATETIME
elif c == "date":
return TYPE_DATE
else:
return TYPE_STRING
View on GitHub (pinned to ca79fe988d)
Solutions
- Verify the URL and port: ClickHouse's HTTP interface defaults to 8123
- curl the exact URL from the error message to reproduce outside Redash
- Fix scheme, proxy config, or start/allow-list the ClickHouse server
- Use the status code in the message: 404 → wrong URL path, 5xx → server/proxy side
Example fix
# before
{"url": "https://ch.internal:9000"}
# after
{"url": "http://ch.internal:8123"} Defensive patterns
Strategy: try-catch
Validate before calling
import requests
r = requests.get(f"{url}/?query=SELECT%201", auth=(user, pwd), timeout=5)
r.raise_for_status() # fail fast before adding the data source Try / catch
try:
rows = clickhouse_runner.run_query(q, u)
except Exception as e:
if str(e).startswith('Connection error to:'):
alert_network_team(parse_url_from(e)); rows = None Prevention
- Health-check the ClickHouse HTTP port (8123) from the Redash host before configuring
- Use http unless TLS is confirmed
- Alert on recurring connection errors to catch infrastructure drift
When it happens
Trigger: Any query where the request to http(s)://host:port/?query=... fails: DNS failure, connection refused, TLS errors, or a non-2xx status (404 wrong path, 502 from a proxy).
Common situations: Wrong host/port (using native port 9000 instead of HTTP port 8123), ClickHouse behind a misconfigured reverse proxy, server not listening, or http/https scheme mismatch.
Related errors
- Couchbase connection error
- Failed to connect to Cloudflare D1: {str(e)}
- Connection error to: {url} {details}.
- Invalid JWT token
- Error during query execution. Reason: {error}
AI-assisted analysis of getredash/redash@ca79fe988d (2026-08-28).
Data as JSON: /api/errors/15b582fa77860184.
Report an issue: GitHub.