apache/iceberg · warning
An error occurred reloading table
Error message
An error occurred reloading table {}, table was not reloaded What it means
CachingTableSupplier.refreshTable() periodically reloads the table metadata in the background; if the reload throws, the error is logged and the stale cached Table continues to be served. Data may be written against outdated metadata until the next successful refresh.
Solutions
- Check the logged exception cause for the actual reload failure (auth, network, missing metadata)
- Fix catalog connectivity/credentials; restart the job after long-running token/refresh failures
- Avoid aggressive snapshot expiration by other jobs while active writers hold table references
- Increase refresh retry/backoff or alert on repeated reload failures so staleness is detected
Defensive patterns
Strategy: retry
Validate before calling
// Check catalog reachability before relying on background refresh catalog.loadTable(tableIdentifier); // fail fast at job submission
Try / catch
Table reloaded;
try {
reloaded = tableLoader.loadTable();
} catch (Exception e) {
LOG.warn("reload failed, serving stale table", e);
// schedule retry with backoff
} Prevention
- Coordinate snapshot expiration with active Flink writers
- Alert on repeated 'table was not reloaded' warnings (stale metadata risk)
- Keep catalog credentials valid for the job's full lifetime
When it happens
Trigger: testTableReload calls refreshTable() and tableLoader.loadTable() throws: catalog connectivity failures, authentication/authorization errors, snapshot expiry removing the referenced snapshot, or corrupt/missing metadata files.
Common situations: Catalog outages or credential expiry in long-running Flink jobs; the table's snapshots expired by another maintenance job while the sink holds a cached reference; network partition between the job and the REST/Hive catalog.
Related errors
- An error occurred reloading table
- An error occurred reloading table
- An error occurred reloading table
- Already closed files for partition:
- Altering partition keys is not supported yet.
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/246c52b63fadb87a.
Report an issue: GitHub.
Appendix: source
Thrown at flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/sink/CachingTableSupplier.java:87
}
void refreshTable() {
if (System.currentTimeMillis() > lastLoadTimeMillis + tableRefreshInterval.toMillis()) {
try {
if (!tableLoader.isOpen()) {
tableLoader.open();
}
this.table = tableLoader.loadTable();
this.lastLoadTimeMillis = System.currentTimeMillis();
LOG.info(
"Table {} reloaded, next min load time threshold is {}",
table.name(),
DateTimeUtil.formatTimestampMillis(
lastLoadTimeMillis + tableRefreshInterval.toMillis()));
} catch (Exception e) {
LOG.warn("An error occurred reloading table {}, table was not reloaded", table.name(), e);
}
}
}
}
View on GitHub (pinned to 86d9c8fc54)