All Products
Search
Document Center

Object Storage Service:0002-00000421

Last Updated:Mar 27, 2025

Problem description

The time that is specified in the X-Amz-Credential field does not match the time that is specified by the X-Amz-Date field.

Causes

You initiated a request that used the Amazon S3-compatible V4 signature. However, the time that is specified in the X-Amz-Credential field of the request did not match the time that is specified by the X-Amz-Date field of the request.

Examples

The following code provides an example of a URL-based request in which the time that is specified in the X-Amz-Credential field does not match the time that is specified by the X-Amz-Date field.

GET /test.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=LTAI****************/20201220/us-east-1/s3/aws4_request&X-Amz-Date=20221220T084818Z&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

In the preceding example, the time that is specified in the X-Amz-Credential field is 20201220 and the time that is specified by the X-Amz-Date field is 20221220T084818Z.

Solutions

Make sure that the time that is specified in the X-Amz-Credential field and the time that is specified by the X-Amz-Date field are the same, the URL-based request is complete, and all fields of the request are correctly configured. The following code provides an example of a complete URL-based request whose fields are correctly configured.

GET /test.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=LTAI****************/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.