{"record":{"id":"f435d072b6d1ccf3","repo":"apache/iceberg","slug":"cannot-rename-table-because-table-s-does-not-exis","errorCode":null,"errorMessage":"Cannot rename table because table %s does not exist","messagePattern":"Cannot rename table because table (.+?) does not exist","errorType":"exception","errorClass":"NoSuchTableException","httpStatus":404,"severity":"error","filePath":"dell/src/main/java/org/apache/iceberg/dell/ecs/EcsCatalog.java","lineNumber":250,"sourceCode":"   *\n   * @param from identifier of the table to rename\n   * @param to new table name\n   */\n  @Override\n  public void renameTable(TableIdentifier from, TableIdentifier to) {\n    if (!namespaceExists(to.namespace())) {\n      throw new NoSuchNamespaceException(\n          \"Cannot rename %s to %s because namespace %s does not exist\", from, to, to.namespace());\n    }\n\n    if (tableExists(to)) {\n      throw new AlreadyExistsException(\n          \"Cannot rename %s because destination table %s exists\", from, to);\n    }\n\n    EcsURI fromURI = tableURI(from);\n    if (!objectMetadata(fromURI).isPresent()) {\n      throw new NoSuchTableException(\"Cannot rename table because table %s does not exist\", from);\n    }\n\n    Properties properties = loadProperties(fromURI);\n    EcsURI toURI = tableURI(to);\n\n    if (!putNewProperties(toURI, properties.content())) {\n      throw new AlreadyExistsException(\n          \"Cannot rename %s because destination table %s exists\", from, to);\n    }\n\n    client.deleteObject(fromURI.bucket(), fromURI.name());\n    LOG.info(\"Rename table {} to {}\", from, to);\n  }\n\n  @Override\n  public void createNamespace(Namespace namespace, Map<String, String> properties) {\n    EcsURI namespaceObject = namespaceURI(namespace);\n    if (!putNewProperties(namespaceObject, properties)) {","sourceCodeStart":232,"sourceCodeEnd":268,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/dell/src/main/java/org/apache/iceberg/dell/ecs/EcsCatalog.java#L232-L268","documentation":"Guard in EcsCatalog.renameTable: after verifying the destination namespace exists and the destination table does not, the source table's ECS object metadata was not found — the table being renamed does not exist. The %s is the source TableIdentifier; the rename aborts before any ECS mutation.","triggerScenarios":"Calling catalog.renameTable(from, to) where objectMetadata(tableURI(from)) returns empty — the source table was dropped, never created, or the identifier doesn't match the stored prefix.","commonSituations":"Renaming a table after it was dropped by another process; stale catalog caches pointing to removed objects; case/spelling mismatch in the source identifier.","solutions":["Verify the source table exists with catalog.tableExists(from) before renaming.","Correct the source table identifier (case-sensitive namespace/table levels).","Re-create the table if it was deleted unintentionally."],"exampleFix":"// before\ncatalog.renameTable(from, to);\n// after\nif (!catalog.tableExists(from)) {\n  throw new IllegalStateException(\"Source table missing: \" + from);\n}\ncatalog.renameTable(from, to);","handlingStrategy":"validation","validationCode":"if (!catalog.tableExists(from)) { throw new IllegalStateException(\"Source missing: \" + from); }","typeGuard":null,"tryCatchPattern":"try {\n  catalog.renameTable(from, to);\n} catch (NoSuchTableException e) {\n  LOG.error(\"Source table {} no longer exists\", from, e);\n}","preventionTips":["Confirm the source table exists in the same catalog instance","Avoid renaming tables owned by other processes","Use exact (case-sensitive) identifiers"],"tags":["dell","ecs","catalog","rename"],"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-14T16:17:12.679Z"}