0014-00000087

Updated at:

Problem description

An invalid value is specified for the CreatedBeforeDate node in the XML request body of a PutBucketLifecycle request.

Causes

A PutBucketLifecycle request fails if the value of the CreatedBeforeDate node in the XML request body does not meet the API specification. This node specifies a date. Object Storage Service (OSS) applies the lifecycle rule to objects that were last modified before this date. The date must be in the yyyy-MM-ddT00:00:00.000Z format, follow the ISO 8601 standard, be in UTC, and be set to midnight (00:00:00).

Examples

In the following request, the value of the CreatedBeforeDate node is 2022-12-08, which does not meet the format requirements.

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>
    	<CreatedBeforeDate>2022-12-08</CreatedBeforeDate>
    </Expiration>
  </Rule>
</LifecycleConfiguration>

Solutions

  • Ensure that the value of the CreatedBeforeDate node in the XML request body is in the correct format.

    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>
        	<CreatedBeforeDate>2021-12-30T00:00:00.000Z</CreatedBeforeDate>
        </Expiration>
      </Rule>
    </LifecycleConfiguration>
  • You can configure lifecycle rules in the OSS console to avoid manually constructing the request body.

References