{"record":{"id":"31aa237462d9bb96","repo":"apache/iceberg","slug":"cannot-find-table-s-after-refresh-maybe-another","errorCode":null,"errorMessage":"Cannot find table %s after refresh, maybe another process deleted it or revoked your access permission","messagePattern":"Cannot find table (.+?) after refresh, maybe another process deleted it or revoked your access permission","errorType":"exception","errorClass":"NoSuchTableException","httpStatus":404,"severity":"error","filePath":"aws/src/main/java/org/apache/iceberg/aws/dynamodb/DynamoDbTableOperations.java","lineNumber":94,"sourceCode":"  public FileIO io() {\n    return fileIO;\n  }\n\n  @Override\n  protected void doRefresh() {\n    String metadataLocation = null;\n    GetItemResponse table =\n        dynamo.getItem(\n            GetItemRequest.builder()\n                .tableName(awsProperties.dynamoDbTableName())\n                .consistentRead(true)\n                .key(DynamoDbCatalog.tablePrimaryKey(tableIdentifier))\n                .build());\n    if (table.hasItem()) {\n      metadataLocation = getMetadataLocation(table);\n    } else {\n      if (currentMetadataLocation() != null) {\n        throw new NoSuchTableException(\n            \"Cannot find table %s after refresh, \"\n                + \"maybe another process deleted it or revoked your access permission\",\n            tableName());\n      }\n    }\n\n    refreshFromMetadataLocation(metadataLocation);\n  }\n\n  @Override\n  protected void doCommit(TableMetadata base, TableMetadata metadata) {\n    boolean newTable = base == null;\n    String newMetadataLocation = writeNewMetadataIfRequired(newTable, metadata);\n    CommitStatus commitStatus = CommitStatus.FAILURE;\n    RetryDetector retryDetector = new RetryDetector();\n    Map<String, AttributeValue> tableKey = DynamoDbCatalog.tablePrimaryKey(tableIdentifier);\n    try {\n      GetItemResponse table =","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/aws/src/main/java/org/apache/iceberg/aws/dynamodb/DynamoDbTableOperations.java#L76-L112","documentation":"NoSuchTableException thrown in DynamoDbTableOperations.doRefresh when the table item is gone from the Dynamo catalog table but the client previously knew a metadata location. The table existed when this Table was opened but has since disappeared, so refresh cannot proceed.","triggerScenarios":"Refreshing a table whose Dynamo item was deleted between commit/refresh cycles while currentMetadataLocation() != null.","commonSituations":"Another process or user ran dropTable concurrently; IAM permissions were revoked so the GetItem returns no item is not the case here (it would throw) — rather the item was genuinely removed; environment sharing the same Dynamo table with an admin cleaning it up.","solutions":["Re-create the table or re-open it via a fresh catalog.loadTable after confirming it should exist","Coordinate with whoever dropped the table; check CloudTrail/audit logs for DeleteItem on the catalog table","Ensure only one admin pipeline manages table lifecycle to avoid concurrent drops"],"exampleFix":"// before\nTable t = catalog.loadTable(id);\nt.refresh(); // fails if table was dropped\n// after\nTable t;\ntry {\n  t = catalog.loadTable(id);\n  t.refresh();\n} catch (NoSuchTableException e) {\n  t = catalog.createTable(id, schema); // recreate or handle absence\n}","handlingStrategy":"try-catch","validationCode":"if (!catalog.tableExists(tableIdentifier)) {\n  // table gone; recreate or reroute before loadTable/refresh\n}","typeGuard":null,"tryCatchPattern":"try {\n  table.refresh();\n} catch (NoSuchTableException e) {\n  LOG.warn(\"Table {} was deleted externally\", table.name());\n  // recreate or fail the job gracefully\n}","preventionTips":["Avoid concurrent drop pipelines and writers on the same table","Monitor table lifecycle events (CloudTrail) in shared environments","Use idempotent job logic that tolerates missing tables"],"tags":["aws","dynamodb","catalog","table-deleted"],"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"}