apache/iceberg · error · NoSuchTableException
Cannot find Glue table %s after refresh, maybe another proce
Error message
Cannot find Glue table %s after refresh, maybe another process deleted it or revoked your access permission
What it means
GlueTableOperations.doRefresh throws NoSuchTableException when a refresh finds the Glue table missing (getGlueTable returns null) even though the operation previously knew a metadata location. This indicates the table was deleted underneath the running operation or access was revoked, so the current state cannot be refreshed.
Source
Thrown at aws/src/main/java/org/apache/iceberg/aws/glue/GlueTableOperations.java:134
}
return fileIO;
}
@Override
protected String tableName() {
return fullTableName;
}
@Override
protected void doRefresh() {
String metadataLocation = null;
Table table = getGlueTable();
if (table != null) {
checkIfTableIsIceberg(table, tableName());
metadataLocation = table.parameters().get(METADATA_LOCATION_PROP);
} else {
if (currentMetadataLocation() != null) {
throw new NoSuchTableException(
"Cannot find Glue table %s after refresh, "
+ "maybe another process deleted it or revoked your access permission",
tableName());
}
}
refreshFromMetadataLocation(metadataLocation);
}
@Override
protected void doCommit(TableMetadata base, TableMetadata metadata) {
CommitStatus commitStatus = CommitStatus.FAILURE;
RetryDetector retryDetector = new RetryDetector();
String newMetadataLocation = null;
boolean glueTempTableCreated = false;
try {
glueTempTableCreated = createGlueTempTableIfNecessary(base, metadata.location());View on GitHub (pinned to 86d9c8fc54)
Solutions
- Check whether another job or user dropped the Glue table (CloudTrail for DeleteTable events) and stop the drop or recreate the table.
- Verify Lake Formation / IAM grants still allow the current role to read the table.
- Recreate the table from its metadata if the deletion was accidental, then re-open the Iceberg table reference.
- Coordinate table lifecycle across pipelines — never drop tables while readers hold live references.
Example fix
// before
Table table = catalog.loadTable(ident);
table.refresh(); // throws if table was deleted concurrently
// after
Table table = catalog.loadTable(ident);
if (!catalog.tableExists(ident)) {
LOG.error("Table {} was deleted externally, aborting job", ident);
return;
}
table.refresh(); Defensive patterns
Strategy: try-catch
Validate before calling
TableIdentifier ident = TableIdentifier.of("sales", "events");
if (!catalog.tableExists(ident)) {
throw new IllegalStateException("Table " + ident + " no longer exists in Glue");
} Try / catch
try {
table.refresh();
} catch (NoSuchTableException e) {
LOG.error("Glue table {} was deleted or access revoked mid-job; aborting", tableName);
throw e;
} Prevention
- Never drop Glue tables while other jobs may hold open references
- Use CloudTrail alerts on DeleteTable for production databases
- Review Lake Formation/IAM grants before revoking table access
- Restart long-running streaming jobs after table recreation to pick up fresh references
When it happens
Trigger: Calling table.refresh() or any operation triggering refresh (reads, commits) after another process/job issued Glue DeleteTable, or after IAM permissions on the table were revoked mid-session.
Common situations: Concurrent Spark/Flink jobs where one drops the table while another holds an open reference; retention jobs cleaning up 'old' tables still in use; Lake Formation permission changes removing access; long-running streaming queries whose underlying table was deleted.
Understand the failure class
Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.
Related errors
- Cannot commit %s due to unexpected exception
- Fail to acquire lock %s to commit new metadata at %s
- Cannot commit %s because base metadata location '%s' is not
- Cannot commit %s because Glue detected concurrent update
- Optimistic locking is not available in the environment. Usin
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/889603460e6d6d65.
Report an issue: GitHub.