influxdata/influxdb · error · ServerError

{message}

Error message

{message}

What it means

`ServerError<D>` is the IOx client's generic opaque error payload for a gRPC response, whose Display is simply its `message` field. It wraps a human-readable message from the server plus an optional machine-readable `details` value, so any server-side failure surfaces through this struct verbatim.

Solutions

  1. Read the `message` field to see the server's explanation of the failure.
  2. Inspect `details` (if present) for a machine-readable error type and handle it programmatically.
  3. Match on the client `Error` enum variant to distinguish known statuses (Cancelled, InvalidArgument, etc.) from `Error::Unknown`.
  4. Check server logs for the corresponding request to find the root cause.

Example fix

// before
client.do_something(req).await?; // opaque ServerError surfaces
// after
match client.do_something(req).await {
    Err(e) => {
        if let Some(msg) = server_message(&e) { log::error!("server: {msg}"); }
        Err(e)
    }
    ok => ok,
}
Defensive patterns

Strategy: try-catch

Try / catch

match client.call(req).await {
    Err(err) => {
        if let Some(msg) = err.server_message() {
            log::error!("server error: {msg}");
        }
        Err(err)
    }
    ok => ok,
}

Prevention

When it happens

Trigger: Any gRPC call made through the `influxdb_iox_client` client where the server returns an error status with a message — the client wraps the status message into `ServerError` (e.g. as `Error::Unknown(ServerError)` or a typed variant).

Common situations: Server-side failures such as invalid queries, namespace/database not found, resource exhaustion, or internal errors; version mismatches where the client hits an endpoint the server rejects; permission problems.

Related errors


AI-assisted analysis of influxdata/influxdb@06200ef96b (2026-09-19). Data as JSON: /api/errors/762495a83db83ac9. Report an issue: GitHub.

Appendix: source

Thrown at core/influxdb_iox_client/src/client/error.rs:13

use generated_types::{
    Code, Status,
    google::{AlreadyExists, FieldViolation, NotFound, PreconditionViolation},
};
use std::fmt::Debug;
use thiserror::Error;

/// A generic opaque error
pub type StdError = Box<dyn std::error::Error + Send + Sync + 'static>;

/// A gRPC error payload with optional [details](https://cloud.google.com/apis/design/errors#error_details)
#[derive(Error, Debug, Clone)]
#[error("{message}")]
pub struct ServerError<D> {
    /// A human readable error message
    pub message: String,
    /// An optional machine-readable error
    pub details: Option<D>,
}

fn parse_status<D: ServerErrorDetails>(status: Status) -> ServerError<D> {
    ServerError {
        message: status.message().to_string(),
        details: D::try_decode(&status),
    }
}

trait ServerErrorDetails: Sized {
    fn try_decode(data: &Status) -> Option<Self>;
}

View on GitHub (pinned to 06200ef96b)