Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

question: How to connect target-clickhouse with SSL certificate? #155

Open
AndreiPetrukhin opened this issue Apr 23, 2024 · 1 comment
Open

Comments

@AndreiPetrukhin
Copy link

I am not sure about settings for clickhouse and have pretty the following settings:

loaders:

  • name: target-clickhouse
    variant: shaped-ai
    pip_url: git+https://github.com/shaped-ai/target-clickhouse.git
    config:
    database: holding_test
    default_target_schema: holding_test
    host: rc1a-hqgn203ff9jog6cr.mdb.yandexcloud.net
    load_method: upsert
    port: 8443
    table_name: test
    username: user1
    verify: true
    cert: "/home/andrew_petrukhin_vlad/.dbt/RootCA.pem"

trying to upload data into Clickhouse db and get the following error:
File "/home/andrew_petrukhin_vlad/meltano-projects/dbt-gbq-clickhouse/.meltano/loaders/target-clickhouse/venv/lib/python3.9/site-packages/requests/sessions.py", line 637, in post
return self.request("POST", url, data=data, json=json, **kwargs)
File "/home/andrew_petrukhin_vlad/meltano-projects/dbt-gbq-clickhouse/.meltano/loaders/target-clickhouse/venv/lib/python3.9/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "/home/andrew_petrukhin_vlad/meltano-projects/dbt-gbq-clickhouse/.meltano/loaders/target-clickhouse/venv/lib/python3.9/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "/home/andrew_petrukhin_vlad/meltano-projects/dbt-gbq-clickhouse/.meltano/loaders/target-clickhouse/venv/lib/python3.9/site-packages/requests/adapters.py", line 501, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

@dror-g
Copy link

dror-g commented Apr 25, 2024

I think you might be missing secure: true.
For me it works when it's included, but I'm not using a custom cert (maybe remove verify to ignore that?).

Also I'm using just this config line, not broken:
sqlalchemy_url: clickhouse+native://default:<yourpassword>@aeopdsaday.us-east-1.aws.clickhouse.cloud?secure=true

Notice I use clickhouse+native. you can set that with driver option.
https is not a valid driver, only http is, but won't connect over SSL.

(sqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:clickhouse.https )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants