0019-00000002
Updated at:
Problem description
The PutBucketWebsite request fails because the XML body contains an invalid parameter value.
Causes
The HttpStatus parameter in the ErrorDocument element requires a valid integer HTTP status code (for example, 404). If you set HttpStatus to a non-integer value such as a string, Object Storage Service (OSS) returns an InvalidArgument error.
Examples
The following request fails because HttpStatus is set to test instead of a valid integer:
PUT /?website 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"?>
<WebsiteConfiguration>
<IndexDocument>
<Suffix>index.html</Suffix>
</IndexDocument>
<ErrorDocument>
<Key>errorDocument.html</Key>
<HttpStatus>test</HttpStatus>
</ErrorDocument>
</WebsiteConfiguration>OSS returns the following error response:
<?xml version="1.0" encoding="UTF-8"?>
<Error>
<Code>InvalidArgument</Code>
<Message>HttpStatus is Invalid</Message>
<RequestId>63D5E4E5CCB67C39323A6A45</RequestId>
<HostId>zmf-dinary.oss-cn-hangzhou-zmf.aliyuncs.com</HostId>
<ArgumentName>HttpStatus</ArgumentName>
<ArgumentValue>test</ArgumentValue>
<EC>0019-00000002</EC>
</Error>The response fields that identify the problem:
| Field | Description |
|---|---|
Code | The error code. InvalidArgument means a parameter value is invalid. |
Message | A human-readable description of the error. |
ArgumentName | The name of the parameter with the invalid value. |
ArgumentValue | The value you provided that triggered the error. |
Solutions
Set HttpStatus to a valid integer HTTP status code (for example, 404).
Replace <HttpStatus>test</HttpStatus> with a valid integer:
PUT /?website 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"?>
<WebsiteConfiguration>
<IndexDocument>
<Suffix>index.html</Suffix>
</IndexDocument>
<ErrorDocument>
<Key>errorDocument.html</Key>
<HttpStatus>404</HttpStatus>
</ErrorDocument>
</WebsiteConfiguration>References
Is this page helpful?