Problem description
The specified bucket name is invalid.
Causes
The bucket name is invalid. Bucket names must comply with the following conventions:
The name can contain only lowercase letters, digits, and hyphens (-).
The name must start and end with a lowercase letter or digit.
The name must be 3 to 63 characters in length.
When you use OSS SDKs to initiate a request, the endpoint parameter specifies a bucket in a specific region.
Examples
In the following PutBucket request, the specified bucket name is in ABC, which does not comply with the bucket naming conventions.
PUT / HTTP/1.1 Host: ABC.oss-cn-hangzhou.aliyuncs.com Date: Fri, 24 Feb 2017 03:15:40 GMT x-oss-acl: private Authorization: OSS LTAI****************:77Dv**************** <?xml version="1.0" encoding="UTF-8"?> <CreateBucketConfiguration> <StorageClass>Standard</StorageClass> <DataRedundancyType>LRS</DataRedundancyType> </CreateBucketConfiguration>In the following example, the OSS SDK specifies that the bucket is your-bucket in the China (Hangzhou) region.
$endpoint = "https://your-bucket.oss-cn-hangzhou.aliyuncs.com"; $ossClient = new OssClient($accessKeyId, $accessKeySecret, $endpoint);
Solutions
Specify a valid bucket name based on the bucket naming conventions.
When you use OSS SDKs to initiate a request, the endpoint parameter cannot specify a bucket in a specific region.
$endpoint = "https://oss-cn-hangzhou.aliyuncs.com"; $ossClient = new OssClient($accessKeyId, $accessKeySecret, $endpoint);