risingwavelabs/risingwave · error · iceberg::Error (ErrorKind::Unexpected)

Failed to create namespace.

Error message

Failed to create namespace.

What it means

`JniCatalog::create_namespace` sends a create-namespace request to the Java catalog through JNI. Any failure during the call or while deserializing the response is converted into an iceberg `Unexpected` error with the message 'Failed to create namespace.' and the original error attached as its source.

Source

Thrown at src/connector/src/connector_common/iceberg/jni_catalog.rs:197

        _properties: HashMap<String, String>,
    ) -> iceberg::Result<iceberg::Namespace> {
        let inner = self.inner.clone();
        let namespace = namespace.clone();
        execute_blocking_jni(move || {
            execute_with_jni_env(inner.jvm, |env| {
                let namespace_str = namespace_to_string(&namespace);
                let namespace_jstr = env.new_string(&namespace_str).unwrap();

                call_method!(env, inner.java_catalog.as_obj(), {void createNamespace(String)},
                    &namespace_jstr)
                .with_context(|| format!("Failed to create namespace: {namespace}"))?;

                Ok(Namespace::new(namespace))
            })
        })
        .await
        .map_err(|e| {
            iceberg::Error::new(
                iceberg::ErrorKind::Unexpected,
                "Failed to create namespace.",
            )
            .with_source(e)
        })
    }

    /// Get a namespace information from the catalog.
    async fn get_namespace(&self, _namespace: &NamespaceIdent) -> iceberg::Result<Namespace> {
        todo!()
    }

    /// Check if namespace exists in catalog.
    async fn namespace_exists(&self, namespace: &NamespaceIdent) -> iceberg::Result<bool> {
        let inner = self.inner.clone();
        let namespace = namespace.clone();
        execute_blocking_jni(move || {
            execute_with_jni_env(inner.jvm, |env| {

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Check the wrapped source error for the underlying Java exception.
  2. Verify the namespace identifier is valid and does not already exist.
  3. Confirm IAM/permissions allow namespace creation on the target catalog.
  4. Ensure the catalog service is reachable and credentials are valid.
Defensive patterns

Strategy: try-catch

Validate before calling

// Ensure the namespace does not already exist before creating it
if !catalog.namespace_exists(&ns).await? {
    catalog.create_namespace(&ns, props).await?;
}

Try / catch

match catalog.create_namespace(&ns, props).await {
    Err(e) => {
        tracing::error!(source = ?e.source(), "create_namespace failed");
        // treat 'already exists' from source as idempotent success if applicable
    }
    Ok(_) => {}
}

Prevention

When it happens

Trigger: Calling create_namespace on a JNI-backed catalog when the JVM/Java catalog rejects the creation (namespace already exists, invalid name, permission or connectivity failure).

Common situations: Creating a namespace that already exists in Glue/Hadoop catalog; insufficient IAM permissions; catalog service outage.

Related errors


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