risingwavelabs/risingwave · error · MetaError

{0} id not found: {1}

Error message

{0} id not found: {1}

What it means

A catalog object (table, database, schema, source, etc.) could not be found by its id. The first field names the object type (e.g. "table", "database"), the second carries details. This variant is constructed internally (#[construct(skip)]) via From impls from catalog errors.

Source

Thrown at src/meta/src/error.rs:76

    #[error(transparent)]
    RpcError(
        #[from]
        #[backtrace]
        RpcError,
    ),

    #[error("{0}")]
    PermissionDenied(String),

    #[error("Invalid worker: {0}, {1}")]
    InvalidWorker(WorkerId, String),

    #[error("Invalid parameter: {0}")]
    InvalidParameter(#[message] String),

    // Used for catalog errors.
    #[error("{0} id not found: {1}")]
    #[construct(skip)]
    CatalogIdNotFound(&'static str, String),

    #[error("table_fragment does not exist: id={0}")]
    FragmentNotFound(FragmentId),

    #[error("{0} named {1} already exists{under_creation}", under_creation = (.2).map(|_| " and is still being created").unwrap_or(""))]
    Duplicated(
        &'static str,
        String,
        // if under creation, take streaming job id, otherwise None
        Option<JobId>,
    ),

    #[error("Service unavailable: {0}")]
    Unavailable(#[message] String),

    #[error("Election failed: {0}")]

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Re-resolve the object by name (e.g. `SHOW TABLES`) instead of reusing a cached id.
  2. Check whether the object was dropped by another session; recreate it if needed.
  3. If targeting a different cluster after restore/clone, re-fetch ids from the new catalog.
  4. Retry the operation after catalog refresh if it was a race with a drop.
Defensive patterns

Strategy: try-catch

Validate before calling

// resolve by name right before use instead of reusing a cached id
let table = catalog.get_table_by_name(name).await?;
let table_id = table.id;

Try / catch

match meta_result {
    Err(MetaError::CatalogIdNotFound(kind, id)) => { /* re-resolve by name or recreate */ }
    other => other?,
}

Prevention

When it happens

Trigger: Referencing a catalog id in DDL/DML or meta RPC after the object was dropped, using an id from a stale catalog snapshot, or operations on objects from a different cluster/database.

Common situations: Concurrent DROP and SELECT/DDL from another session, replaying operations against a restored cluster where ids changed, hard-coded ids in scripts/risectl commands.

Understand the failure class

Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.

Related errors


AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11). Data as JSON: /api/errors/b7dff1e5bbd274fc. Report an issue: GitHub.