Snuba and clickhouse

We are trying to use the 19.14 external clickhouse cluster for Snuba-api 20.7.2. When trying to connect, the following errors occur:

2020-07-30 14:32:55,591 Attempting to connect to Clickhouse cluster myclickhousehost:9440 (attempt 2)
2020-07-30 14:32:55,591 Connecting. Database: db. User: sentry_user
2020-07-30 14:32:55,705 Connecting. Database: db. User: sentry_user
2020-07-30 14:32:55,720 Connection to Clickhouse myclickhousehost:9440:port> failed (attempt 2)
Traceback (most recent call last):
File “/usr/src/snuba/snuba/cli/”, line 110, in bootstrap
clickhouse.execute(“SELECT 1”)
File “/usr/src/snuba/snuba/clickhouse/”, line 78, in execute
raise e
File “/usr/src/snuba/snuba/clickhouse/”, line 69, in execute
result = conn.execute(*args, **kwargs)
File “/usr/local/lib/python3.7/site-packages/clickhouse_driver/”, line 196, in execute
File “/usr/local/lib/python3.7/site-packages/clickhouse_driver/”, line 171, in force_connect
File “/usr/local/lib/python3.7/site-packages/clickhouse_driver/”, line 237, in connect
File “/usr/local/lib/python3.7/site-packages/clickhouse_driver/”, line 312, in receive_hello
packet_type = read_varint(self.fin)
File “/usr/local/lib/python3.7/site-packages/clickhouse_driver/”, line 30, in read_varint
i = f.read_one()
File “clickhouse_driver/bufferedreader.pyx”, line 66, in clickhouse_driver.bufferedreader.BufferedReader.read_one
File “clickhouse_driver/bufferedreader.pyx”, line 196, in clickhouse_driver.bufferedreader.BufferedSocketReader.read_into_buffer
EOFError: Unexpected EOF while reading bytes

What could be the reason for this error? Is the snuba compatible with clickhouse version 19.14?



This seems like a network connectivity error to me.

There are no problems with the network.
How can we use a secure connection to the clickhouse?

Well, I cannot really debug your system from a forum thread :slight_smile: I’m just explaining what the error message suggests: Clickhouse is not accepting connections or abruptly terminates them.

Quick Googling brought this post to me:

It explains how to set up Clickhouse to accept secure connections that said I don’t think Snuba supports secure connections to Clickhouse yet:

@tkaemming may know more about this or whether there are any plans for implementing support for secure connections.