apache/iceberg · error · NoSuchViewException
View does not exist: in
Error message
View does not exist: %s in %s
What it means
NessieViewOperations.doRefresh() resolves the view's IcebergView content at the Nessie reference. If the content lookup returns null (or the reference itself is not found) while this operation already has a current metadata location, the library throws NoSuchViewException because an existing table/view apparently vanished from the reference.
Solutions
- Re-create or restore the view in the Nessie reference before refreshing.
- Re-resolve the current reference (client.getRef()) and retry with a fresh operations instance.
- Verify the view key and reference name are correct in the catalog URI/config.
- If the deletion was intentional, drop the local handle rather than refreshing.
Example fix
// before
view.refresh(); // throws NoSuchViewException after external drop
// after
if (client.getApi().getContent().key(key).reference(ref).get().get(key) == null) {
catalog.dropTable(ident, false); // handle absence instead of refreshing
} else {
view.refresh();
} Defensive patterns
Strategy: try-catch
Validate before calling
// check existence before refresh
Content c = client.getApi().getContent().key(key).reference(client.getRef().getReference()).get().get(key);
if (c == null) { /* handle missing view */ } Type guard
boolean viewExists = client.getApi().getContent().key(key).reference(ref).get().get(key) != null;
Try / catch
try { view.refresh(); } catch (NoSuchViewException e) { LOG.warn("view gone from Nessie ref: {}", e.getMessage()); /* recreate or drop local handle */ } Prevention
- Verify the view key and Nessie reference before loading
- Re-fetch operations after external Nessie mutations
- Avoid holding long-lived view handles across drop operations
- Monitor Nessie commits for deletes on referenced keys
When it happens
Trigger: Calling refresh/load on a Nessie-backed view after the view was deleted from the reference by another commit; asking for content at a reference where the key no longer exists while currentMetadataLocation() is non-null.
Common situations: Concurrent drop-view and read; pointing a cached NessieViewOperations at a branch that was rebased or reset; stale client reference after an external Nessie operation removed the content.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- Cannot rename to . View already exists
- View does not exist
- Altering a view is not supported by catalog:
- Altering a view is not supported by catalog
- Altering a view is not supported by catalog
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/752109ae80280421.
Report an issue: GitHub.
Appendix: source
Thrown at nessie/src/main/java/org/apache/iceberg/nessie/NessieViewOperations.java:71
@Override
public void doRefresh() {
try {
client.refresh();
} catch (NessieNotFoundException e) {
throw new UncheckedIOException(
String.format(
"Failed to refresh as ref '%s' is no longer valid.", client.getRef().getName()),
e);
}
String metadataLocation = null;
Reference reference = client.getRef().getReference();
try {
Content content = client.getApi().getContent().key(key).reference(reference).get().get(key);
LOG.debug("Content '{}' at '{}': {}", key, reference, content);
if (content == null) {
if (currentMetadataLocation() != null) {
throw new NoSuchViewException("View does not exist: %s in %s", key, reference);
}
} else {
this.icebergView =
content
.unwrap(IcebergView.class)
.orElseThrow(() -> new NessieContentNotFoundException(key, reference.getName()));
metadataLocation = icebergView.getMetadataLocation();
}
} catch (NessieNotFoundException ex) {
if (currentMetadataLocation() != null) {
throw new NoSuchViewException("View does not exist: %s in %s", key, reference);
}
}
refreshFromMetadataLocation(
metadataLocation,
null,
2,
location ->View on GitHub (pinned to 86d9c8fc54)