{"record":{"id":"80625417ec961ef3","repo":"apache/iceberg","slug":"failed-to-load-table-metadata-for-table-conti","errorCode":null,"errorMessage":"Failed to load table metadata for table: {}, continuing drop without purge","messagePattern":"Failed to load table metadata for table: (.+?), continuing drop without purge","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"aws/src/main/java/org/apache/iceberg/aws/dynamodb/DynamoDbCatalog.java","lineNumber":396,"sourceCode":"      GetItemResponse response =\n          dynamo.getItem(\n              GetItemRequest.builder()\n                  .tableName(awsProperties.dynamoDbTableName())\n                  .consistentRead(true)\n                  .key(key)\n                  .build());\n\n      if (!response.hasItem()) {\n        throw new NoSuchTableException(\"Cannot find table %s to drop\", identifier);\n      }\n\n      TableOperations ops = newTableOps(identifier);\n      TableMetadata lastMetadata = null;\n      if (purge) {\n        try {\n          lastMetadata = ops.current();\n        } catch (NotFoundException e) {\n          LOG.warn(\n              \"Failed to load table metadata for table: {}, continuing drop without purge\",\n              identifier,\n              e);\n        }\n      }\n      dynamo.deleteItem(\n          DeleteItemRequest.builder()\n              .tableName(awsProperties.dynamoDbTableName())\n              .key(tablePrimaryKey(identifier))\n              .conditionExpression(COL_VERSION + \" = :v\")\n              .expressionAttributeValues(ImmutableMap.of(\":v\", response.item().get(COL_VERSION)))\n              .build());\n      LOG.info(\"Successfully dropped table {} from DynamoDb catalog\", identifier);\n\n      if (purge && lastMetadata != null) {\n        CatalogUtil.dropTableData(ops.io(), lastMetadata);\n        LOG.info(\"Table {} data purged\", identifier);\n      }","sourceCodeStart":378,"sourceCodeEnd":414,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/aws/src/main/java/org/apache/iceberg/aws/dynamodb/DynamoDbCatalog.java#L378-L414","documentation":"A warning from DynamoDbCatalog.dropTable: when purge=true the catalog tries to load the table's current metadata to delete the underlying data files, but TableOperations.current() threw NotFoundException. The catalog proceeds to delete the table's DynamoDB entry anyway, skipping the data-file purge, so orphan data files may remain in storage.","triggerScenarios":"Calling DynamoDbCatalog.dropTable(identifier, purge=true) when the DynamoDB record exists but its metadata location points to a missing/unreadable metadata JSON (e.g. metadata file already deleted in object storage, bad IO impl config, wrong warehouse path).","commonSituations":"Manual cleanup of metadata files before dropping the table; a partially deleted table from an earlier failed drop; misconfigured s3.file.io.region or credentials making the metadata file unresolvable and surfacing as NotFoundException.","solutions":["If the warning appears but you need a clean purge, restore/verify the metadata JSON is readable before dropping, or run an orphan-file cleanup (RemoveOrphanFiles) afterwards","Verify the FileIO configuration (credentials, region, endpoint) can read the metadata location","If you don't care about the data files, call dropTable with purge=false to make the intent explicit","Check that the DynamoDB record's metadata_location field points to an existing object"],"exampleFix":"// before\ncatalog.dropTable(TableIdentifier.of(\"db\", \"tbl\"), true); // warns, data files orphaned\n// after\nTable table = catalog.loadTable(TableIdentifier.of(\"db\", \"tbl\")); // fails fast if metadata unreadable\ntable.io() /* verify metadata accessible */;\ncatalog.dropTable(TableIdentifier.of(\"db\", \"tbl\"), true);\n// then schedule RemoveOrphanFiles for leftovers","handlingStrategy":"fallback","validationCode":"// verify metadata is loadable before purging\nTableMetadata meta;\ntry { meta = catalog.loadTable(identifier).operations().current(); }\ncatch (NotFoundException e) { /* purge will be skipped */ }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Load the table before dropping to confirm metadata is readable","Run RemoveOrphanFiles on a schedule to reclaim skipped-purge orphans","Keep FileIO credentials/region config valid for the metadata location","Use purge=false when you only want to unregister the table"],"tags":["aws","dynamodb","drop-table","purge"],"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"}