All Products
Search
Document Center

Object Storage Service:0014-00000050

Last Updated:Apr 28, 2024

Problem description

The Transition node in the XML request body of a PutBucketLifecycle request contains both Days and CreatedBeforeDate child nodes.

Causes

The request body of a PutBucketLifecycle request cannot contain both Days and CreatedBeforeDate child nodes.

Examples

The following sample code provides an example of the XML request body of a PutBucketLifecycle request. In this example, both Days and CreatedBeforeDate child nodes are specified. As a result, 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>rule</ID>
    <Prefix>test</Prefix>
    <Status>Enabled</Status>
    <Transition>
    	<Days>200</Days>
      <CreatedBeforeDate>2021-12-30T00:00:00.000Z</CreatedBeforeDate>
      <StorageClass>IA</StorageClass>
    </Transition>
  </Rule>
</LifecycleConfiguration>

Solutions

  • Make sure that you specify only one of the Days and CreatedBeforeDate child nodes in the Transition node of the XML request body.

  • Configure lifecycle rules in the Object Storage Service (OSS) console to prevent errors caused by manual construction of request bodies.

References