The value of X-Amz-Expires is invalid. This parameter must be an integer between 1 and 604800 (seconds).
Problem description
The value of the X-Amz-Expires parameter in the request is invalid.
Causes
The request uses an Amazon S3-compatible Signature Version 4 (V4) but provides an invalid value for X-Amz-Expires.
Examples
The following request fails because X-Amz-Expires is set to abc instead of a valid integer:
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: trueThe 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.
Solutions
Set X-Amz-Expires to a valid integer within the range 1–604800. The following request uses 86400 (24 hours):
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: trueWe recommend that you use Amazon S3 SDKs to initiate the request. For more information, see Use Amazon S3 SDKs to access OSS.