All Products
Search
Document Center

Object Storage Service:0002-00000417

Last Updated:Aug 02, 2025

Problem description

The value of the X-Amz-Expires parameter in the request is invalid.

Causes

You sent a request that uses an Amazon S3-compatible V4 signature. However, the value of the X-Amz-Expires parameter in the request is invalid.

Examples

You sent a request that includes a signature in the URL parameters, but the value of the X-Amz-Expires parameter is invalid.

GET /test.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=LTAI****************/20221220/us-east-1/s3/aws4_request&X-Amz-Date=20221220T084818Z86400&X-Amz-Expires=abc&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-Expires parameter specifies the validity period of a signed URL in seconds. The value must be an integer in the range of 1 to 604800. In the preceding example, the value of this parameter is abc, which is invalid.

Solutions

Replace the invalid value abc of the X-Amz-Expires parameter with a valid integer within the allowed range, such as 86400. Ensure that all parameters in the URL request are complete and correctly specified. The following code provides a valid example:

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.