ClickHouse / ClickHouse/clickhouse-java

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

未关闭
#2,287 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
area:error-handling bug client-api-v2
主要语言
Java
星标
1.6k
派生
636
平均合并
2 天 23 小时
30 天内合并 PR
29

描述

### 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
```java
// 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"
```

贡献指南

打开贡献指南

调研方向

Inspect client-v2/src/main/java/com/clickhouse/client/api/internal/HttpAPIClientHelper.java around line 316, where the response error text is recognized. Reproduce a response containing DB::NetException and verify that its message is logged and exposed to the client like DB::Exception. Done means network-related ClickHouse errors are no longer suppressed.

由索引模型根据 Issue 内容生成。

评估

技术栈
java
领域
api
Issue 类型
缺陷
难度
2/5
预计耗时
1-3 小时
活跃度
停滞
描述清晰度
描述清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。