apache/iceberg · error · RuntimeException
Failed to drop ${identifier}
Error message
Failed to drop ${identifier} What it means
dropTable() wraps a Thrift TException from the Hive Metastore in a RuntimeException with this message when the table drop fails at the metastore RPC level. Missing tables are not an error here (they log and return false); this is for genuine metastore failures.
Source
Thrown at hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalog.java:286
identifier.name(),
false /* do not delete data */,
false /* throw NoSuchObjectException if the table doesn't exist */);
return null;
});
if (purge && lastMetadata != null) {
CatalogUtil.dropTableData(ops.io(), lastMetadata);
}
LOG.info("Dropped table: {}", identifier);
return true;
} catch (NoSuchTableException | NoSuchObjectException e) {
LOG.info("Skipping drop, table does not exist: {}", identifier, e);
return false;
} catch (TException e) {
throw new RuntimeException("Failed to drop " + identifier, e);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException("Interrupted in call to dropTable", e);
}
}
@Override
public boolean dropView(TableIdentifier identifier) {
if (!isValidIdentifier(identifier)) {
return false;
}
try {
String database = identifier.namespace().level(0);
String viewName = identifier.name();
HiveViewOperations ops = (HiveViewOperations) newViewOps(identifier);View on GitHub (pinned to 86d9c8fc54)
Solutions
- Check metastore health and connectivity; inspect the chained TException cause.
- Retry the drop with backoff — metastore RPC failures are often transient.
- Verify Hive client and metastore server versions are compatible.
- If the table is a non-Iceberg/HMS-managed table causing issues, use Hive tooling directly to inspect its state.
Example fix
// before
boolean dropped = catalog.dropTable(identifier);
// after
boolean dropped;
try {
dropped = catalog.dropTable(identifier);
} catch (RuntimeException e) {
LOG.error("Metastore failed dropping {}", identifier, e.getCause());
dropped = false; // surface to caller, retry later
} Defensive patterns
Strategy: try-catch
Validate before calling
// Pre-check is advisory only (TOCTOU); connectivity check recommended: // boolean metastoreUp = /* health probe on metastore URI */;
Try / catch
try {
dropped = catalog.dropTable(id);
} catch (RuntimeException e) {
LOG.error("Drop failed for {} cause={}", id, e.getCause());
dropped = false; // schedule retry
} Prevention
- Add retry with backoff around dropTable for transient Thrift failures.
- Check the exception cause to distinguish metastore outages from data issues.
- Keep Hive client library versions compatible with the server.
When it happens
Trigger: Calling catalog.dropTable(identifier) (optionally with purge flag) and the Hive Metastore throws a TException — connection loss, protocol error, or metastore-side failure during dropTable/drop_database dependent operations.
Common situations: Metastore unavailable or network partition; Hive client/server version mismatch; metastore lock or HMS backend (RDBMS) failure while deleting entries; concurrent modifications hitting a metastore bug.
Related errors
- Failed to list all views under namespace ${namespace}
- Metastore operation failed for %s.%s
- Interrupted in call to dropTable
- Failed to drop view ${identifier}
- Failed to check table existence of ${baseTableIdentifier}
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/9d85d112a89e25e4.
Report an issue: GitHub.