ClickHouse / clickhouse-tableau-connector-jdbc

Tableau connector to ClickHouse using JDBC driver
Apache License 2.0
57 stars 9 forks source link

Connection issue with JDBC driver #78

Open Sushil2468 opened 4 weeks ago

Sushil2468 commented 4 weeks ago

Hi Team

I am getting connection error when trying with JDBC driver. With ODBC I am able to connect but it is very slow on our tableau server so wanted to try this. Here is the error msg:

An error occurred while communicating with the ClickHouse JDBC by ClickHouse, Inc. data source 'Untitled Data Source'
Bad Connection: Tableau could not connect to the data source.
Error Code: FAB9A2C5
connect timed out, server ClickHouseNode [uri=http://clickhouse-bayerd.ds-engine-dev.sc-navigator.azure.cnb:8123/default, options={custom_http_params=join_use_nulls=1,session_id=tableau-jdbc-connector-1717421874896-98240641,typeMappings=UInt64=java.lang.String,UInt128=java.lang.String,Int128=java.lang.String,UInt256=java.lang.Double,Int256=java.lang.Double,socket_timeout=300000}]@-1240071617
Unable to connect to the ClickHouse JDBC by ClickHouse, Inc. server "clickhouse-bayerd.ds-engine-dev.sc-navigator.azure.cnb". Check that the server is running and that you have access privileges to the requested database.

Connector Class: clickhouse_jdbc, Version: 0.2.6 Taco file used is: clickhouse_jdbc_0.3.1.taco

Can someone please help. Thanks in advance.

Best Regards Sushil

Sushil2468 commented 4 weeks ago

This is the error:

An error occurred while communicating with the ClickHouse JDBC by ClickHouse, Inc. data source 'Untitled Data Source' Bad Connection: Tableau could not connect to the data source. Error Code: FAB9A2C5

400 The plain HTTP request was sent to HTTPS port

400 Bad Request

The plain HTTP request was sent to HTTPS port

nginx

, server ClickHouseNode [uri=http://clickhouse-bayerd.ds-engine-dev.sc-navigator.azure.cnb:443/default, options={custom_http_params=join_use_nulls=1,session_id=tableau-jdbc-connector-1717422230521-61290111,typeMappings=UInt64=java.lang.String,UInt128=java.lang.String,Int128=java.lang.String,UInt256=java.lang.Double,Int256=java.lang.Double,socket_timeout=300000}]@1000635078 Unable to connect to the ClickHouse JDBC by ClickHouse, Inc. server "clickhouse-bayerd.ds-engine-dev.sc-navigator.azure.cnb". Check that the server is running and that you have access privileges to the requested database. Connector Class: clickhouse_jdbc, Version: 0.2.6

yurifal commented 4 weeks ago

Could you please check / select the SSL flag on the connection dialog?

Sushil2468 commented 4 weeks ago

yes SSL is checked

yurifal commented 4 weeks ago

check if the DNS name ( clickhouse-bayerd.ds-engine-dev.sc-navigator.azure.cnb ) could be resolved.

nslookup clickhouse-bayerd.ds-engine-dev.sc-navigator.azure.cnb

Sushil2468 commented 3 weeks ago

Hi Yuri

I am able to connect through tableau desktop now by adding the sslrootcert=/Users/username/Downloads/ds-engine-dev.sc-navigator.azure.cnb.crt But in live connection after publishing to server it gives error due to this local directory. Is there somewhere I can add it in tableau server? Could not open file from: classpath:/Users/username/Downloads/ds-engine-dev.sc-navigator.azure.cnb.crt, server ClickHouseNode [uri=https://clickhouse-bayerd.ds-engine-dev.sc-navigator.azure.cnb:443/default, options={sslrootcert=/Users/username/Downloads/ds-engine-dev.sc-navigator.azure.cnb.crt,custom_http_params=join_use_nulls=1,session_id=tableau-jdbc-connector-1717434467628-30242491,typeMappings=UInt64=java.lang.String,UInt128=java.lang.String,Int128=java.lang.String,UInt256=java.lang.String,Int256=java.lang.String,sslmode=STRICT,socket_timeout=300000}]@1409109279 Unable to connect to the ClickHouse JDBC by ClickHouse, Inc. server "clickhouse-bayerd.ds-engine-dev.sc-navigator.azure.cnb". Check that the server is running and that you have access privileges to the requested database.

yurifal commented 3 weeks ago

The 'better place' for the cert file (common in either *nix flavour) is /etc/ssl/certs imho.

Or you may want to try the 'ssl=NONE' workaround (no cert file needed): https://github.com/ClickHouse/clickhouse-tableau-connector-jdbc/issues/73

Sushil2468 commented 3 weeks ago

for windows server?

Sushil2468 commented 3 weeks ago

where can I find this /etc/ssl/certs path in windows server?

yurifal commented 3 weeks ago

Create the dir C:\etc\ssl\certs

Sushil2468 commented 3 weeks ago

Hi Yuri

Tried creating the folder on both server node machines but still same error

Sushil2468 commented 3 weeks ago

tried SSL=None but not able to connect after it

yurifal commented 3 weeks ago

tried SSL=None but not able to connect after it

Did you try this (on the Desktop at least):

Solution: disable SSL in General tab, but in advanced tab add: ssl=true,sslmode=NONE

It may not work (depends on the CH server config settings).

yurifal commented 3 weeks ago

Hi Yuri

Tried creating the folder on both server node machines but still same error

Could you please check if placing the cert file into the C:\etc\ssl\certs (with the proper permissions of course) would work for the Tableau Desktop at least? If yes, do the same on the TS machine. Please check the permissions on the dir & file -- every (windows) user has to be able to reach the cert file for reading.

Sushil2468 commented 3 weeks ago

Thankyou so much Yuri, ssl=true,sslmode=NONE this works..

yurifal commented 3 weeks ago

Thankyou so much Yuri, ssl=true,sslmode=NONE this works..

Nice.