All Products
Search
Document Center

Object Storage Service:0014-00000031

Last Updated:Apr 28, 2024

Problem description

In the XML request body of the PutBucketLifecycle request, the value of the Key parameter in the Tag node contains an invalid character.

Causes

You initiated a PutBucketLifecycle request, but the value of the Key parameter in the Tag node in the XML request body is invalid. In this case, a request error occurs.

Examples

In the following sample code, the value of the Key parameter in the Tag node is test#. The value contains the number sign (#) that is an invalid character.

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>abc</ID>
    <Status>Enabled</Status>
    <Prefix>log/</Prefix>
    <Tag>
    	<Key>test#</Key>
      <Value>abc</Value>
    </Tag>
    <Expiration>
    	<Days>30</Days>
    </Expiration>
  </Rule>
</LifecycleConfiguration>

Solutions

  • Make sure that the value of the Key parameter in the Tag node in the XML request body is valid. The value of the Key parameter can contain letters, digits, spaces, and the following special characters:

    +-=._:/

    The following section provides an example of a valid request:

    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>abc</ID>
        <Status>Enabled</Status>
        <Prefix>log/</Prefix>
        <Tag>
        	<Key>test</Key>
          <Value>abc</Value>
        </Tag>    
        <Expiration>
        	<Days>30</Days>
        </Expiration>
      </Rule>
    </LifecycleConfiguration>
  • Configure lifecycle rules in the Object Storage Service (OSS) console to automatically create request bodies.

References