All Products
Search
Document Center

Object Storage Service:0010-00000219

Last Updated:Apr 15, 2025

Problem description

The tag for an object is not in the "key" or "key=value" format, or the tag for a bucket does not meet the requirements.

Causes

You initiate a request in which you use the HTTP request header x-oss-tagging to pass tagging data, but the specified string is not in the "key" or "key=value" format.

Examples

In the following example request, the tagging data passed through x-oss-tagging is "aa=bb=cc", which is invalid.

PUT /test.txt HTTP/1.1
Host: test.oss-cn-zhangjiakou.aliyuncs.com
date: Tue, 04 Dec 2018 15:56:37 GMT
authorization: OSS LTAI****************:kZoY************************
x-oss-tagging: aa=bb=cc

Solutions

Make sure that the string specified by the request header x-oss-tagging is in the format of key1=value1&key2=value2.

The following code provides an example of a valid request.

PUT /test.txt HTTP/1.1
Host: test.oss-cn-zhangjiakou.aliyuncs.com
date: Tue, 04 Dec 2018 15:56:37 GMT
authorization: OSS LTAI****************:kZoY************************
x-oss-tagging: aaa=bbb&123=xyz

References

Causes

You initiate a PutBucketTags request to configure bucket tagging but specify an invalid value for the Tag/Key child node or the Tag/Value child node in the XML request body.

The tag key must meet the following requirements:

  • The tag key can be up to 64 bytes in length.

  • The tag key cannot start with http://, https://, or Aliyun.

  • The tag key must be UTF-8 encoded.

  • The tag key cannot be left empty.

The tag value must meet the following requirements:

  • The tag value can be up to 128 bytes in length.

  • The tag value must be UTF-8 encoded.

  • The tag value can be left empty.

Examples

For example, you initiate the following request:

PUT /?tagging
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Date: Tue, 20 Dec 2018 11:49:13 GMT
Authorization: OSS LTAI****************:kZoY************************
</Tagging>
  <TagSet>
  	<Tag>
    	<Key>xxx...(200 characters omitted)...xxx</Key>
      <Value>test</Value>
    </Tag>
  </TagSet>
</Tagging>

In the preceding request, the length of the value of the Tag/Key node in the XML request body exceeds 128 bytes, which does not meet the requirements. As a result, an error is returned.

Solutions

Make sure that the request body conforms to the XML specifications and contains a Tag node that meets the requirements of the operation. For a valid request, refer to the following example.

PUT /?tagging
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Date: Tue, 20 Dec 2018 11:49:13 GMT
Authorization: OSS LTAI****************:kZoY************************
<Tagging>
  <TagSet>
    <Tag>
      <Key>testa</Key>
      <Value>testv1</Value>
    </Tag>
    <Tag>
      <Key>testb</Key>
      <Value>testv2</Value>
    </Tag>
  </TagSet>
</Tagging>

References