{"record":{"id":"752109ae80280421","repo":"apache/iceberg","slug":"view-does-not-exist-s-in-s","errorCode":null,"errorMessage":"View does not exist: %s in %s","messagePattern":"View does not exist: (.+?) in (.+?)","errorType":"exception","errorClass":"NoSuchViewException","httpStatus":404,"severity":"error","filePath":"nessie/src/main/java/org/apache/iceberg/nessie/NessieViewOperations.java","lineNumber":71,"sourceCode":"\n  @Override\n  public void doRefresh() {\n    try {\n      client.refresh();\n    } catch (NessieNotFoundException e) {\n      throw new UncheckedIOException(\n          String.format(\n              \"Failed to refresh as ref '%s' is no longer valid.\", client.getRef().getName()),\n          e);\n    }\n    String metadataLocation = null;\n    Reference reference = client.getRef().getReference();\n    try {\n      Content content = client.getApi().getContent().key(key).reference(reference).get().get(key);\n      LOG.debug(\"Content '{}' at '{}': {}\", key, reference, content);\n      if (content == null) {\n        if (currentMetadataLocation() != null) {\n          throw new NoSuchViewException(\"View does not exist: %s in %s\", key, reference);\n        }\n      } else {\n        this.icebergView =\n            content\n                .unwrap(IcebergView.class)\n                .orElseThrow(() -> new NessieContentNotFoundException(key, reference.getName()));\n        metadataLocation = icebergView.getMetadataLocation();\n      }\n    } catch (NessieNotFoundException ex) {\n      if (currentMetadataLocation() != null) {\n        throw new NoSuchViewException(\"View does not exist: %s in %s\", key, reference);\n      }\n    }\n    refreshFromMetadataLocation(\n        metadataLocation,\n        null,\n        2,\n        location ->","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/nessie/src/main/java/org/apache/iceberg/nessie/NessieViewOperations.java#L53-L89","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nview.refresh(); // throws NoSuchViewException after external drop\n// after\nif (client.getApi().getContent().key(key).reference(ref).get().get(key) == null) {\n  catalog.dropTable(ident, false); // handle absence instead of refreshing\n} else {\n  view.refresh();\n}","handlingStrategy":"try-catch","validationCode":"// check existence before refresh\nContent c = client.getApi().getContent().key(key).reference(client.getRef().getReference()).get().get(key);\nif (c == null) { /* handle missing view */ }","typeGuard":"boolean viewExists = client.getApi().getContent().key(key).reference(ref).get().get(key) != null;","tryCatchPattern":"try { view.refresh(); } catch (NoSuchViewException e) { LOG.warn(\"view gone from Nessie ref: {}\", e.getMessage()); /* recreate or drop local handle */ }","preventionTips":["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"],"tags":["nessie","view","resource-not-found","catalog"],"backgroundTag":"resource-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"}