{"record":{"id":"9e509c43decab6f9","repo":"apache/iceberg","slug":"failed-to-load-table-metadata-for-table-conti-9e509c","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/glue/GlueCatalog.java","lineNumber":361,"sourceCode":"    return results;\n  }\n\n  private boolean isGlueIcebergTable(Table table) {\n    return table.parameters() != null\n        && BaseMetastoreTableOperations.ICEBERG_TABLE_TYPE_VALUE.equalsIgnoreCase(\n            table.parameters().get(BaseMetastoreTableOperations.TABLE_TYPE_PROP));\n  }\n\n  @Override\n  public boolean dropTable(TableIdentifier identifier, boolean purge) {\n    try {\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      glue.deleteTable(\n          DeleteTableRequest.builder()\n              .catalogId(awsProperties.glueCatalogId())\n              .databaseName(\n                  IcebergToGlueConverter.getDatabaseName(\n                      identifier, awsProperties.glueCatalogSkipNameValidation()))\n              .name(identifier.name())\n              .build());\n      LOG.info(\"Successfully dropped table {} from Glue\", identifier);\n      if (purge && lastMetadata != null) {\n        CatalogUtil.dropTableData(ops.io(), lastMetadata);\n        LOG.info(\"Glue table {} data purged\", identifier);\n      }","sourceCodeStart":343,"sourceCodeEnd":379,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/aws/src/main/java/org/apache/iceberg/aws/glue/GlueCatalog.java#L343-L379","documentation":"Same pattern as the DynamoDB catalog: GlueCatalog.dropTable with purge=true failed to load the table's last metadata (NotFoundException from the table's TableOperations), logs this warning, and continues dropping the Glue table without deleting its data/manifest files. The table disappears from the catalog but files remain in object storage.","triggerScenarios":"dropTable(identifier, purge=true) when the Glue table's metadata location is unreadable or already deleted — e.g. metadata JSON removed from S3, wrong S3 endpoint/region config, or leftover Glue entry whose metadata was cleaned earlier.","commonSituations":"Cleanup scripts that deleted metadata files before dropping the catalog entry; cross-account S3 access problems making the metadata unreadable; re-running a partially failed drop where data files were already purged but the Glue record remained.","solutions":["Verify the table's metadata location in S3 is readable with the configured FileIO (credentials, region, endpoint) before dropping","If data files matter, run RemoveOrphanFiles after the drop to reclaim orphans","Use purge=false when you only want to remove the catalog entry","Re-create or restore the missing metadata JSON if you need a clean purge"],"exampleFix":"// before\ncatalog.dropTable(identifier, true); // metadata unreadable -> purge skipped\n// after\nTable table = catalog.loadTable(identifier); // verify loadable\n// delete via Spark: CALL iceberg.system.remove_orphan_files(...)\ncatalog.dropTable(identifier, true);","handlingStrategy":"fallback","validationCode":"// confirm the Glue table's metadata location is readable\nString loc = glue.getTable(...).table().parameters().get(\"metadata_location\");\nfileIO.newInputFile(loc).exists(); // false -> purge will be skipped","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never delete metadata JSONs before dropping the catalog entry","Validate S3 access (region, credentials, endpoint) for the warehouse prefix","Schedule RemoveOrphanFiles to clean up after skipped purges","Prefer purge=false for metadata-only cleanup"],"tags":["aws","glue","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"}