.A new bucket life-cycle policy will overwrite the existing life-cycle policy
Because of an encoding error with the Ceph Object Gateway, storing a new bucket life-cycle policy on a bucket that already had an existing one would fail. Previously, working around the failure was done by deleting the old policy first, before storing the new one. With this release, this encoding error was fixed.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHSA-2019:2538
Description of problem: Currently doing something like put LC; use a changed LC; put LC; get LC will return the first supplied LC unless there was a delete involved. Version-Release number of selected component (if applicable): How reproducible: When overwriting an existing lifecycle policy Steps to Reproduce: 1. Create two lifecycle policy files: (aws) [abhishekl@d18:~/spells/pyspells/s3]$ cat abortmp.json { "Rules": [ { "AbortIncompleteMultipartUpload" : { "DaysAfterInitiation": 7 }, "ID": "Expire v1 objects", "Prefix": "", "Status": "Enabled" } ] } (aws) [abhishekl@d18:~/spells/pyspells/s3]$ cat transition.json { "Rules": [ { "Transition" : { "Days": 10, "StorageClass": "rrs" }, "Expiration" : { "Days": 20 }, "ID": "Transition abc objects", "Status": "Enabled", "Prefix":"abc" }, { "Expiration" : { "Days": 10 }, "ID": "Expire bcd objects", "Status": "Enabled", "Prefix":"bcd" } ] } 2. Create a bucket and apply the first lifecycle policy: (aws) [abhishekl@d18:~/spells/pyspells/s3]$ aws s3api create-bucket --bucket test --endpoint=http://localhost:8000 (aws) [abhishekl@d18:~/spells/pyspells/s3]$ aws s3api put-bucket-lifecycle --bucket test --lifecycle-configuration file://transition.json (aws) [abhishekl@d18:~/spells/pyspells/s3]$ aws s3api get-bucket-lifecycle --bucket test { "Rules": [ { "Status": "Enabled", "Prefix": "bcd", "Expiration": { "Days": 10 }, "ID": "Expire bcd objects" }, { "Status": "Enabled", "Prefix": "abc", "Transition": { "Days": 10, "StorageClass": "rrs" }, "Expiration": { "Days": 20 }, "ID": "Transition abc objects" } ] } 3. Apply the second lifecycle policy: (aws) [abhishekl@d18:~/spells/pyspells/s3]$ aws s3api put-bucket-lifecycle --bucket test --lifecycle-configuration file://abortmp.json 4. Fetch the lifecycle policy: (aws) [abhishekl@d18:~/spells/pyspells/s3]$ aws s3api get-bucket-lifecycle --bucket test { "Rules": [ { "Status": "Enabled", "Prefix": "bcd", "Expiration": { "Days": 10 }, "ID": "Expire bcd objects" }, { "Status": "Enabled", "Prefix": "abc", "Transition": { "Days": 10, "StorageClass": "rrs" }, "Expiration": { "Days": 20 }, "ID": "Transition abc objects" } ] } Actual results: Fetched policy corresponds to the first lifecycle policy. Expected results: Fetched policy corresponds to the second lifecycle policy. Additional info: