ClickHouse / ClickHouse/clickhouse-java

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

Ouverte
#2,287 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
area:error-handling bug client-api-v2
Langage dominant
Java
Étoiles
1.6k
Forks
636
Merge moyen
2 j 23 h
PR mergées (30 j)
29

Description

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

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
java
Domaine
api
Type d'issue
Bug
Difficulté
2/5
Temps estimé
1-3 heures
Activité
À l'abandon
Clarté
Clairement spécifiée
Accessibilité débutants
45/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.