0014-00000012

Updated at:

Problem description

In the XML request body of the PutBucketLifecycle request, the root node is invalid.

Causes

You initiated a PutBucketLifecycle request, but the root node in the XML request body is not LifecycleConfiguration as required, which causes a request error.

Examples

In the following sample request, the root node in the XML body is Lifecycle instead of the required LifecycleConfiguration.

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"?>
<Lifecycle>
  <Rule>
    <ID>rule</ID>
    <Prefix>log/</Prefix>
    <Status>Enabled</Status>
    <Transition>
      <Days>30</Days>
      <StorageClass>IA</StorageClass>
    </Transition>    
  </Rule>
</Lifecycle>

Solutions

  • Set the root node in the XML request body to LifecycleConfiguration.

    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, which automatically generates valid request bodies.

References