Actions
Bug #47167
closedrgw: lifecycle: Days can not be 0 for Expiration rules
% Done:
0%
Source:
Community (user)
Tags:
Backport:
nautilus
Regression:
No
Severity:
3 - minor
Reviewed:
Description
Hi RGW team,
Nautilus 14.2.11.
I can apply next rule:
aws s3api get-bucket-lifecycle-configuration --bucket test-cc45ce9b-43c8-4e28-8a9a-a9d3ad0a2652
{
"Rules": [
{
"Status": "Enabled",
"Prefix": "",
"Expiration": {
"Days": 0
},
"ID": "remove old objects"
}
]
}
But in AWS s3:
aws s3api put-bucket-lifecycle-configuration --lifecycle-configuration file://~/ownCloud/ownCloud-tmp/s3-example/lc_by_days.json --bucket test-fatruden
An error occurred (InvalidArgument) when calling the PutBucketLifecycleConfiguration operation: 'Days' for Expiration action must be a positive integer
In Luminous 12.2.12 we couldn't apply this rule. Validation worked fine on Luminous.
I think it was changed in this issue: https://tracker.ceph.com/issues/38389
But it's not correct.
There are two type of lifecycle rules:
1. Expiration rules (removing objects)
2. Transition rules (moving objects to another storage class)
For Expiration rules AWS s3 doesn't allow Days=0, for Transition rules it's possible to specify Days=0.
You can read about it in https://docs.aws.amazon.com/AmazonS3/latest/dev/lifecycle-configuration-examples.html
And you can reproduce it with AWS S3 and awscli.
Actions