t8y2/dbx · error
IoTDB Go client panicked while executing statement: %v
Error message
IoTDB Go client panicked while executing statement: %v
What it means
The driver wraps session.ExecuteStatementWithContext in a recover guard because some IoTDB Go client failures manifest as panics. When a panic occurs, the deferred function converts it into a regular error 'IoTDB Go client panicked while executing statement: %v' so callers get a normal error instead of crashing the process.
Source
Thrown at agents/drivers/iotdb/driver.go:57
return dataset.Close()
}
return nil
}
func (s *nativeIoTDBSession) Close() error {
return s.session.Close()
}
func executeIoTDBStatement(ctx context.Context, session *client.Session, sql string) (dataset *client.SessionDataSet, err error) {
defer func() {
if recovered := recover(); recovered != nil {
if ctxErr := ctx.Err(); ctxErr != nil {
dataset = nil
err = ctxErr
return
}
dataset = nil
err = fmt.Errorf("IoTDB Go client panicked while executing statement: %v", recovered)
}
}()
return session.ExecuteStatementWithContext(ctx, sql)
}
type connectionConfig struct {
Host string
Port int
NodeURLs []string
Username string
Password string
Database string
Dialect string
FetchSize int32
TimeZone string
ConnectRetryMax int
ConnectTimeoutMS int
EnableCompression boolView on GitHub (pinned to c0390bff16)
Solutions
- Inspect the wrapped panic value in the error message for the root cause
- Recreate/refresh the session and retry the statement
- Upgrade the IoTDB Go client library to a version with the panic fixed
- Avoid sharing the session across goroutines without synchronization
Example fix
// before
rows, err := conn.QueryContext(ctx, sql) // process died on panic
// after
rows, err := conn.QueryContext(ctx, sql)
if err != nil && strings.Contains(err.Error(), "panicked") {
session, err = openSession(cfg) // recover by reopening session
} Defensive patterns
Strategy: try-catch
Try / catch
rows, err := conn.QueryContext(ctx, sql)
if err != nil {
var retriable bool
if strings.Contains(err.Error(), "IoTDB Go client panicked") {
retriable = true // reopen session before retry
}
if !retriable {
return err
}
if err := reopenSession(ctx); err != nil { return err }
rows, err = conn.QueryContext(ctx, sql)
} Prevention
- Keep the IoTDB Go client library up to date
- Serialize access to the session across goroutines
- Check ctx cancellation before issuing statements
- Monitor for repeated panics as a signal of an incompatible server/client version
When it happens
Trigger: Executing a statement through the driver's execute helper when the IoTDB Go client panics internally (nil dataset handling, malformed response, closed session race).
Common situations: Server closed the connection mid-query; unsupported data type in the response triggering a client nil-deref; concurrent use of a session from multiple goroutines.
Related errors
- agent request panic: %v
- JDBC physical operation failed: <operation>
- Hive driver does not expose HiveServer2 metadata RPCs
- both client_cert_path and client_key_path are required for I
- IoTDB SHOW VARIABLES did not return TimestampPrecision
AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05).
Data as JSON: /api/errors/3b5f17a10592a8eb.
Report an issue: GitHub.