influxdata/influxdb · warning · Error

Some entity that we attempted to create already exists

Error message

Some entity that we attempted to create already exists: {0}

What it means

The `Error::AlreadyExists` variant, wrapping a boxed `ServerError<AlreadyExists>`. Raised when the client attempted to create an entity that already exists on the server, mirroring gRPC's ALREADY_EXISTS status with conflict details in the payload.

Solutions

  1. Check for existence before creating (or use an upsert/idempotent creation API if available).
  2. Read the AlreadyExists detail to identify the conflicting entity and use a different name if appropriate.
  3. Make idempotent scripts tolerate ALREADY_EXISTS by mapping this variant to a no-op.
  4. Serialize creation across concurrent workers with a lock or leader election.

Example fix

// before
client.create_table("metrics", tmpl).await?; // fails on re-run
// after
match client.create_table("metrics", tmpl).await {
    Ok(_) | Err(Error::AlreadyExists(_)) => Ok(()), // idempotent
    Err(e) => Err(e),
}
Defensive patterns

Strategy: try-catch

Validate before calling

async fn create_if_absent(client: &Client, name: &str) -> Result<(), Error> {
    if client.list_tables().await?.contains(&name.to_string()) { return Ok(()); }
    client.create_table(name, tmpl.clone()).await.map(|_| ())
}

Type guard

fn is_already_exists(e: &Error) -> bool { matches!(e, Error::AlreadyExists(_)) }

Try / catch

match result {
    Ok(_) | Err(Error::AlreadyExists(_)) => Ok(()), // treat as success
    Err(e) => Err(e),
}

Prevention

When it happens

Trigger: Creating a table, database/namespace, or other named entity whose name is already taken; replaying an idempotent creation request without an existence check.

Common situations: Migration/bootstrapping scripts run twice, concurrent workers racing to create the same resource, tests that don't clean up between runs, name collisions after a rename.

Understand the failure class

Background: "already exists" / EEXIST / FileAlreadyExistsException: what the 'file already exists' error means and how to fix it — this error's family across 37 libraries.

Related errors


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

Appendix: source

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

#[derive(Error, Debug)]
#[expect(missing_docs)]
pub enum Error {
    #[error("The operation was cancelled: {0}")]
    Cancelled(ServerError<()>),

    #[error("Unknown server error: {0}")]
    Unknown(ServerError<()>),

    #[error("Client specified an invalid argument: {0}")]
    InvalidArgument(Box<ServerError<FieldViolation>>),

    #[error("Deadline expired before operation could complete: {0}")]
    DeadlineExceeded(ServerError<()>),

    #[error("{0}")]
    NotFound(Box<ServerError<NotFound>>),

    #[error("Some entity that we attempted to create already exists: {0}")]
    AlreadyExists(Box<ServerError<AlreadyExists>>),

    #[error("The caller does not have permission to execute the specified operation: {0}")]
    PermissionDenied(ServerError<()>),

    #[error("Some resource has been exhausted: {0}")]
    ResourceExhausted(ServerError<()>),

    #[error("The system is not in a state required for the operation's execution: {0}")]
    FailedPrecondition(Box<ServerError<PreconditionViolation>>),

    #[error("The operation was aborted: {0}")]
    Aborted(ServerError<()>),

    #[error("Operation was attempted past the valid range: {0}")]
    OutOfRange(ServerError<()>),

    #[error("Operation is not implemented or supported: {0}")]

View on GitHub (pinned to 06200ef96b)