{"record":{"id":"dae424506b49ba70","repo":"risingwavelabs/risingwave","slug":"failed-to-check-namespace-exists","errorCode":null,"errorMessage":"Failed to check namespace exists.","messagePattern":"Failed to check namespace exists\\.","errorType":"exception","errorClass":"iceberg::Error (ErrorKind::Unexpected)","httpStatus":null,"severity":"error","filePath":"src/connector/src/connector_common/iceberg/jni_catalog.rs","lineNumber":229,"sourceCode":"    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| {\n                let namespace_str = namespace_to_string(&namespace);\n                let namespace_jstr = env.new_string(&namespace_str).unwrap();\n\n                let exists =\n                    call_method!(env, inner.java_catalog.as_obj(), {boolean namespaceExists(String)},\n                    &namespace_jstr)\n                    .with_context(|| format!(\"Failed to check namespace exists: {namespace}\"))?;\n\n                Ok(exists)\n            })\n        })\n        .await\n        .map_err(|e| {\n            iceberg::Error::new(\n                iceberg::ErrorKind::Unexpected,\n                \"Failed to check namespace exists.\",\n            )\n            .with_source(e)\n        })\n    }\n\n    /// Drop a namespace from the catalog.\n    async fn drop_namespace(&self, _namespace: &NamespaceIdent) -> iceberg::Result<()> {\n        todo!()\n    }\n\n    /// List tables from namespace.\n    async fn list_tables(&self, namespace: &NamespaceIdent) -> iceberg::Result<Vec<TableIdent>> {\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":211,"sourceCodeEnd":247,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/connector_common/iceberg/jni_catalog.rs#L211-L247","documentation":"`JniCatalog::namespace_exists` performs an existence check through the JVM catalog via JNI. Failures of the JNI call, Java-side exception, or response parsing are wrapped as an iceberg `Unexpected` error with the message 'Failed to check namespace exists.' and the underlying error as source.","triggerScenarios":"Calling namespace_exists (directly or from CREATE SINK/TABLE validation) when the JNI/Java catalog call fails.","commonSituations":"Catalog service temporarily unavailable; bad credentials; missing Java classes on classpath; network partition to the catalog backend.","solutions":["Inspect the attached source error for the root Java exception.","Verify catalog endpoint, credentials and network connectivity.","Ensure the JNI/JVM environment for the backend is properly installed.","Retry after the catalog service recovers."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Verify catalog config keys (endpoint/credentials) are present before calls\nfn catalog_config_ok(props: &serde_json::Value) -> bool {\n    props.get(\"catalog.uri\").is_some() && props.get(\"catalog.type\").is_some()\n}","typeGuard":null,"tryCatchPattern":"match catalog.namespace_exists(&ns).await {\n    Err(e) if e.kind() == iceberg::ErrorKind::Unexpected => {\n        tracing::warn!(source = ?e.source(), \"namespace_exists check failed; retrying with backoff\");\n    }\n    other => other?,\n}","preventionTips":["Pre-flight connectivity and credential checks against the catalog.","Use exponential backoff for transient failures.","Monitor catalog service health before running DDL pipelines."],"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"}