{"record":{"id":"35af26da423ccc5e","repo":"apache/iceberg","slug":"cannot-commit-s-because-glue-cannot-find-the-requ","errorCode":null,"errorMessage":"Cannot commit %s because Glue cannot find the requested entity","messagePattern":"Cannot commit (.+?) because Glue cannot find the requested entity","errorType":"exception","errorClass":"NotFoundException","httpStatus":null,"severity":"error","filePath":"aws/src/main/java/org/apache/iceberg/aws/glue/GlueTableOperations.java","lineNumber":364,"sourceCode":"                      .tableType(GLUE_EXTERNAL_TABLE_TYPE)\n                      .parameters(parameters)\n                      .build())\n              .build());\n    }\n  }\n\n  private void handleAWSExceptions(AwsServiceException persistFailure) {\n    if (persistFailure instanceof ConcurrentModificationException) {\n      throw new CommitFailedException(\n          persistFailure, \"Cannot commit %s because Glue detected concurrent update\", tableName());\n    } else if (persistFailure\n        instanceof software.amazon.awssdk.services.glue.model.AlreadyExistsException) {\n      throw new AlreadyExistsException(\n          persistFailure,\n          \"Cannot commit %s because its Glue table already exists when trying to create one\",\n          tableName());\n    } else if (persistFailure instanceof EntityNotFoundException) {\n      throw new NotFoundException(\n          persistFailure,\n          \"Cannot commit %s because Glue cannot find the requested entity\",\n          tableName());\n    } else if (persistFailure instanceof AccessDeniedException) {\n      throw new ForbiddenException(\n          persistFailure,\n          \"Cannot commit %s because Glue cannot access the requested resources\",\n          tableName());\n    } else if (persistFailure\n        instanceof software.amazon.awssdk.services.glue.model.ValidationException) {\n      throw new ValidationException(\n          persistFailure,\n          \"Cannot commit %s because Glue encountered a validation exception \"\n              + \"while accessing requested resources\",\n          tableName());\n    } else {\n      int statusCode = persistFailure.statusCode();\n      if (statusCode < 500 || statusCode >= 600) {","sourceCodeStart":346,"sourceCodeEnd":382,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/aws/src/main/java/org/apache/iceberg/aws/glue/GlueTableOperations.java#L346-L382","documentation":"NotFoundException thrown by GlueTableOperations.handleAWSExceptions when the Glue API raises EntityNotFoundException during a commit. Glue could not find the table (or its database) that the operation targets — the Glue-side entry the Iceberg commit depends on is missing. Mapped to Iceberg's NotFoundException so callers can distinguish it from retryable commit failures.","triggerScenarios":"doCommit → persistGlueTable → glue.updateTable/getTable raises EntityNotFoundException because the Glue table was deleted (or never created) in the target database/region/account.","commonSituations":"Another process or user dropped the Glue table while a job was running; wrong database name or AWS region/account configuration so the table genuinely doesn't exist there; the table exists in a different Glue catalog (account ID) than the one configured; cleanup jobs deleting tables under active writers.","solutions":["Verify the Glue table exists: aws glue get-table --database-name <db> --name <table> in the configured region/account.","Check your s3.catalog/glue endpoint, region, and catalog ID configuration — a mismatch makes existing tables look missing.","Re-register the table with catalog.registerTable(identifier, metadataLocation) if the Glue entry was accidentally deleted but the metadata files still exist in S3.","Stop cleanup/GC jobs from dropping tables that active writers are committing to."],"exampleFix":"// before\ncatalog.loadTable(identifier); // NotFoundException: Glue table was dropped externally\n// after\nif (!catalog.tableExists(identifier)) {\n  catalog.registerTable(identifier, \"s3://bucket/warehouse/db/table/metadata/00001-uuid.metadata.json\");\n}\nTable table = catalog.loadTable(identifier);","handlingStrategy":"validation","validationCode":"boolean exists = catalog.tableExists(identifier);\nif (!exists) {\n  // aws glue get-table --database-name <db> --name <table> to confirm\n}","typeGuard":null,"tryCatchPattern":"try {\n  Table t = catalog.loadTable(identifier);\n} catch (NotFoundException e) {\n  // re-register from metadata location or create fresh\n}","preventionTips":["Confirm Glue region, account, and catalog ID configuration match where the table lives","Prevent cleanup jobs from dropping tables under active writers","Keep S3 metadata files to allow registerTable recovery","Validate database and table names/identifiers in job configuration"],"tags":["aws","glue","commit","entity-not-found"],"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"}