All Products
Search
Document Center

Object Storage Service:0002-00000226

Last Updated:Nov 19, 2024

Description

Your request that uses the V4 signature is invalid.

Possible causes

The V4 signature is used in your request. However, the <Region> value specified in the x-oss-credential header is invalid, or the <Region> values specified in the Host and x-oss-credential headers do not match.

Examples

  • Example 1

    The V4 signature is contained in the URL of the request. However, the <Region> value (oss-cn-hangzhou) specified in the x-oss-credential header is invalid and does not match the region ID required by the V4 signature, which does not include oss-.

    GET /oss.jpg?x-oss-signature-verion=OSS4-HMAC-SHA256&x-oss-credential=AK**ID/2024-11-13/oss-cn-hangzhou/oss/abc&x-oss-expires=1141889120&x-oss-additional-headers=host&x-oss-signature=8u**a3 HTTP/1.1
    Host: oss-example.oss-cn-hangzhou.aliyuncs.com
    Date: Wed, 13 Nov 2024 08:48:18 GMT
  • Example 2

    The <Region> value (oss-cn-shenzhen) specified in the Host header does not match the <Region> value (cn-hangzhou) specified in the x-oss-credential header.

    GET /oss.jpg?x-oss-signature-verion=OSS4-HMAC-SHA256&x-oss-credential=AK**ID/2024-11-13/cn-hangzhou/oss/abc&x-oss-expires=1141889120&x-oss-additional-headers=host&x-oss-signature=8u**a3 HTTP/1.1
    Host: oss-example.oss-cn-shenzhen.aliyuncs.com
    Date: Date: Wed, 13 Nov 2024 08:48:18 GMT

Solutions

  • The region ID is required for the <Region> value specified in the x-oss-credential header. Example: cn-hangzhou.

  • The <Region> value specified in the Host header must match the <Region> value specified in the x-oss-credential header. The OSS region ID is required for the <Region> value specified in the Host header. Please specify the OSS region ID is in the following format: oss-{region-id}. Example: oss-cn-hangzhou.

Reference

For more information, see OSS regions and endpoints.