Problem description
The format of the X-Amz-Date
field in the request is invalid.
Causes
You initiated a request that uses an Amazon S3-compatible V4 signature. However, the format of the X-Amz-Date
field is invalid.
Examples
You initiated a request that uses an Amazon S3-compatible V4 signature. However, the format of the X-Amz-Date
field in the request is invalid.
GET /test.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AK***/20221220/us-east-1/s3/aws4_request&X-Amz-Date=2022-12-20-08:48:18&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=ab2***st HTTP/1.0
Date: Tue, 20 Dec 2022 08:48:18 GMT
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
x-oss-s3-compat: true
The X-Amz-Date
field specifies the time when the request is initiated. The X-Amz-Date field must be in the following format: yyyyMMddTHHmmssZ
. In this example, the value of the X-Amz-Date
field is specified in the following invalid format: 2022-12-20-08:48:18
.
Solutions
Replace the invalid value of the X-Amz-Date
field with a valid value. In this example, 2022-12-20-08:48:18
is replaced with 20221220T084818Z
. Then, make sure that the fields in the URL parameter are complete and the values of the fields are valid. The following sample code provides an example on how to specify these fields:
GET /test.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=LTAI5t7h6SgiLSganP2m****/20221220/us-east-1/s3/aws4_request&X-Amz-Date=20221220T084818Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=ab2s**** HTTP/1.0
Date: Tue, 20 Dec 2022 08:48:18 GMT
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
x-oss-s3-compat: true
We recommend that you use Amazon S3 SDKs to initiate the request. For more information, see Use Amazon S3 SDKs to access OSS.