Skip to content

HDDS-16372. Surface OM's detailed message for rejected lifecycle configuration - #11189

Open
priyeshkaratha wants to merge 1 commit into
apache:masterfrom
priyeshkaratha:HDDS-16372
Open

HDDS-16372. Surface OM's detailed message for rejected lifecycle configuration#11189
priyeshkaratha wants to merge 1 commit into
apache:masterfrom
priyeshkaratha:HDDS-16372

Conversation

@priyeshkaratha

Copy link
Copy Markdown
Member

What changes were proposed in this pull request?

PutBucketLifecycleConfiguration was returning only the generic "Invalid Request" message for any lifecycle configuration rejected by OM — for example, a lifecycle rule with an Expiration.Date in the past — with no indication of why the request was rejected.

BucketLifecycleHandler.putBucketLifecycleConfiguration() catches OMException from both the client-side rule validation and the ozoneBucket.setLifecycleConfiguration(...) RPC call, and rethrows it as an OS3Exception via S3ErrorTable.newError(...). However, OS3Exception's constructor always sets errorMessage to the static generic S3ErrorTable text and never copies the underlying cause's message, so OM's specific validation detail (e.g. "Invalid lifecycle configuration: 'Date' must be in the future ...") never reached the client.

This chains .withMessage(ex.getMessage()) onto the OS3Exception at all three S3ErrorTable.newError(...) call sites in putBucketLifecycleConfiguration(), matching the existing pattern already used in MessageUnmarshaller and CompleteMultipartUploadRequestUnmarshaller for the same purpose.

What is the link to the Apache JIRA

HDDS-16372

How was this patch tested?

Tested using added test cases.

@priyeshkaratha
priyeshkaratha marked this pull request as ready for review September 2, 2026 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant