0002-00000228
Description
This error occurs when a Signature Version 4 authentication request specifies an invalid region in the Credential parameter. A region is considered invalid if it does not exist or does not match the bucket's region.
Cause
You will receive this error if you send a request that uses Signature Version 4 authentication and any of the following conditions are met:
-
The region ID in the URI is incorrect or unsupported.
-
The region in the signature does not match the bucket's actual region.
-
The region ID does not exist.
Examples
Example 1: Invalid region ID
GET /oss.jpg HTTP/1.1
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Date: Sun, 01 Jun 2025 16:38:30 GMT
Authorization: OSS4-HMAC-SHA256 Credential=YourAccessKeyID/20250601/InvalidRegion/oss/aliyun_v4_request, SignedHeaders=host;x-amz-date, Signature=YourSignature
The request fails because InvalidRegion is not a supported Alibaba Cloud OSS region.
Example 2: Mismatched region
GET /oss.jpg HTTP/1.1
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Date: Sun, 01 Jun 2025 16:38:30 GMT
Authorization: OSS4-HMAC-SHA256 Credential=YourAccessKeyID/20250601/cn-beijing/oss/aliyun_v4_request, SignedHeaders=host;x-amz-date, Signature=YourSignature
The request fails because the bucket is in the China (Hangzhou) region (cn-hangzhou), but the signature specifies the China (Beijing) region (cn-beijing).
Solution
To resolve this error, ensure that the following requirements are met when you send a request that uses Signature Version 4:
-
The region ID in the signature must match the bucket's region.
-
Use the correct format for the region ID, such as cn-hangzhou or cn-beijing.
-
Confirm the bucket's actual region in the OSS console.
The following example shows a corrected request:
GET /oss.jpg HTTP/1.1
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Date: Sun, 01 Jun 2025 16:38:30 GMT
Authorization: OSS4-HMAC-SHA256 Credential=YourAccessKeyID/20250601/cn-hangzhou/oss/aliyun_v4_request, SignedHeaders=host;x-amz-date, Signature=YourSignature
In the corrected request, the region in the Credential parameter (cn-hangzhou) matches the region in the Host header.