0014-00000031
Updated at:
Problem description
The value of the Key child node in the Tag node of the PutBucketLifecycle request body contains an invalid character.
Cause
A PutBucketLifecycle request fails because the value of the Key child node in the Tag node of the request body is invalid.
Examples
In the following request, the value of the Key child node in the Tag node is test#. The value contains the 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
Ensure that the value of the
Keychild node in theTagnode is valid. The value can contain uppercase letters, lowercase letters, digits, spaces, and the following symbols:+‑=._:/The following code 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 OSS console to avoid manually constructing the request body.
References
For more information, see Lifecycle rule overview.
Is this page helpful?