【问题标题】:Google Could Storage: error when inserting bucket - 'Error 403: The account for the specified project has been disabled'Google 可以存储:插入存储桶时出错 - “错误 403:指定项目的帐户已被禁用”
【发布时间】:2014-05-30 05:18:46
【问题描述】:

字符串 projName = settings.getProject(); String bucketName = settings.getBucket();

System.out.println("Creating bucket, projName: "+projName+", bucketName: "+bucketName) ;
try {
  @SuppressWarnings("unused")
  Bucket createdBucket = storage.buckets().insert(projName, 
      new Bucket().setName(bucketName).setLocation("US")
    ).execute();
} catch (GoogleJsonResponseException e) {
  GoogleJsonError error = e.getDetails();
  if (error.getCode() == HTTP_CONFLICT
      && error.getMessage().contains("You already own this bucket.")) {
    System.out.println("already exists");
  } else {
    System.out.println("Exception in tryCreateBucket: "+e);
    throw e;
  }
}

输出:

正在创建存储桶,项目名称:round-center-551,存储桶名称:1904mybucketfoo

tryCreateBucket 中的异常:

com.google.api.client.googleapis.json.GoogleJsonResponseException: 403禁止

{ “代码”:403, “错误”:[{ “域”:“全球” “位置”:“授权”, “位置类型”:“标题”, "message" : "指定项目的帐号已被禁用。", “原因”:“accountDisabled” }], "message" : "指定项目的帐号已被禁用。" } 指定项目的帐户已被禁用。

我已确认 Google Cloud Storage 和 Google Cloud Datastore API 服务已开启。 知道应该怎么做才能启用该帐户吗?

【问题讨论】:

  • 您是否为您的项目启用了计费功能?如果已为该项目设置了计费,则您只能创建存储桶。

标签: google-cloud-storage


【解决方案1】:

此错误可能意味着几件事,但很可能只是表示您尚未为项目启用计费。

Google Cloud Storage 要求启用结算才能创建存储桶和对象,但此处的错误描述性不强。

您可以在 Cloud Console (https://console.developers.google.com/project/apps~PROJECT_NAME/settings) 的项目设置页面上启用结算

【讨论】:

    猜你喜欢
    • 2020-04-05
    • 2020-06-17
    • 1970-01-01
    • 2021-07-29
    • 2020-05-09
    • 2020-06-04
    • 2018-07-12
    • 2019-05-18
    相关资源
    最近更新 更多