Problem description
The XML request body of the PutBucketLifecycle request contains the Filter/Not node, and the value of the Tag child node in the Filter/Not node is the same as the value of the Tag child node in the Rule node.
Causes
In the XML request body of the PutBucketLifecycle request, the value of the Tag child node in the Filter/Not node is the same as the value of the Tag child node in the Rule node. In this case, a request error occurs.
Examples
In the following sample code, the Filter/Not node contains the Tag child node, and the value of the child node is key1:value1. The Rule node contains two Tag child nodes. The values of the child nodes are key1:value1 and key2:value2. Duplicate values are specified for the Tag child nodes in the Filter/Not and Rule nodes.
PUT /?lifecycle HTTP/1.1
Host: oss-example.oss.aliyuncs.com
Content-Length: 336
Date: Mon , 6 May 2019 15:23:20 GMT
Authorization: OSSWnjl3fg9fdv8fg4b****:Phuu8bBhS8dsff2a****
<?xml version="1.0" encoding="UTF-8"?>
<LifecycleConfiguration>
<Rule>
<ID>rule</ID>
<Prefix>test</Prefix>
<Status>Enabled</Status>
<Tag><Key>key1</Key><Value>value1</Value></Tag>
<Tag><Key>key2</Key><Value>value2</Value></Tag>
<Filter>
<Not>
<Prefix>test</Prefix>
<Tag><Key>key1</Key><Value>value1</Value></Tag>
</Not>
</Filter>
<Expiration>
<Days>100</Days>
</Expiration>
</Rule>
</LifecycleConfiguration>Solutions
Make sure that the value of the
Tagchild node in theFilter/Notnode is different from the value of theTagchild node in theRulenode.Configure lifecycle rules in the Object Storage Service (OSS) console to automatically create request bodies.