Problem description
Duplicate rule IDs are specified in the XML request body of the PutBucketLifecycle request.
Causes
You initiated a PutBucketLifecycle request, but duplicate rule IDs are specified in the XML request body.
Examples
In the following sample code, two rules are specified in the XML request body, and the rule IDs are both abc. In this case, a request error occurs.
PUT /?lifecycle HTTP/1.1
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Content-Length: 336
Date: Mon , 6 May 2019 15:23:20 GMT
Authorization: OSS qn6q**************:77Dv****************
<?xml version="1.0" encoding="UTF-8"?>
<LifecycleConfiguration>
<Rule>
<ID>abc</ID>
<Prefix>log/</Prefix>
<Status>Enabled</Status>
<Transition>
<Days>30</Days>
<StorageClass>IA</StorageClass>
<IsAccessTime>true</IsAccessTime>
</Transition>
</Rule>
<Rule>
<ID>abc</ID>
<Prefix>test/</Prefix>
<Status>Enabled</Status>
<Transition>
<Days>30</Days>
<StorageClass>IA</StorageClass>
</Transition>
</Rule>
</LifecycleConfiguration>
Solutions
You can specify multiple rules in a PutBucketLifecycle request, but the ID of each rule must be unique. The ID parameter specifies the unique ID of a lifecycle rule, and the parameter value can be up to 255 characters in length. If you do not specify ID or you leave ID empty, Object Storage Service (OSS) automatically generates a unique ID for the lifecycle rule.
Configure lifecycle rules in the OSS console to automatically create request bodies.