[
https://issues.apache.org/jira/browse/HDDS-15950?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
ASF GitHub Bot updated HDDS-15950:
----------------------------------
Labels: pull-request-available (was: )
> S3 Gateway GetBucketLifecycleConfiguration throws NullPointerException when
> expiration uses Date or DaysAfterInitiation is absent
> ---------------------------------------------------------------------------------------------------------------------------------
>
> Key: HDDS-15950
> URL: https://issues.apache.org/jira/browse/HDDS-15950
> Project: Apache Ozone
> Issue Type: Sub-task
> Components: S3
> Reporter: Priyesh Karatha
> Assignee: Priyesh Karatha
> Priority: Major
> Labels: pull-request-available
>
> {{S3LifecycleConfiguration.convertFromOzoneExpiration()}} calls
> {{ozoneExpiration.getDays() > 0}} (line 482). However,
> {{OzoneLifecycleConfiguration.OzoneLCExpiration.getDays()}} returns a
> nullable {{{}Integer{}}}. For lifecycle rules that specify an expiration date
> instead of a {{Days}} value, {{getDays()}} returns {{{}null{}}}. The
> subsequent comparison triggers auto-unboxing, resulting in a
> {{NullPointerException}} that propagates to the client as an HTTP 500
> response.
> A similar issue exists in
> {{convertFromOzoneAbortIncompleteMultipartUpload()}} (line 500), where
> {{getDaysAfterInitiation()}} also returns a nullable {{Integer}} but is
> compared without a null check, making it susceptible to the same
> {{{}NullPointerException{}}}.
> There are currently no tests covering the GET lifecycle code path for rules
> that use date-based expiration. As a result, this bug was not detected by the
> existing test suite.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]