{"record":{"id":"64799fb2e6aa3f53","repo":"risingwavelabs/risingwave","slug":"failed-to-create-namespace","errorCode":null,"errorMessage":"Failed to create namespace.","messagePattern":"Failed to create namespace\\.","errorType":"exception","errorClass":"iceberg::Error (ErrorKind::Unexpected)","httpStatus":null,"severity":"error","filePath":"src/connector/src/connector_common/iceberg/jni_catalog.rs","lineNumber":197,"sourceCode":"        _properties: HashMap<String, String>,\n    ) -> iceberg::Result<iceberg::Namespace> {\n        let inner = self.inner.clone();\n        let namespace = namespace.clone();\n        execute_blocking_jni(move || {\n            execute_with_jni_env(inner.jvm, |env| {\n                let namespace_str = namespace_to_string(&namespace);\n                let namespace_jstr = env.new_string(&namespace_str).unwrap();\n\n                call_method!(env, inner.java_catalog.as_obj(), {void createNamespace(String)},\n                    &namespace_jstr)\n                .with_context(|| format!(\"Failed to create namespace: {namespace}\"))?;\n\n                Ok(Namespace::new(namespace))\n            })\n        })\n        .await\n        .map_err(|e| {\n            iceberg::Error::new(\n                iceberg::ErrorKind::Unexpected,\n                \"Failed to create namespace.\",\n            )\n            .with_source(e)\n        })\n    }\n\n    /// Get a namespace information from the catalog.\n    async fn get_namespace(&self, _namespace: &NamespaceIdent) -> iceberg::Result<Namespace> {\n        todo!()\n    }\n\n    /// Check if namespace exists in catalog.\n    async fn namespace_exists(&self, namespace: &NamespaceIdent) -> iceberg::Result<bool> {\n        let inner = self.inner.clone();\n        let namespace = namespace.clone();\n        execute_blocking_jni(move || {\n            execute_with_jni_env(inner.jvm, |env| {","sourceCodeStart":179,"sourceCodeEnd":215,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/connector_common/iceberg/jni_catalog.rs#L179-L215","documentation":"`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.","triggerScenarios":"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).","commonSituations":"Creating a namespace that already exists in Glue/Hadoop catalog; insufficient IAM permissions; catalog service outage.","solutions":["Check the wrapped source error for the underlying Java exception.","Verify the namespace identifier is valid and does not already exist.","Confirm IAM/permissions allow namespace creation on the target catalog.","Ensure the catalog service is reachable and credentials are valid."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Ensure the namespace does not already exist before creating it\nif !catalog.namespace_exists(&ns).await? {\n    catalog.create_namespace(&ns, props).await?;\n}","typeGuard":null,"tryCatchPattern":"match catalog.create_namespace(&ns, props).await {\n    Err(e) => {\n        tracing::error!(source = ?e.source(), \"create_namespace failed\");\n        // treat 'already exists' from source as idempotent success if applicable\n    }\n    Ok(_) => {}\n}","preventionTips":["Check namespace existence before create to make operations idempotent.","Verify IAM permissions for namespace creation.","Keep namespace identifiers conformant with the backend catalog's naming rules."],"tags":["iceberg","jni","java","namespace"],"backgroundTag":"upstream-api-error","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}