apache/iceberg · error · ValidationException

Cannot commit because Glue encountered a validation…

Error message

Cannot commit %s because Glue encountered a validation exception while accessing requested resources

What it means

ValidationException thrown by GlueTableOperations.handleAWSExceptions when the Glue API itself rejects the commit request with Glue's ValidationException. This means the table update payload (parameters, storage descriptor, table type) was considered invalid by Glue — usually a malformed or conflicting table parameter set rather than a concurrency or permission problem.

Solutions

  1. Inspect the table properties being written (write.table-property defaults and table-level properties) and remove/rename values Glue rejects.
  2. Verify the Glue entry is a genuine Iceberg table (table_type=ICEBERG, metadata_location set); recreate it if it was replaced.
  3. Reduce the size/number of table properties if the request is oversized.
  4. Reproduce with aws glue update-table using the same payload to read Glue's detailed validation message.

Example fix

// before
table.updateProperties().set("iceberg.write.my.prop", "value with\nbad chars").commit(); // Glue ValidationException
// after
table.updateProperties().set("write.my.prop", "sanitized-value").commit(); // valid Glue parameter
Defensive patterns

Strategy: validation

Validate before calling

// validate table properties before commit
properties.forEach((k, v) -> {
  if (v.chars().anyMatch(c -> c < 0x20 || c > 0x7E)) {
    throw new IllegalArgumentException("Property value not Glue-safe: " + k);
  }
});

Try / catch

try {
  table.commit();
} catch (ValidationException e) {
  // inspect Glue's detailed message; do not blind-retry
  LOG.error("Glue rejected the table update payload", e);
}

Prevention

When it happens

Trigger: doCommit → persistGlueTable → glue.updateTable rejected with software.amazon.awssdk.services.glue.model.ValidationException, e.g. invalid parameter names/values in the Glue table parameters, oversized request, or an incompatible update to the existing Glue entry.

Common situations: Custom table properties containing characters or values Glue rejects; someone replaced the Iceberg Glue table entry with a non-Iceberg or foreign-format entry; very large parameter payloads; mismatch between table_type ICEBERG expectations and the stored Glue entry.

Related errors


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

Appendix: source

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

    } 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) {
        throw persistFailure;
      }
    }
  }

  @VisibleForTesting
  void cleanupMetadataAndUnlock(CommitStatus commitStatus, String metadataLocation) {
    try {
      if (commitStatus == CommitStatus.FAILURE
          && metadataLocation != null
          && !metadataLocation.isEmpty()) {

View on GitHub (pinned to 86d9c8fc54)