Google Could Storage:插入存储桶时出错-“错误403:指定项目的帐户已被禁用" [英] Google Could Storage: error when inserting bucket - 'Error 403: The account for the specified project has been disabled'

查看:103
本文介绍了Google Could Storage:插入存储桶时出错-“错误403:指定项目的帐户已被禁用"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

String 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;
  }
}

输出:

创建存储桶,projName:round-center-551,bucketName:1904mybucketfoo

Creating bucket, projName: round-center-551, bucketName: 1904mybucketfoo

tryCreateBucket中的异常:

Exception in tryCreateBucket:

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

com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden

{代码":403,错误":[{"domain":"global""location":授权","locationType":"header","message":指定项目的帐户已被禁用.","reason":"accountDisabled"}],"message":指定项目的帐户已被禁用.}指定项目的帐户已被禁用.

{ "code" : 403, "errors" : [ { "domain" : "global" "location" : "Authorization", "locationType" : "header", "message" : "The account for the specified project has been disabled.", "reason" : "accountDisabled" } ], "message" : "The account for the specified project has been disabled." } The account for the specified project has been disabled.

我已验证Google Cloud Storage和Google Cloud Datastore API服务已启用.知道要启用该帐户应该怎么做吗?

I have verified that Google Cloud Storage and Google Cloud Datastore API services are on. Any idea what should be done to enable the account?

推荐答案

此错误可能意味着几件事,但是很可能只是意味着您尚未为该项目启用结算.

This error could mean a few things, but quite possibly just means that you haven't enabled billing for the project.

Google Cloud Storage要求启用计费功能以创建存储桶和对象,但是此处的错误描述性不是很高.

Google Cloud Storage requires that billing is enabled in order to create buckets and objects, however the error here isn't very descriptive.

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

You can enable billing on the Settings page for your project in the Cloud Console (https://console.developers.google.com/project/apps~PROJECT_NAME/settings)

这篇关于Google Could Storage:插入存储桶时出错-“错误403:指定项目的帐户已被禁用"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆