risingwavelabs/risingwave · error · anyhow::Error

IcebergError::from(e)

Error message

IcebergError::from(e)

What it means

`create_catalog` wraps a failure from the native REST catalog builder (`iceberg_catalog_rest::RestCatalogBuilder::load`) — typically network/config errors establishing the REST catalog client — into `IcebergError` and then `anyhow!`. The original REST client error is preserved as the source.

Solutions

  1. Inspect the wrapped `IcebergError`/underlying reqwest error for the root cause (connection refused, DNS, TLS).
  2. Verify `catalog.uri` is reachable from the RisingWave node (`curl <uri>/v1/config`).
  3. Check REST catalog credentials/headers (see the catalog.header format) and OAuth settings.

Example fix

// before
with ( catalog.type = 'rest', catalog.uri = 'http://localhost:8181' ) -- server not started
// after
# start the REST catalog first, then
with ( catalog.type = 'rest', catalog.uri = 'http://rest:8181' )
Defensive patterns

Strategy: try-catch

Validate before calling

const res = await fetch(restUri + '/v1/config'); // fail fast if REST catalog is unreachable
if (!res.ok) throw new Error(`REST catalog unreachable: ${res.status}`);

Try / catch

match load_table(...).await {
    Err(e) if e.to_string().contains("RestCatalog") => {
        tracing::error!("REST catalog setup failed: {e:#}");
        // check uri/credentials then retry
    }
    other => other?,
}

Prevention

When it happens

Trigger: Calling `create_catalog` (via `load_table`) when `CatalogBuildPlan::NativeRest` is selected and the REST catalog endpoint is unreachable, returns an error, TLS fails, or required rest props (uri, credentials) are wrong.

Common situations: Wrong `catalog.uri`, REST server down or behind a proxy, expired OAuth2 credentials, self-signed certs, DNS failure in container networks.

Understand the failure class

Background: "API request failed": what wrapped HTTP errors from external APIs mean and how to find the real cause — this error's family across 29 libraries.

Related errors


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

Appendix: source

Thrown at src/connector/src/connector_common/iceberg/mod.rs:446

                    catalog_name: self.common.catalog_name(),
                    catalog_impl,
                    java_catalog_props,
                })
            }
        }
    }

    pub async fn create_catalog(&self) -> ConnectorResult<Arc<dyn Catalog>> {
        match self.build_plan()? {
            CatalogBuildPlan::Storage(config) => {
                let catalog = storage_catalog::StorageCatalog::new(config)?;
                Ok(Arc::new(catalog))
            }
            CatalogBuildPlan::NativeRest(iceberg_configs) => {
                let catalog = iceberg_catalog_rest::RestCatalogBuilder::default()
                    .load("rest", iceberg_configs)
                    .await
                    .map_err(|e| anyhow!(IcebergError::from(e)))?;
                Ok(Arc::new(catalog))
            }
            CatalogBuildPlan::NativeGlue(iceberg_configs) => {
                let catalog = iceberg_catalog_glue::GlueCatalogBuilder::default()
                    .load("glue", iceberg_configs)
                    .await
                    .map_err(|e| anyhow!(IcebergError::from(e)))?;
                Ok(Arc::new(catalog))
            }
            CatalogBuildPlan::Jni {
                file_io_props,
                catalog_name,
                catalog_impl,
                java_catalog_props,
            } => {
                jni_catalog::JniCatalog::build_catalog(
                    file_io_props,
                    catalog_name,

View on GitHub (pinned to 6469eb736d)