risingwavelabs/risingwave · error

column desc at index

Error message

column desc at index {} for table id {} not found

What it means

In comment_on, after locating the column by index, the code dereferences column.column_desc to set the description. If the protobuf Column has a None column_desc (the oneof/optional field is unset), the ok_or_else raises this anyhow error naming the index and table id. It indicates catalog corruption or an index that resolved to a column lacking its descriptor.

Solutions

  1. Verify the table's catalog integrity; re-create or repair the table if its column descriptors are missing.
  2. Re-run the COMMENT operation after fixing/recreating the table.
  3. Report to maintainers if a normal user table hits this — it usually indicates a catalog bug.

Example fix

// before
column_desc.description = comment.description; // panics/errs if column_desc is None
// after
let column_desc = column.column_desc.as_mut().ok_or_else(|| {
    anyhow!("column desc at index {} for table id {} not found", col_idx, comment.table_id)
})?;
column_desc.description = comment.description;
Defensive patterns

Strategy: try-catch

Validate before calling

// Rust: verify the column descriptor exists before commenting
if pb_columns.get(col_idx).and_then(|c| c.column_desc.as_ref()).is_none() {
    return Err(anyhow!("column at index {} has no descriptor; catalog may be corrupted", col_idx));
}

Type guard

fn has_desc(c: &Option<Column>) -> bool {
    c.as_ref().and_then(|c| c.column_desc.as_ref()).is_some()
}

Try / catch

match controller.comment_on(comment).await {
    Err(e) if e.to_string().contains("column desc") => {
        log::error!("catalog corruption for table {}: {}", comment.table_id, e);
        escalate_or_repair();
    }
    other => other?,
}

Prevention

When it happens

Trigger: COMMENT ON COLUMN on a table where pb_columns.get(col_idx) yields a Column whose column_desc field is unset — typically a corrupted or partially-written table catalog, or an internal code path that built columns without descriptors.

Common situations: Upgrades/migrations that left column descriptors missing; manually patched catalog data; commenting on columns of internal/implicit tables built through unusual code paths.

Understand the failure class

Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.

Related errors


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

Appendix: source

Thrown at src/meta/src/controller/catalog/mod.rs:861

            .one(&txn)
            .await?
            .ok_or_else(|| MetaError::catalog_id_not_found("object", comment.table_id))?;

        let table = if let Some(col_idx) = comment.column_index {
            let columns: ColumnCatalogArray = Table::find_by_id(comment.table_id)
                .select_only()
                .column(table::Column::Columns)
                .into_tuple()
                .one(&txn)
                .await?
                .ok_or_else(|| MetaError::catalog_id_not_found("table", comment.table_id))?;
            let mut pb_columns = columns.to_protobuf();

            let column = pb_columns
                .get_mut(col_idx as usize)
                .ok_or_else(|| MetaError::catalog_id_not_found("column", col_idx))?;
            let column_desc = column.column_desc.as_mut().ok_or_else(|| {
                anyhow!(
                    "column desc at index {} for table id {} not found",
                    col_idx,
                    comment.table_id
                )
            })?;
            column_desc.description = comment.description;
            table::ActiveModel {
                table_id: Set(comment.table_id),
                columns: Set(pb_columns.into()),
                ..Default::default()
            }
            .update(&txn)
            .await?
        } else {
            table::ActiveModel {
                table_id: Set(comment.table_id),
                description: Set(comment.description),
                ..Default::default()

View on GitHub (pinned to 6469eb736d)