{"record":{"id":"2ce877a0081c107c","repo":"apache/iceberg","slug":"view-does-not-exist-s-2ce877","errorCode":null,"errorMessage":"View does not exist: %s","messagePattern":"View does not exist: (.+?)","errorType":"exception","errorClass":"NoSuchViewException","httpStatus":404,"severity":"error","filePath":"core/src/main/java/org/apache/iceberg/rest/CatalogHandlers.java","lineNumber":723,"sourceCode":"        .map(SQLViewRepresentation.class::cast)\n        .forEach(r -> viewBuilder.withQuery(r.dialect(), r.sql()));\n\n    View view = viewBuilder.create();\n\n    return viewResponse(view);\n  }\n\n  private static LoadViewResponse viewResponse(View view) {\n    ViewMetadata metadata = asBaseView(view).operations().current();\n    return ImmutableLoadViewResponse.builder()\n        .metadata(metadata)\n        .metadataLocation(metadata.metadataFileLocation())\n        .build();\n  }\n\n  public static void viewExists(ViewCatalog catalog, TableIdentifier viewIdentifier) {\n    if (!catalog.viewExists(viewIdentifier)) {\n      throw new NoSuchViewException(\"View does not exist: %s\", viewIdentifier);\n    }\n  }\n\n  public static LoadViewResponse loadView(ViewCatalog catalog, TableIdentifier viewIdentifier) {\n    View view = catalog.loadView(viewIdentifier);\n    return viewResponse(view);\n  }\n\n  public static LoadViewResponse updateView(\n      ViewCatalog catalog, TableIdentifier ident, UpdateTableRequest request) {\n    View view = catalog.loadView(ident);\n    ViewMetadata metadata = commit(asBaseView(view).operations(), request);\n\n    return ImmutableLoadViewResponse.builder()\n        .metadata(metadata)\n        .metadataLocation(metadata.metadataFileLocation())\n        .build();\n  }","sourceCodeStart":705,"sourceCodeEnd":741,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/rest/CatalogHandlers.java#L705-L741","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Verify the view exists with catalog.viewExists(identifier) before loading or dropping","Check the namespace and identifier spelling/case against the actual catalog contents","List views in the namespace (catalog.listViews(namespace)) to find the correct name","Recreate the view if it was dropped"],"exampleFix":"// before\nCatalogHandlers.loadView(catalog, TableIdentifier.of(\"analytics\", \"daily_summary\"));\n// after\nif (catalog.viewExists(TableIdentifier.of(\"analytics\", \"daily_summary\"))) {\n  CatalogHandlers.loadView(catalog, TableIdentifier.of(\"analytics\", \"daily_summary\"));\n}","handlingStrategy":"try-catch","validationCode":"if (!catalog.viewExists(ident)) { /* skip or create */ }","typeGuard":null,"tryCatchPattern":"try { CatalogHandlers.loadView(catalog, ident); } catch (NoSuchViewException e) { log.warn(\"View {} missing: {}\", ident, e.getMessage()); }","preventionTips":["Check viewExists before load/drop","List views in the namespace during debugging","Keep identifiers in a single source of truth","Watch for concurrent drop jobs"],"tags":["rest-catalog","view","not-found"],"backgroundTag":"entity-not-found","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}