ClickHouse / clickhouse-tableau-connector-jdbc

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

Invalid Query #54

Closed vfilatov closed 1 year ago

vfilatov commented 1 year ago

In according to the ticket opened with Clickhouse https://github.com/ClickHouse/ClickHouse/issues/48761

An error occurred while communicating with ClickHouse JDBC by ANALYTIKA PLUS Bad Connection: Tableau could not connect to the data source. Error Code: FAB9A2C5 connect timed out, server ClickHouseNode(addr=, db=default)@-44420824 Unable to connect to the ClickHouse JDBC by ANALYTIKA PLUS server "". Check that the server is running and that you have access privileges to the requested database. Connector Class: clickhouse_jdbc, Version: 0.2.5 I am able to connect from tableau desktop 2021.3.8 but when I copy the jdbc jar file clickhouse-jdbc-0.3.2-patch8-shaded.jar to C:\Program Files\Tableau\Drivers taco file clickhouse_jdbc_0.2.6.taco copyied to C:\Program Files\Tableau\Connectors

On the Clickhouse side I can observe the following error: 2023.04.13 11:41:45.777922 [ 3416145 ] {3d80520c-3125-4d88-923d-e8939a1b89a7} <Error> ReadWriteBufferFromHTTP: HTTP request to http://127.0.0.1:9019/ping?use_connection_pooling=1 failed at try 1/1 with bytes read: 0 /unknown. Error: Connection refused. (Current backoff wait is 100/1600 ms) 2023.04.13 11:41:46.035603 [ 3416145 ] {3d80520c-3125-4d88-923d-e8939a1b89a7} <Error> executeQuery: Code: 410. DB::Exception: clickhouse-jdbc-bridge is not running. Please, start it manually. (EXTERNAL_SERVER_IS_NOT_RESPONDING) (version 23.3.1.2823 (official build)) (from 10.30.129.67:4832) (in query: select concat('jdbc(''', name, ''')') as TABLE_SCHEM, null as TABLE_CATALOG from jdbc('', 'SHOW DATASOURCES') where TABLE_SCHEM like '%' order by name)

Where the query that causes error is coming from? From ClickHouse JDBC by ANALYTIKA PLUS or from the user? Is there a way to turn it off?

vfilatov commented 1 year ago

I found the user had already ticket here... https://github.com/analytikaplus/clickhouse-tableau-connector-jdbc/issues/49 The Invalid Query is causing this exception.

yurifal commented 1 year ago

9019 is a default TCP port for a JDBC bridge. The http client (Tableau in this case) would be using port 8123 by default. Could you please tell the host OS and the connection details (non-sensitive ones)?

vfilatov commented 1 year ago

Debian 11 (& latest ClickHouse) I'm not running JDBC bridge on the server. Is there a way to instruct ANALITIKA PLUS to send a valid query without using the bridge like from jdbc(...)?

yurifal commented 1 year ago

thanx, but I'm asking for the client host details (where Tableau Desktop / Server is running). Could you please share the Tableau Desktop connection details (port / SSL / advanced if applied)? fyi Tableau (Connector) doesn't call the JDBC bridge (or any other intermediary service).

vfilatov commented 1 year ago

Sorry, I cannot share as the client is out of my control. I'm the server owner who gets complain from user.

All I can see in our "internal" JIRA JDBC URL:clickhouse://:8123/default

I can watch their connection attempts that send those strange queries which causes exceptions

yurifal commented 1 year ago

please do share

vfilatov commented 1 year ago

2023.04.19 07:55:01.583878 [ 3416145 ] {9027b984-210a-4d26-9822-11097480c2a3} <Error> ReadWriteBufferFromHTTP: HTTP request to 'http://127.0.0.1:9019/ping?use_connection_pooling=1' failed at try 1/1 with bytes read: 0/unknown. Error: Connection refused. (Current backoff wait is 100/1600 ms) 2023.04.19 07:55:01.751639 [ 3416145 ] {9027b984-210a-4d26-9822-11097480c2a3} <Error> executeQuery: Code: 410. DB::Exception: clickhouse-jdbc-bridge is not running. Please, start it manually. (EXTERNAL_SERVER_IS_NOT_RESPONDING) (version 23.3.1.2823 (official build)) (from 10.53.32.97:64408) (in query: select concat('jdbc(''', name, ''')') as TABLE_SCHEM, null as TABLE_CATALOG from jdbc('', 'SHOW DATASOURCES') where TABLE_SCHEM like '%' order by name), Stack trace (when copying this message, always include the lines below):

yurifal commented 1 year ago

I couldn't tell anything useful with this information, sorry. Could you please ask the user to reply with the (Tableau) connection details?

vfilatov commented 1 year ago

Yes, I will ask him to update this ticket.

I'm still curious where the query below is coming from (you can see it in the server logs)?

select
  concat('jdbc(''', name, ''')') as TABLE_SCHEM,
  null as TABLE_CATALOG
from jdbc('', 'SHOW DATASOURCES')
where TABLE_SCHEM like '%'
order by name

The user does NOT have such query in their poll.

yurifal commented 1 year ago

Frankly, I have no idea.

vfilatov commented 1 year ago

If it is not hardcoded in Analitikaplus, we can close this ticket.