apache/iceberg · error · NoSuchViewException

View does not exist

Error message

View does not exist: %s

What it means

Thrown by the REST catalog server-side handler when a requested view cannot be found in the ViewCatalog. CatalogHandlers.viewExists checks catalog.viewExists and throws NoSuchViewException if the view is absent, so load/rename/drop operations on missing views fail fast with a 404-mapped exception.

Solutions

  1. Verify the view exists with catalog.viewExists(identifier) before loading or dropping
  2. Check the namespace and identifier spelling/case against the actual catalog contents
  3. List views in the namespace (catalog.listViews(namespace)) to find the correct name
  4. Recreate the view if it was dropped

Example fix

// before
CatalogHandlers.loadView(catalog, TableIdentifier.of("analytics", "daily_summary"));
// after
if (catalog.viewExists(TableIdentifier.of("analytics", "daily_summary"))) {
  CatalogHandlers.loadView(catalog, TableIdentifier.of("analytics", "daily_summary"));
}
Defensive patterns

Strategy: try-catch

Validate before calling

if (!catalog.viewExists(ident)) { /* skip or create */ }

Try / catch

try { CatalogHandlers.loadView(catalog, ident); } catch (NoSuchViewException e) { log.warn("View {} missing: {}", ident, e.getMessage()); }

Prevention

When it happens

Trigger: Calling CatalogHandlers.viewExists(catalog, id) or loadView(catalog, id) with a TableIdentifier that was never created, was dropped, or is mistyped/has the wrong namespace.

Common situations: Client requests a view that exists only in another catalog or namespace; view dropped concurrently by another job; case-sensitivity or namespace mismatch in the identifier; environment pointing at the wrong warehouse location.

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


AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12). Data as JSON: /api/errors/2ce877a0081c107c. Report an issue: GitHub.

Appendix: source

Thrown at core/src/main/java/org/apache/iceberg/rest/CatalogHandlers.java:723

        .map(SQLViewRepresentation.class::cast)
        .forEach(r -> viewBuilder.withQuery(r.dialect(), r.sql()));

    View view = viewBuilder.create();

    return viewResponse(view);
  }

  private static LoadViewResponse viewResponse(View view) {
    ViewMetadata metadata = asBaseView(view).operations().current();
    return ImmutableLoadViewResponse.builder()
        .metadata(metadata)
        .metadataLocation(metadata.metadataFileLocation())
        .build();
  }

  public static void viewExists(ViewCatalog catalog, TableIdentifier viewIdentifier) {
    if (!catalog.viewExists(viewIdentifier)) {
      throw new NoSuchViewException("View does not exist: %s", viewIdentifier);
    }
  }

  public static LoadViewResponse loadView(ViewCatalog catalog, TableIdentifier viewIdentifier) {
    View view = catalog.loadView(viewIdentifier);
    return viewResponse(view);
  }

  public static LoadViewResponse updateView(
      ViewCatalog catalog, TableIdentifier ident, UpdateTableRequest request) {
    View view = catalog.loadView(ident);
    ViewMetadata metadata = commit(asBaseView(view).operations(), request);

    return ImmutableLoadViewResponse.builder()
        .metadata(metadata)
        .metadataLocation(metadata.metadataFileLocation())
        .build();
  }

View on GitHub (pinned to 86d9c8fc54)