{"record":{"id":"23b2e4795974a687","repo":"apache/iceberg","slug":"cannot-perform-rename-for-content-type","errorCode":null,"errorMessage":"Cannot perform rename for content type: ","messagePattern":"Cannot perform rename for content type: ","errorType":"exception","errorClass":"RuntimeException","httpStatus":500,"severity":"error","filePath":"nessie/src/main/java/org/apache/iceberg/nessie/NessieIcebergClient.java","lineNumber":538,"sourceCode":"      } 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  }\n\n  private boolean dropContent(TableIdentifier identifier, boolean purge, Content.Type type) {\n    getRef().checkMutable();\n","sourceCodeStart":520,"sourceCodeEnd":556,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/nessie/src/main/java/org/apache/iceberg/nessie/NessieIcebergClient.java#L520-L556","documentation":"A plain RuntimeException thrown when validateFromContentForRename receives a Content.Type that is neither ICEBERG_VIEW nor ICEBERG_TABLE. This is an internal guard: the Nessie rename path only supports renaming Iceberg tables and views. It indicates an unsupported/unknown Nessie content type was passed to the rename flow.","triggerScenarios":"renameContent invoked internally with a type other than ICEBERG_TABLE/ICEBERG_VIEW, e.g. when Nessie stores a new/unrecognized content kind (like DELTA or NAMESPACE) under the from identifier.","commonSituations":"A Nessie repo contains content written by a newer Nessie/other engine (e.g. Delta lake content) and an Iceberg rename is attempted on that identifier; internal misuse of NessieIcebergClient.","solutions":["Confirm the identifier actually refers to Iceberg content ( IcebergTable/IcebergView) via the Nessie API.","Upgrade the Iceberg-nessie modules if the content type is a newly added Nessie content type.","Rename non-Iceberg content with the appropriate tooling, not the Iceberg catalog."],"exampleFix":"// before\ncatalog.renameTable(TableIdentifier.of(\"ns\", \"delta_thing\"), TableIdentifier.of(\"ns\", \"renamed\")); // content is Delta\n// after\nContent c = nessieApi.content().key(NessieUtil.toKey(\"ns\", \"delta_thing\")).reference(ref).get().get(key);\nif (c.getType() == Content.Type.ICEBERG_TABLE) {\n  catalog.renameTable(TableIdentifier.of(\"ns\", \"delta_thing\"), TableIdentifier.of(\"ns\", \"renamed\"));\n}","handlingStrategy":"type-guard","validationCode":"Content c = nessieApi.content().key(key).reference(ref).get().get(key); boolean ok = c == null || c.getType() == Content.Type.ICEBERG_TABLE || c.getType() == Content.Type.ICEBERG_VIEW;","typeGuard":"boolean isIcebergContent(Content c) { return c != null && (c.getType() == Content.Type.ICEBERG_TABLE || c.getType() == Content.Type.ICEBERG_VIEW); }","tryCatchPattern":"try { renameContent(...); } catch (RuntimeException e) { if (e.getMessage().startsWith(\"Cannot perform rename\")) { /* unsupported content type */ } else { throw e; } }","preventionTips":["Only run Iceberg renames against identifiers known to hold Iceberg content","Keep iceberg-nessie and nessie-client versions aligned","Segregate Delta/other content into separate Nessie repos"],"tags":["nessie","rename","unsupported-content-type","internal"],"backgroundTag":"unsupported-operation","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"}