Problem description
The signature in the request URL has expired.
Causes
The request uses Signature Version 4 (V4) compatible with Amazon S3, but OSS received the request after the signed URL's validity period had elapsed.
Examples
A signed URL's validity period is defined by two parameters:
| Parameter | Description | Constraints |
|---|---|---|
X-Amz-Date | The timestamp when the signed URL was created. | — |
X-Amz-Expires | The duration in seconds that the signed URL remains valid, counted from X-Amz-Date. | Integer, 0–604800 (maximum: 7 days) |
The signed URL expires at X-Amz-Date + X-Amz-Expires. OSS checks expiration at the moment it receives the request, not when the request was sent. If the request arrives after this point, OSS rejects it with an expiration error.
Example request:
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=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: trueIn this example, X-Amz-Date is 20221220T084818Z and X-Amz-Expires is 86400 seconds (24 hours). The signed URL expires at 2022-12-21T08:48:18Z. Any request OSS receives after that point fails with this error.
Solutions
Regenerate the signed URL. When doing so, set X-Amz-Expires to a larger value to extend the validity period.
Use Amazon S3 SDKs to generate and send requests. For more information, see Use Amazon S3 SDKs to access OSS.