apache/iceberg · warning
Failed to notify listeners
Error message
Failed to notify listeners
What it means
Inside SnapshotProducer.notifyListeners(), any RuntimeException thrown while building or dispatching commit events (including CommitMetricsResult creation) is caught and logged as this warning. It signals that one of the registered listeners failed; the table commit is unaffected. This is a second, inner guard distinct from the outer catch around notifyListeners().
Solutions
- Read the logged exception to identify the failing listener.
- Fix the listener so its callbacks never throw RuntimeException.
- Add defensive error handling inside the listener around external calls.
- Verify listener code matches the current Iceberg event/report API version.
Example fix
// before
public void notify(Event event) { report(buildReport(event)); } // unchecked failure surfaces as warning
// after
public void notify(Event event) {
try { report(buildReport(event)); } catch (RuntimeException e) { LOG.warn("listener failed", e); }
} Defensive patterns
Strategy: try-catch
Try / catch
try {
listener.notify(event);
} catch (RuntimeException e) {
LOG.warn("listener {} failed; commit unaffected", listenerName, e);
} Prevention
- Wrap listener bodies in try/catch so they never throw
- Keep external reporting calls in listeners bounded by timeouts
- Match listener code to the current Iceberg event API
- Log and alert on listener failures without failing commits
When it happens
Trigger: A RuntimeException is thrown by a listener callback or by commitMetrics()/CommitReport construction while notifyListeners() runs after a commit — commonly a listener that throws unchecked exceptions.
Common situations: Listeners calling external reporting endpoints that fail; listeners written against an older event API; unhandled NPEs in custom listener code when summary fields are absent.
Understand the failure class
Background: 'Something went wrong' / 'Request failed (500)' / 'HTTP error! status: 404' — what failed HTTP requests actually mean and how to find the real cause — this error's family across 28 libraries.
Related errors
- Cannot get metrics from file format
- Cannot initialize MetricsReporter, missing no-arg…
- Cannot initialize MetricsReporter
- Cannot load Dropwizard metrics; is…
- Cannot load Dropwizard metrics; is…
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/6f832fc6a81e37ab.
Report an issue: GitHub.
Appendix: source
Thrown at core/src/main/java/org/apache/iceberg/SnapshotProducer.java:594
Listeners.notifyAll(event);
if (event instanceof CreateSnapshotEvent) {
CreateSnapshotEvent createSnapshotEvent = (CreateSnapshotEvent) event;
reporter.report(
ImmutableCommitReport.builder()
.tableName(createSnapshotEvent.tableName())
.snapshotId(createSnapshotEvent.snapshotId())
.operation(createSnapshotEvent.operation())
.sequenceNumber(createSnapshotEvent.sequenceNumber())
.metadata(EnvironmentContext.get())
.commitMetrics(
CommitMetricsResult.from(commitMetrics(), createSnapshotEvent.summary()))
.build());
}
}
} catch (RuntimeException e) {
LOG.warn("Failed to notify listeners", e);
}
}
protected void cleanAll() {
for (String manifestList : manifestLists) {
deleteFile(manifestList);
}
manifestLists.clear();
cleanUncommitted(EMPTY_SET);
}
protected void deleteFile(String path) {
deleteFunc.accept(path);
}
protected OutputFile manifestListPath() {
return ops.io()
.newOutputFile(View on GitHub (pinned to 86d9c8fc54)