{"record":{"id":"13e5a62c2a62d3fe","repo":"risingwavelabs/risingwave","slug":"failed-to-load-iceberg-table","errorCode":null,"errorMessage":"Failed to load iceberg table.","messagePattern":"Failed to load iceberg table\\.","errorType":"exception","errorClass":"iceberg::Error (ErrorKind::Unexpected)","httpStatus":null,"severity":"error","filePath":"src/connector/src/connector_common/iceberg/jni_catalog.rs","lineNumber":393,"sourceCode":"                );\n\n                let table_metadata = resp.metadata;\n\n                let file_io = FileIOBuilder::new(Arc::new(OpenDalResolvingStorageFactory::new()))\n                    .with_props(file_io_props.iter())\n                    .build();\n\n                Ok(Table::builder()\n                    .file_io(file_io)\n                    .identifier(table)\n                    .metadata(table_metadata)\n                    .runtime(runtime)\n                    .build())\n            })\n        })\n        .await\n        .map_err(|e| {\n            iceberg::Error::new(\n                iceberg::ErrorKind::Unexpected,\n                \"Failed to load iceberg table.\",\n            )\n            .with_source(e)\n        })?\n    }\n\n    /// Drop a table from the catalog.\n    async fn drop_table(&self, table: &TableIdent) -> iceberg::Result<()> {\n        let inner = self.inner.clone();\n        let table = table.to_owned();\n        execute_blocking_jni(move || {\n            execute_with_jni_env(inner.jvm, |env| {\n                let table_name_str = table.to_string();\n\n                let table_name_jstr = env.new_string(&table_name_str).unwrap();\n\n                call_method!(env, inner.java_catalog.as_obj(), {boolean dropTable(String)},","sourceCodeStart":375,"sourceCodeEnd":411,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/connector_common/iceberg/jni_catalog.rs#L375-L411","documentation":"JniCatalog::load_table wraps any error surfaced from the JNI call stack (Java exception, JNIEnv failure, or join error) into this generic Unexpected iceberg error, attaching the original as its source. It is a wrapper error; the real cause is in with_source(e).","triggerScenarios":"The Java/JNI catalog call invoked inside tokio::task::block_in_place (from purge_table) returns Err — e.g. Java exception during catalog.loadTable, missing JVM class, bad catalog properties, or a tokio JoinError when the spawned closure panics.","commonSituations":"Missing or wrong catalog properties (warehouse URI, catalog type) passed to the Java catalog; JVM not initialized or classpath missing the Iceberg runtime; network/auth failure reaching Hive/Gluc/Nessie from the Java side; closure panic in the async block.","solutions":["Inspect the with_source error chain to find the underlying JNI/Java exception","Verify catalog properties (uri, warehouse, catalog type) are correct and complete","Ensure the JVM is initialized and the Iceberg Java runtime jar is on the classpath","Check the Java-side catalog connectivity (network, credentials) to the backend","Look for panics in the surrounding closure in jni_catalog.rs logs"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Validate catalog config before calling load\nassert!(!props.get(\"uri\").unwrap_or_default().is_empty(), \"catalog uri required\");\n// Ensure JVM is up before JNI catalog use\n// jvm::ensure_initialized()?;","typeGuard":"fn is_jni_load_failure(err: &iceberg::Error) -> bool {\n    err.kind() == iceberg::ErrorKind::Unexpected && err.message().contains(\"Failed to load iceberg table.\")\n}","tryCatchPattern":"match catalog.load_table(&ident).await {\n    Err(e) if e.message().contains(\"Failed to load iceberg table.\") => {\n        tracing::error!(source = ?e.source(), \"jni load_table failed\");\n        // inspect Java-side cause, retry transient errors\n    }\n    other => other,\n}","preventionTips":["Double-check catalog properties (uri, warehouse, type) before calls","Initialize the JVM and classpath early and fail fast at startup","Log the full error chain (with_source) for JNI diagnostics"],"tags":["iceberg","jni","catalog","wrapper-error"],"backgroundTag":"api-request-failed","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"}