0014-00000085
Problem description
The request body of a PutBucketLifecycle request contains multiple rules that specify the same prefix.
Causes
A PutBucketLifecycle request fails if its request body contains multiple rules that specify the same prefix.
Example Problem
The following example shows a PutBucketLifecycle request that specifies two rules.
The first rule specifies the prefix
testand deletes matching objects 200 days after they are last modified.The second rule also specifies the prefix
testand transforms matching objects to the Infrequent Access (IA) storage class 100 days after they are last modified.
The request fails because both rules specify the same prefix.
PUT /?lifecycle HTTP/1.1
Host: oss-example.oss.aliyuncs.com
Content-Length: 336
Date: Mon , 6 May 2019 15:23:20 GMT
Authorization: OSSqn6q**************:77Dv****************
<?xml version="1.0" encoding="UTF-8"?>
<LifecycleConfiguration>
<Rule>
<ID>rule1</ID>
<Prefix>test</Prefix>
<Status>Enabled</Status>
<Expiration>
<Days>200</Days>
</Expiration>
</Rule>
<Rule>
<ID>rule2</ID>
<Prefix>test</Prefix>
<Status>Enabled</Status>
<Transition>
<Days>100</Days>
<StorageClass>IA</StorageClass>
</Transition>
</Rule>
</LifecycleConfiguration>
Solutions
To configure multiple lifecycle rules, ensure that the value of the
Prefixnode is unique for each rule.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>rule1</ID> <Prefix>test</Prefix> <Status>Enabled</Status> <Expiration> <Days>200</Days> </Expiration> </Rule> <Rule> <ID>rule2</ID> <Prefix>log</Prefix> <Status>Enabled</Status> <Transition> <Days>100</Days> <StorageClass>IA</StorageClass> </Transition> </Rule> </LifecycleConfiguration>You can configure lifecycle rules in the OSS console to avoid manually creating the request body.