Problem description
The following error is reported when you access a bucket in OSS by using the SDK.
The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint
Cause
The error message returned because the Endpoint parameter is not specified or the specified parameter is incorrect. For example, if a bucket is created in the Qingdao region and a request is made using the default configured oss-cn-hangzhou.aliyuncs.com
Hangzhou Endpoint address, this error occurs.
Solutions
Make sure that the endpoint of the request is the same as the actual endpoint of the bucket. To access the buckets of the Qingdao and Hangzhou nodes, create multiple ossclients. When you define the endpoints, add the addresses of the Qingdao and Hangzhou regions.
References
- For more information about the public and internal endpoints of each OSS region, see Region and endpoint comparison table.
- For more information about the Java SDK, see Java SDK.
Applicable scope
- Object Storage Service (OSS)