{"record":{"id":"c0a4a6f1799e3451","repo":"risingwavelabs/risingwave","slug":"failed-to-drop-iceberg-table","errorCode":null,"errorMessage":"Failed to drop iceberg table.","messagePattern":"Failed to drop iceberg table\\.","errorType":"exception","errorClass":"iceberg::Error (ErrorKind::Unexpected)","httpStatus":null,"severity":"error","filePath":"src/connector/src/connector_common/iceberg/jni_catalog.rs","lineNumber":420,"sourceCode":"    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)},\n                &table_name_jstr)\n                .with_context(|| format!(\"Failed to drop iceberg table: {table_name_str}\"))?;\n\n                Ok(())\n            })\n        })\n        .await\n        .map_err(|e| {\n            iceberg::Error::new(\n                iceberg::ErrorKind::Unexpected,\n                \"Failed to drop iceberg table.\",\n            )\n            .with_source(e)\n        })\n    }\n\n    async fn purge_table(&self, table: &TableIdent) -> iceberg::Result<()> {\n        let table_info = self.load_table(table).await?;\n        self.drop_table(table).await?;\n        iceberg::drop_table_data(&table_info).await\n    }\n\n    async fn register_table(\n        &self,\n        _table_ident: &TableIdent,\n        _metadata_location: String,\n    ) -> iceberg::Result<Table> {","sourceCodeStart":402,"sourceCodeEnd":438,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/connector_common/iceberg/jni_catalog.rs#L402-L438","documentation":"JniCatalog::drop_table wraps any failure from the JNI drop-table operation (Java exception or join error on the block_in_place task) into this Unexpected iceberg error with the original error attached as source. The table was not confirmed dropped.","triggerScenarios":"The JNI call to drop the table in drop_table (called via purge_table) returns Err: Java-side exception (table does not exist per backend policy, auth failure, connection issue), JNIEnv error, or the spawned task panicked (JoinError).","commonSituations":"Dropping a table that the Java catalog refuses to drop (e.g. missing or access-denied); JVM/classpath problems; transient backend unavailability when purging Iceberg tables from RisingWave.","solutions":["Check the attached source error for the underlying Java exception","Confirm the table exists and the catalog credentials have DROP permission","Verify JVM setup and that the backend catalog is reachable","Retry the drop if the failure was transient (network/timeout)","Use catalog-level checks (table_exists) before dropping to rule out not-found semantics"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if !catalog.table_exists(&ident).await? {\n    return Ok(()); // nothing to drop\n}","typeGuard":"fn is_jni_drop_failure(err: &iceberg::Error) -> bool {\n    err.kind() == iceberg::ErrorKind::Unexpected && err.message().contains(\"Failed to drop iceberg table.\")\n}","tryCatchPattern":"if let Err(e) = catalog.drop_table(&ident).await {\n    if e.message().contains(\"Failed to drop iceberg table.\") {\n        // check source for Java exception; retry if transient\n        tracing::error!(source = ?e.source(), \"drop failed\");\n    }\n}","preventionTips":["Check table_exists before dropping","Ensure the catalog identity has DROP privileges on the backend","Retry drop operations on transient network failures"],"tags":["iceberg","jni","catalog","drop-table"],"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"}