0002-00000302

更新时间:
复制 MD 格式

Problem description

The Expires field in the request is blank.

Causes

The request uses Amazon S3-compatible authentication, but the Expires query parameter has no value.

Examples

The following request triggers this error. The Expires parameter is present but blank:

GET /test.txt?AWSAccessKeyId=nz2p****&Expires=&Signature=vjbyPxybdZaNmGa%2ByT272YEAiv**** 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 three query parameters used in S3-compatible query string authentication are:

ParameterExample valueDescription
AWSAccessKeyIdnz2p****The access key ID used to sign the request.
Expires1141889120The UNIX timestamp after which the signature expires. If Object Storage Service (OSS) receives the request after this time, a request timeout error is returned.
SignaturevjbyPxybdZaNmGa%2ByT272YEAiv****The URL-encoded signature string.

Expires is required and must be a valid UNIX timestamp — the number of seconds elapsed since 00:00:00 UTC on January 1, 1970. For example, if the current time is 1141889060 and you want the URL to be valid for 60 seconds, set Expires to 1141889120.

Solutions

Set Expires to a valid UNIX timestamp in the request. The following request is correct:

GET /test.txt?AWSAccessKeyId=nz2p****&Expires=1141889120&Signature=vjbyPxybdZaNmGa%2ByT272YEAiv**** 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.