[ERROR][ForkPoolWorker-781] Connection error to: http://ip:8123 (ReadTimeout)

we have redash configured in docker 1.12.6-1.0.1.el6
OS oracle 6
image: redash/redash:8.0.0.b32245
image: redis:5.0-alpine
image: postgres:9.6-alpine
clickhouse-server 21.6.6.51-2

We have a problem with executing requests to Clickhouse.
The show tables or select * from session limit 5 queries work, but select * from session limit 10 does not work, we see an error in the log:

[PID:793][ERROR][ForkPoolWorker-775] Connection error to: http://our_IP:8123 (ReadTimeout).
Traceback (most recent call last):
File “/app/redash/query_runner/clickhouse.py”, line 152, in run_query
q = self._clickhouse_query(query)
File “/app/redash/query_runner/clickhouse.py”, line 113, in _clickhouse_query
result = self._send_query(query)
File “/app/redash/query_runner/clickhouse.py”, line 92, in _send_query
raise Exception(“Connection error to: {} {}.”.format(url, details))
Exception: Connection error to: http://our_IP:8123 (ReadTimeout).
[2021-08-10 17:14:20,393][PID:793][INFO][ForkPoolWorker-775] task_name=redash.tasks.execute_query task_id=318a2269-1a0c-438d-a203-14bce8baaf7e task=execute_query query_hash=18b0e4746278e9cfab5bb1c00765c574 data_length=None error=[Connection error to: http://our_IP:8123 (
ReadTimeout).]
[2021-08-10 17:14:20,394][PID:793][ERROR][ForkPoolWorker-775] Task redash.tasks.execute_query[318a2269-1a0c-438d-a203-14bce8baaf7e] raised unexpected: QueryExecutionError(u’Connection error to: http://our_IP:8123 (ReadTimeout).’,)
Traceback (most recent call last):
File “/usr/local/lib/python2.7/site-packages/celery/app/trace.py”, line 385, in trace_task
R = retval = fun(*args, **kwargs)
File “/app/redash/worker.py”, line 84, in call
return TaskBase.call(self, *args, **kwargs)
File “/usr/local/lib/python2.7/site-packages/celery/app/trace.py”, line 648, in protected_call
return self.run(*args, **kwargs)
File “/app/redash/tasks/queries.py”, line 436, in execute_query
scheduled_query).run()
File “/app/redash/tasks/queries.py”, line 382, in run
raise result
QueryExecutionError: Connection error to: http://our_IP:8123 (ReadTimeout).

1 Like

Looks like your clickhouse server terminated the connection and left Redash waiting. What do your clickhouse logs show?

Hello,
There are no errors in the clickhouse log.

it looks very strange, some queries are executed for example:
SELECT count(*)
FROM search

but the request will not work:
SELECT *
FROM search
limit 10

and with less limits it is executed successfully
SELECT *
FROM search
limit 5

I think some kind of clipboard is very small, to which the result is added before being output to redash

Yes it seems like a buffer somewhere isn’t configured properly. Just to be sure: do these queries work if you run them from a separate tool?

yes, all requests via clickhouse-client work from the same server where redash is configured

Sounds like a bug in our query runner, then.

Happy to review a pull request implementing a fix. Not something we can take on first-class since we don’t use Clickhouse or have a demo environment to test against.