Problem description
In the XML request body of the PutBucketLifecycle request, the root node contains a child node other than Rule.
Causes
You initiated a PutBucketLifecycle request, but the LifecycleConfiguration root node in the XML request body contains a child node other than Rule. This does not meet the requirements of the PutBucketLifecycle request. In this case, an error is reported.
Examples
In the following sample code, the LifecycleConfiguration root node contains the UnknownNode child node in the XML request body. The child node is invalid.
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>rule</ID>
......
</Rule>
<UnknownNode>abc<UnknownNode/>
</LifecycleConfiguration>Solutions
Make sure that the XML request body in the PutBucketLifecycle request is valid.
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>rule</ID>
<Prefix>log/</Prefix>
<Status>Enabled</Status>
<Transition>
<Days>30</Days>
<StorageClass>IA</StorageClass>
</Transition>
</Rule>
</LifecycleConfiguration>Configure lifecycle rules in the Object Storage Service (OSS) console to automatically create request bodies.