{"record":{"id":"344e41d86ffa41ad","repo":"apache/iceberg","slug":"cannot-commit-s-because-glue-encountered-a-valida","errorCode":null,"errorMessage":"Cannot commit %s because Glue encountered a validation exception while accessing requested resources","messagePattern":"Cannot commit (.+?) because Glue encountered a validation exception while accessing requested resources","errorType":"exception","errorClass":"ValidationException","httpStatus":null,"severity":"error","filePath":"aws/src/main/java/org/apache/iceberg/aws/glue/GlueTableOperations.java","lineNumber":375,"sourceCode":"    } 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) {\n        throw persistFailure;\n      }\n    }\n  }\n\n  @VisibleForTesting\n  void cleanupMetadataAndUnlock(CommitStatus commitStatus, String metadataLocation) {\n    try {\n      if (commitStatus == CommitStatus.FAILURE\n          && metadataLocation != null\n          && !metadataLocation.isEmpty()) {","sourceCodeStart":357,"sourceCodeEnd":393,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/aws/src/main/java/org/apache/iceberg/aws/glue/GlueTableOperations.java#L357-L393","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Inspect the table properties being written (write.table-property defaults and table-level properties) and remove/rename values Glue rejects.","Verify the Glue entry is a genuine Iceberg table (table_type=ICEBERG, metadata_location set); recreate it if it was replaced.","Reduce the size/number of table properties if the request is oversized.","Reproduce with aws glue update-table using the same payload to read Glue's detailed validation message."],"exampleFix":"// before\ntable.updateProperties().set(\"iceberg.write.my.prop\", \"value with\\nbad chars\").commit(); // Glue ValidationException\n// after\ntable.updateProperties().set(\"write.my.prop\", \"sanitized-value\").commit(); // valid Glue parameter","handlingStrategy":"validation","validationCode":"// validate table properties before commit\nproperties.forEach((k, v) -> {\n  if (v.chars().anyMatch(c -> c < 0x20 || c > 0x7E)) {\n    throw new IllegalArgumentException(\"Property value not Glue-safe: \" + k);\n  }\n});","typeGuard":null,"tryCatchPattern":"try {\n  table.commit();\n} catch (ValidationException e) {\n  // inspect Glue's detailed message; do not blind-retry\n  LOG.error(\"Glue rejected the table update payload\", e);\n}","preventionTips":["Keep table property names/values simple ASCII strings","Verify the Glue entry remains a valid ICEBERG-typed table","Limit number/size of table properties","Reproduce payloads with aws glue update-table to read detailed validation errors"],"tags":["aws","glue","commit","validation"],"backgroundTag":"api-error-response","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"}