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

Connect to Clickhouse Error #23065

Closed
Jcccxxx opened this issue Feb 13, 2023 · 15 comments
Closed

Connect to Clickhouse Error #23065

Jcccxxx opened this issue Feb 13, 2023 · 15 comments
Assignees
Labels
#bug Bug report data:connect:clickhouse Related to Clickhouse

Comments

@Jcccxxx
Copy link

Jcccxxx commented Feb 13, 2023

A clear and concise description of what the bug is.

How to reproduce the bug

  1. Go to 'Database Connections'
  2. Click on 'Add Database'
  3. Click on 'TEST CONNECTION'
  4. See error

Expected results

connection is successful

Actual results

error

Screenshots

screenshot-20230213-115933

Does anyone know how to solve it?

Thanks!

@Jcccxxx Jcccxxx added the #bug Bug report label Feb 13, 2023
@villebro
Copy link
Member

@Jcccxxx thanks for reporting. On which version of Superset is this happening? I'm currently working on improving compatibility of the ClickHouse spec, so if this is happening on master branch this should be fixed shortly.

@Jcccxxx
Copy link
Author

Jcccxxx commented Feb 14, 2023

@Jcccxxx thanks for reporting. On which version of Superset is this happening? I'm currently working on improving compatibility of the ClickHouse spec, so if this is happening on master branch this should be fixed shortly.

it display Version: 0.0.0.dev0.
i just used superset for a week, so maybe it's the latest version?
thanks

@villebro villebro self-assigned this Feb 14, 2023
@villebro
Copy link
Member

How did you install it? Did you clone the repo?

@Jcccxxx
Copy link
Author

Jcccxxx commented Feb 14, 2023

How did you install it? Did you clone the repo?

I clone from git, and use 'docker-compose -f docker-compose-non-dev.yml up' to start

@villebro
Copy link
Member

Did you also add the ClickHouse connect driver?

@Jcccxxx
Copy link
Author

Jcccxxx commented Feb 15, 2023

Did you also add the ClickHouse connect driver?

yes, the version of clickhouse connect is 0.5.7

@genzgd
Copy link
Contributor

genzgd commented Feb 16, 2023

What port did you use in your SQLAlchemy URI? ClickHouse Connect uses the ClickHouse HTTP interface, so if you are using the SQLAlchemy URL the port should normally be 8123 (for plain HTTP) or 8443 (for HTTPS). I can reproduce your exact error if I use the wrong (native interface) port of 9440:

clickhousedb://play:[email protected]:9440

causes the "connection reset by peer error"

clickhousedb://play:[email protected]:443

works correctly (play.clickhouse.com uses the standard HTTP port of 443 instead of 8443).

Please try the HTTP (8123) or HTTPS (8443) port on your server.

@javiermas
Copy link

Same issue:
ERROR: (builtins.NoneType) None
[SQL: Error HTTPSConnectionPool(host='chi-chi-data-warehouse-0-0.clickhouse-operator.svc', port=8123): Max retries exceeded with url: /?wait_end_of_query=1 (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1131)'))) executing HTTP request https://chi-chi-data-warehouse-0-0.clickhouse-operator.svc:8123]
(Background on this error at: https://sqlalche.me/e/14/dbapi)

I tried with port 9000, 8123, 8443 and no luck. I can connect to the CH db normally on the port 9000, but no luck with superset @genzgd.

@javiermas
Copy link

I ended up using clickhouse-driver and clickhouse-sqlalchemy instead of clickhouse-connector, like it was suggested in another issue (I believe by genzgd) and it seems to work fine (k8s-helm installation).

@genzgd
Copy link
Contributor

genzgd commented May 22, 2023

@javiermas That SSL error is associated with older versions of Python. What Python version are you running?

@xRomZak
Copy link

xRomZak commented Jun 6, 2023

Just discovered that in clickhouse-connect 0.6 removed Superset engine was removed
https://github.com/ClickHouse/clickhouse-connect/releases/tag/v0.6.0

@genzgd
Copy link
Contributor

genzgd commented Jun 6, 2023

@xRomZak The superset engine spec was removed from clickhouse-connect to make it consistent with all other Superset connectors. clickhouse-connect now uses the ClickHouse engine spec in the main superset project that @villebro ported there a couple of months ago. It still works very well with Superset.

@xRomZak
Copy link

xRomZak commented Jun 6, 2023

I recently reported clickhouse connectivity issue due to invalid/outdated connector here.
amancevice/docker-superset#255

As fas as I understand to fix it I have to build a container myself incl. a proper driver?

@genzgd
Copy link
Contributor

genzgd commented Jun 6, 2023

You should be able to include it in the superset/docker/requirements-local.txt if you following the instructions for running Superset in docker compose locally (https://superset.apache.org/docs/installation/installing-superset-using-docker-compose/).

Use the the following in requirements-local.txt or as a pip install on your own container.

For using clickhouse-connect:

clickhouse-connect>=0.6.1

For using clickhouse-driver, I think you need:

clickhouse-driver>=0.2.6
clickhouse-sqlalchemy>=0.2.4

@rusackas rusackas added the data:connect:clickhouse Related to Clickhouse label Feb 29, 2024
@rusackas
Copy link
Member

This is likely fixed by now, and is pretty out of date if not. If people are still encountering this in current versions (3.x) please open a new Issue or a PR to address the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
#bug Bug report data:connect:clickhouse Related to Clickhouse
Projects
None yet
Development

No branches or pull requests

6 participants