Google cloud storage Bucket insert失败,错误代码为400

Google cloud storage Bucket insert失败,错误代码为400,google-cloud-storage,Google Cloud Storage,以下是代码段: Bucket newBucket = storage.buckets().insert("MyProject", new Bucket().setName("MyBucket").setLocation("US").setStorageClass("DURABLE_REDUCED_AVAILABILITY")).execute(); } catch (GoogleJsonResponseException e) { System.out.println("Excep

以下是代码段:

Bucket newBucket = storage.buckets().insert("MyProject", new Bucket().setName("MyBucket").setLocation("US").setStorageClass("DURABLE_REDUCED_AVAILABILITY")).execute();
 } catch (GoogleJsonResponseException e) {
      System.out.println("Exception in tryCreateBucket: "+e);
      throw e;
 }
它抛出: tryCreateBucket中的异常:

com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request
{
  "code" : 400,
  "errors" : [ {
    "domain" : "global",
    "message" : "Invalid Value",
    "reason" : "invalid"
  } ],
  "message" : "Invalid Value"
}
有没有关于如何解决这个问题的想法

谢谢
/VK

存储桶名称必须为小写。还有许多其他限制-请参见

您的项目名称是错误的,您需要的是谷歌指定的foo-barbar-12345表格中的一个,而不是您给它的普通名称(CloudStorage)

更改了bucketname,但仍然会得到相同的错误。下面是代码片段和输出。。。System.out.println(“创建bucket,projName:+projName+”,bucketName:+bucketName”);尝试{Bucket createdBucket=storage.Bucket().insert(projName,new Bucket().setName(bucketName).setLocation(“US”)).execute();}输出:创建Bucket,projName:CloudStorage,bucketName:1904mybucketfoo2409 400错误请求{“代码”:400,“错误”:[{“域”:“全局”,“消息”:“无效参数”。,“原因”:“无效”}],“消息”:“无效参数”。}您是如何解决的,请您提及解决方案。更改了存储桶名称,但仍然收到相同的错误。似乎无法找到根本原因。。。