Skip to content

If received NetException from ClickHouse in response body, it will be ignored and unrecognized #2287

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

Open
DNAlchemist opened this issue Apr 7, 2025 · 1 comment

Comments

@DNAlchemist
Copy link

DNAlchemist commented Apr 7, 2025

Describe the bug

The ClickHouse Java driver suppresses error messages that contain DB::NetException due to a hardcoded substring match for DB::Exception.
In log we receiving Caused by: com.clickhouse.client.api.ServerException: Code: 279. DB::Exception: (transport error: 500)

This causes legitimate network-related errors to be hidden, making debugging difficult.

Steps to reproduce

  1. Receive NetException from ClickHouse in response (e.g., due to missing table in cluster -> cluster integration or any network failure).

Expected behaviour

The error message containing DB::NetException should be properly logged and exposed to the client, similar to DB::Exception.

Code example

// Relevant source in the driver
// https://github.com/ClickHouse/clickhouse-java/blob/main/client-v2/src/main/java/com/clickhouse/client/api/internal/HttpAPIClientHelper.java#L316C33-L316C58

// The current implementation expects only "DB::Exception"
// But actual response contains "DB::NetException"
@chernser
Copy link
Contributor

@DNAlchemist thank you for reporting!

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

No branches or pull requests

2 participants