[ 
https://issues.apache.org/jira/browse/HDDS-16584?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Prince Raj reassigned HDDS-16584:
---------------------------------

    Assignee: Priyesh Karatha

> Object TTL configuration returns generic 400 error for past expiration date
> ---------------------------------------------------------------------------
>
>                 Key: HDDS-16584
>                 URL: https://issues.apache.org/jira/browse/HDDS-16584
>             Project: Apache Ozone
>          Issue Type: Bug
>            Reporter: Prince Raj
>            Assignee: Priyesh Karatha
>            Priority: Major
>
> h3. Description
> While testing S3 bucket lifecycle configuration, I observed that providing an 
> expiration date in the past results in an HTTP 400 error, but the response 
> does not provide a meaningful error message explaining that the lifecycle 
> date is invalid because it is in the past.
> The API should provide a clear validation error explaining why the lifecycle 
> configuration was rejected.
> h3. Steps to Reproduce
>  # Create a lifecycle configuration with an expiration date in the past.
>  
> {{{
>   "Rules": [\{
>     "ID": "expire-key1-fso",
>     "Status": "Enabled",
>     "Filter": {
>       "Prefix": "key1/"
>     },
>     "Expiration": \{
>       "Date": "2020-01-01T00:00:00Z"
>     }
>   }]
> }}}
>  # Apply the lifecycle configuration:
>  
> {{aws s3api put-bucket-lifecycle-configuration \
>   --bucket <bucket-name> \
>   --lifecycle-configuration file://lifecycle.json}}
>  # Observe the response.
> h3. Actual Result
> The request fails with {*}HTTP 400 / InvalidRequest{*}, but the response only 
> contains a generic error:
>  
> {{An error occurred (InvalidRequest) when calling the 
> PutBucketLifecycleConfiguration operation: Invalid Request}}
> There is no indication that the expiration date is rejected because it is in 
> the past.
> h3. Expected Result
> The API should reject the invalid lifecycle configuration with a meaningful 
> validation error that clearly indicates the reason for rejection, for example 
> that the supplied expiration date is in the past.
> This would make it easier for users to identify and correct invalid lifecycle 
> configurations.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to