All Products
Search
Document Center

Object Storage Service:0046-00000002

Last Updated:Jun 12, 2024

Problem description

The XML format in the request to configure custom log fields is incorrect.

Causes

The XML data specified in the PutUserDefinedLogFieldsConfig request is malformed.

Examples

The following example shows an invalid PutUserDefinedLogFieldsConfig request that causes the error.

PUT /?userDefinedLogFieldsConfig HTTP/1.1
Date: GMT Date
Content-Length: ContentLength
Content-Type: application/xml
Host: BucketName.oss-cn-hangzhou.aliyuncs.com
Authorization: SignatureValue

<?xml version="1.0" encoding="UTF-8"?>
<UserDefinedLogFieldsConfiguration>
	<HeaderSet>
		<header>header3</header>
</UserDefinedLogFieldsConfiguration>

In the preceding request, the HeaderSet element does not have a closing tag. As a result, the error is returned.

Solutions

Make sure that the XML data in the request conforms to XML rules.

PUT /?userDefinedLogFieldsConfig HTTP/1.1
Date: GMT Date
Content-Length: ContentLength
Content-Type: application/xml
Host: BucketName.oss-cn-hangzhou.aliyuncs.com
Authorization: SignatureValue

<?xml version="1.0" encoding="UTF-8"?>
<UserDefinedLogFieldsConfiguration>
	<HeaderSet>
		<header>header3</header>
	</HeaderSet>
</UserDefinedLogFieldsConfiguration>

References

PutUserDefinedLogFieldsConfig