clickhouse-java icon indicating copy to clipboard operation
clickhouse-java copied to clipboard

[client-v2] `DB::Exception: <Unreadable error message>` while error returned from Cloud instance

Open chernser opened this issue 6 months ago • 3 comments

Description

Exception doesn't contain message from a server: Code: 164. DB::Exception: <Unreadable error message> (transport error: 500)

Log

2025-06-10 19:16:01.278 - com.clickhouse.client.internal.apache.hc.client5.http.impl.classic.MainClientExec: ex-0000000007 connection can be kept alive for 10 SECONDS
2025-06-10 19:16:01.279 - com.clickhouse.client.api.Client: Trying to read error message: bytes available 0 
2025-06-10 19:16:01.279 - com.clickhouse.client.internal.apache.hc.client5.http.impl.classic.InternalHttpClient: InternalConnectionEndpoint-3c6022b releasing valid endpoint
2025-06-10 19:16:01.279 - com.clickhouse.client.internal.apache.hc.client5.http.impl.io.BasicHttpClientConnectionManager: ep-0000000002 Connection can be kept alive for 10 SECONDS
2025-06-10 19:16:01.279 - com.clickhouse.client.api.Client: read nothing
2025-06-10 19:16:01.279 - com.clickhouse.client.api.Client: message is empty
2025-06-10 19:16:01.281 - com.clickhouse.jdbc.internal.ExceptionUtils: Exception Message: null, Debug message: null
2025-06-10 19:16:01.372 - SQL Error [22000]: Code: 164. DB::Exception: <Unreadable error message> (transport error: 500)
org.jkiss.dbeaver.model.sql.DBSQLException: SQL Error [22000]: Code: 164. DB::Exception: <Unreadable error message> (transport error: 500)

Pay attention to the

2025-06-10 19:16:01.279 - com.clickhouse.client.internal.apache.hc.client5.http.impl.classic.InternalHttpClient: InternalConnectionEndpoint-3c6022b releasing valid endpoint

It means that response doesn't contain any body. This handled in org.apache.hc.client5.http.impl.classic.MainClientExec#execute :


// check for entity, release connection if possible
final HttpEntity entity = response.getEntity();
if (entity == null || !entity.isStreaming()) {
    // connection not needed and (assumed to be) in re-usable state
    execRuntime.releaseEndpoint();
    return new CloseableHttpResponse(response, null);
}
return new CloseableHttpResponse(response, execRuntime);

Environment

  • Client version: 0.8.6
  • [X] Cloud

chernser avatar Jun 10 '25 19:06 chernser

@chernser Are you able to reproduce the problem with a local or Cloud instance? are you able to reproduce with curl?

mshustov avatar Jun 11 '25 10:06 mshustov

@mshustov I was able to reproduce with cloud instance only. I have not tried curl but in the debug mode I see that no response is coming.

chernser avatar Jun 11 '25 13:06 chernser

@chernser caused by https://github.com/ClickHouse/clickhouse-java/issues/2287?

mshustov avatar Jun 12 '25 09:06 mshustov

I encountered the same issue: I can't connect using the ClickHouse driver, but it works successfully with the legacy version. Besides, I originally intended to use DataGrip for the connection. Have you resolved this problem? my ClickHouse version is 21.7.4.18.

WenLiXue avatar Nov 12 '25 03:11 WenLiXue

Good day, @WenLiXue ! This should be resolved in 0.9.3 and 0.9.4.

Please verify and if fails - please create an issue with how to reproduce.

Thanks!

chernser avatar Nov 12 '25 05:11 chernser

Hi there!

Thank you for your quick response! I’d like to confirm: could you clarify which software/tool version you’re referring to (0.9.3 and 0.9.4)? Is it the ClickHouse driver version for DataGrip or another related component?

Also, I’m still facing an issue when connecting via clickhouse-client on port 8123. Here are the details:

  • My ClickHouse server and client versions are both 21.7.4.18 (official build).
  • Command used: clickhouse-client -h 127.0.0.1 --port 8123 -u xxxx --password xxxx
  • Error message: Code: 209. DB::NetException: Timeout exceeded while reading from socket (127.0.0.1:8123)

Notably, I can connect successfully with the legacy driver in DataGrip, but the standard ClickHouse driver and direct clickhouse-client connection on port 8123 both fail. Could this timeout issue be related to the version you mentioned?

Looking forward to your guidance! Thanks again!

WenLiXue avatar Nov 12 '25 05:11 WenLiXue

@WenLiXue I did mean a JDBC driver version.

Timeout should not be so critical here. I think there is something else. Please create an issue so we can investigate.

Thanks!

chernser avatar Nov 12 '25 06:11 chernser

I can confirm that the error message issue we encountered with version 0.9.2 jdbc driver (on dBeaver 25.2) has been resolved in version 0.9.4.

GuillaumePressiat avatar Nov 25 '25 19:11 GuillaumePressiat