Hey y'all, We have a clickhouse instance that is e...
# replication-troubleshooting
m
Hey y'all, We have a clickhouse instance that is exposed over https and I cannot for the life of me get the clickhouse destination to connect to it. We have various other tools connecting to it and inputting data but even with admin credentials I just get the following error:
Could not connect with provided configuration. Error: Failed to insert expected rows into check table. Actual written: 0
Our server is behind a load balancer (traefik) so its exposed on port
443
but i specified that to no avail 🤔
k
Based on the information in the knowledge sources, there are a few key points and troubleshooting steps for connecting Airbyte's ClickHouse destination to an HTTPS-exposed ClickHouse instance behind a load balancer: 1. Protocol and Host Configuration For the ClickHouse destination v2.x, you must specify the protocol (e.g.,
https
) in a separate
protocol
field, and the
host
field should not include the protocol prefix (i.e., do not use
https://yourhost
, just use
yourhost
). Including the protocol in the host field can cause connection failures. For example:
Copy code
json    {      "host": "your.clickhouse.host",      "port": "443",      "protocol": "https",      ...    }
If you include
https://
in the host, Airbyte will not parse the configuration correctly and the connection will fail. This has been confirmed as a common issue and removing the protocol from the host field resolved connection problems for other users [destination-clickhouse issue #63293](https://github.com/airbytehq/airbyte/issues/63293). 2. Port Field Type The
port
field should be a string (e.g.,
"443"
), not an integer, in the configuration for the ClickHouse destination v2.x. Supplying the wrong type can cause validation errors, but in your case, the error is about failing to insert rows, so this is likely not the root cause, but it's still important to check [ClickHouse destination docs](https://docs.airbyte.com/integrations/destinations/clickhouse). 3. Permissions Ensure the ClickHouse user has all the required permissions, including
CREATE
,
ALTER
,
TRUNCATE
,
INSERT
,
SELECT
,
CREATE DATABASE
,
CREATE TABLE
, and
DROP TABLE
on the relevant database(s). Insufficient permissions can cause the connector to fail when attempting to create or write to the check table [ClickHouse destination docs](https://docs.airbyte.com/integrations/destinations/clickhouse). 4. Load Balancer/Traefik If your ClickHouse instance is behind Traefik and exposed on port 443, make sure Traefik is correctly forwarding HTTPS traffic to the ClickHouse backend and that there are no protocol mismatches (e.g., HTTPS on the frontend, HTTP on the backend without proper TLS termination). 5. Connector Version Use the latest ClickHouse destination connector (v2.x), as older versions are deprecated and may not support all features or have known issues with HTTPS and protocol handling [ClickHouse destination docs](https://docs.airbyte.com/integrations/destinations/clickhouse). 6. Error Message: "Failed to insert expected rows into check table. Actual written: 0" This error typically means the connector was able to connect to the database, but could not write to the check table. This could be due to: - Permissions issues (see above) - Schema/database misconfiguration - Network/proxy issues interfering with write operations Summary of steps to try: - Double-check that your
host
field does not include `https://`—it should be just the hostname. - Set
protocol
to
https
and
port
to
"443"
(as a string). - Ensure the user has all required permissions. - Confirm Traefik is correctly forwarding HTTPS to ClickHouse. - Use the latest ClickHouse destination connector. If you have already done all of the above and still encounter the error, please provide the full connector configuration (with sensitive info redacted) and any relevant logs for further troubleshooting. References: - [destination-clickhouse issue #63293](https://github.com/airbytehq/airbyte/issues/63293) - [ClickHouse destination documentation](https://docs.airbyte.com/integrations/destinations/clickhouse)
m
I am trying to configure this via the airbyte cloud UI and there doesnt appear to be a place to specify the protocol, but the docs say that https is the default. As for the permissions, the admin user should have the highest permissions possible.
m