0002-00000502

Updated at: 2025-04-01 15:34

Problem description

The format of the Date or x-oss-date header field in the request is invalid.

Causes

The value of the Date header field in the request is not in the GMT format or the value of the x-oss-date header field is not in the ISO8601 format.

Examples

The V4 signature is used in a request.

  • Example 1

    GET /oss.jpg?x-oss-signature-verion=OSS4-HMAC-SHA256&x-oss-credential=LTAI****************&x-oss-additional-headers=host&x-oss-signature=8u**** HTTP/1.1
    Host: oss-example.oss-cn-hangzhou.aliyuncs.com
    x-oss-date: Tue, 20 Dec 2022 08:48:18 GMT

    The x-oss-date header field must be in the ISO8601 format. Example: 20221220T084818Z. In this example, the value of the header field is Tue, 20 Dec 2022 08:48:18 GMT, which is in an invalid format.

  • Example 2

    GET /oss.jpg?x-oss-signature-verion=OSS4-HMAC-SHA256&x-oss-credential=LTAI****************&x-oss-additional-headers=host&x-oss-signature=8u**** HTTP/1.1
    Host: oss-example.oss-cn-hangzhou.aliyuncs.com
    Date: 20221220T084818Z

    The Date header field must be in the GMT format. Example: Tue, 20 Dec 2022 08:48:18 GMT. In this example, the value of the header field is 20221220T084818Z, which is in an invalid format.

Solutions

  • Change the value of the x-oss-date header field to 20221220T084818Z.

    GET /oss.jpg?x-oss-signature-verion=OSS4-HMAC-SHA256&x-oss-credential=LTAI****************&x-oss-additional-headers=host&x-oss-signature=8u**** HTTP/1.1
    Host: oss-example.oss-cn-hangzhou.aliyuncs.com
    x-oss-date: 20221220T084818Z
  • Change the value of the Date header field to Tue, 20 Dec 2022 08:48:18 GMT.

    GET /oss.jpg?x-oss-signature-verion=OSS4-HMAC-SHA256&x-oss-credential=LTAI****************&x-oss-additional-headers=host&x-oss-signature=8u**** HTTP/1.1
    Host: oss-example.oss-cn-hangzhou.aliyuncs.com
    Date: Tue, 20 Dec 2022 08:48:18 GMT
Note

We recommend that you use Alibaba Cloud SDKs to initiate a request that uses the V4 signature. For more information, see Overview.

References

  • On this page (1, T)
  • Problem description
  • Causes
  • Examples
  • Solutions
  • References
Feedback