{"record":{"id":"f8f9945b798616b0","repo":"apache/iceberg","slug":"view-does-not-exist-s-f8f994","errorCode":null,"errorMessage":"View does not exist: %s","messagePattern":"View does not exist: (.+?)","errorType":"exception","errorClass":"NoSuchViewException","httpStatus":404,"severity":"error","filePath":"nessie/src/main/java/org/apache/iceberg/nessie/NessieIcebergClient.java","lineNumber":534,"sourceCode":"      TableIdentifier from, TableIdentifier to, IcebergContent existingToContent) {\n    if (existingToContent != null) {\n      if (existingToContent.getType() == Content.Type.ICEBERG_VIEW) {\n        throw new AlreadyExistsException(\"Cannot rename %s to %s. View already exists\", from, to);\n      } else if (existingToContent.getType() == Content.Type.ICEBERG_TABLE) {\n        throw new AlreadyExistsException(\"Cannot rename %s to %s. Table already exists\", from, to);\n      } else {\n        throw new AlreadyExistsException(\n            \"Cannot rename %s to %s. Another content of type %s with same name already exists\",\n            from, to, existingToContent.getType());\n      }\n    }\n  }\n\n  private static void validateFromContentForRename(\n      TableIdentifier from, Content.Type type, IcebergContent existingFromContent) {\n    if (existingFromContent == null) {\n      if (type == Content.Type.ICEBERG_VIEW) {\n        throw new NoSuchViewException(\"View does not exist: %s\", from);\n      } else if (type == Content.Type.ICEBERG_TABLE) {\n        throw new NoSuchTableException(\"Table does not exist: %s\", from);\n      } else {\n        throw new RuntimeException(\"Cannot perform rename for content type: \" + type);\n      }\n    } else if (existingFromContent.getType() != type) {\n      throw new RuntimeException(\n          String.format(\"content type of from identifier %s should be of %s\", from, type));\n    }\n  }\n\n  public boolean dropTable(TableIdentifier identifier, boolean purge) {\n    return dropContent(identifier, purge, Content.Type.ICEBERG_TABLE);\n  }\n\n  public boolean dropView(TableIdentifier identifier, boolean purge) {\n    return dropContent(identifier, purge, Content.Type.ICEBERG_VIEW);\n  }","sourceCodeStart":516,"sourceCodeEnd":552,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/nessie/src/main/java/org/apache/iceberg/nessie/NessieIcebergClient.java#L516-L552","documentation":"Thrown by NessieIcebergClient.validateFromContentForRename when renaming an Iceberg view via the Nessie catalog but the source content cannot be fetched in Nessie (existingFromContent == null). The view simply does not exist under the requested reference. It surfaces as NoSuchViewException from a renameTable/renameView operation.","triggerScenarios":"Calling catalog.renameTable(from, to) or renameView where the from identifier points to a view path that does not exist on the current Nessie ref, e.g. wrong branch/tag, typo in identifier, or the view was already dropped.","commonSituations":"Developer renames a view while the Nessie client is pinned to a branch that doesn't contain it; concurrent job dropped the view before rename; namespace or view name misspelled in the Spark/Flink SQL statement.","solutions":["List contents on the current ref (catalog.listViews / listTables) to confirm the view exists before renaming.","Verify the Nessie ref (branch/tag) the client uses matches the branch where the view exists; use NessieCatalog.setRef or pass the right ref in catalog properties.","Fix the identifier spelling including namespace.","Handle NoSuchViewException in the caller and create the view first if that is intended."],"exampleFix":"// before\ncatalog.renameTable(TableIdentifier.of(\"ns\", \"my_veiw\"), TableIdentifier.of(\"ns\", \"my_view\"));\n// after\nTableIdentifier from = TableIdentifier.of(\"ns\", \"my_view\");\nif (!catalog.viewExists(from)) {\n  throw new IllegalStateException(\"View not found on current ref: \" + from);\n}\ncatalog.renameView(from, TableIdentifier.of(\"ns\", \"my_view2\"));","handlingStrategy":"validation","validationCode":"if (!catalog.viewExists(from)) { throw new IllegalStateException(\"View not found: \" + from); }","typeGuard":null,"tryCatchPattern":"try { catalog.renameView(from, to); } catch (NoSuchViewException e) { log.warn(\"View missing on current ref: {}\", e.getMessage()); }","preventionTips":["Always check viewExists on the same client/ref before rename","Keep catalog ref configuration explicit and versioned","Log the Nessie ref name in job start for debugging"],"tags":["nessie","view","rename","not-found","catalog"],"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-14T16:17:12.679Z"}