apache/iceberg · error · NotFoundException

Cannot commit %s because Glue cannot find the requested enti

Error message

Cannot commit %s because Glue cannot find the requested entity

What it means

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.

Source

Thrown at aws/src/main/java/org/apache/iceberg/aws/glue/GlueTableOperations.java:364

                      .tableType(GLUE_EXTERNAL_TABLE_TYPE)
                      .parameters(parameters)
                      .build())
              .build());
    }
  }

  private void handleAWSExceptions(AwsServiceException persistFailure) {
    if (persistFailure instanceof ConcurrentModificationException) {
      throw new CommitFailedException(
          persistFailure, "Cannot commit %s because Glue detected concurrent update", tableName());
    } else if (persistFailure
        instanceof software.amazon.awssdk.services.glue.model.AlreadyExistsException) {
      throw new AlreadyExistsException(
          persistFailure,
          "Cannot commit %s because its Glue table already exists when trying to create one",
          tableName());
    } else if (persistFailure instanceof EntityNotFoundException) {
      throw new NotFoundException(
          persistFailure,
          "Cannot commit %s because Glue cannot find the requested entity",
          tableName());
    } else if (persistFailure instanceof AccessDeniedException) {
      throw new ForbiddenException(
          persistFailure,
          "Cannot commit %s because Glue cannot access the requested resources",
          tableName());
    } else if (persistFailure
        instanceof software.amazon.awssdk.services.glue.model.ValidationException) {
      throw new ValidationException(
          persistFailure,
          "Cannot commit %s because Glue encountered a validation exception "
              + "while accessing requested resources",
          tableName());
    } else {
      int statusCode = persistFailure.statusCode();
      if (statusCode < 500 || statusCode >= 600) {

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Verify the Glue table exists: aws glue get-table --database-name <db> --name <table> in the configured region/account.
  2. Check your s3.catalog/glue endpoint, region, and catalog ID configuration — a mismatch makes existing tables look missing.
  3. Re-register the table with catalog.registerTable(identifier, metadataLocation) if the Glue entry was accidentally deleted but the metadata files still exist in S3.
  4. Stop cleanup/GC jobs from dropping tables that active writers are committing to.

Example fix

// before
catalog.loadTable(identifier); // NotFoundException: Glue table was dropped externally
// after
if (!catalog.tableExists(identifier)) {
  catalog.registerTable(identifier, "s3://bucket/warehouse/db/table/metadata/00001-uuid.metadata.json");
}
Table table = catalog.loadTable(identifier);
Defensive patterns

Strategy: validation

Validate before calling

boolean exists = catalog.tableExists(identifier);
if (!exists) {
  // aws glue get-table --database-name <db> --name <table> to confirm
}

Try / catch

try {
  Table t = catalog.loadTable(identifier);
} catch (NotFoundException e) {
  // re-register from metadata location or create fresh
}

Prevention

When it happens

Trigger: doCommit → persistGlueTable → glue.updateTable/getTable raises EntityNotFoundException because the Glue table was deleted (or never created) in the target database/region/account.

Common situations: 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.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12). Data as JSON: /api/errors/35af26da423ccc5e. Report an issue: GitHub.