由于启用了Cloud Storage JSON API而无法部署AppEngine版本

时间:2016-03-16 15:40:02

标签: google-app-engine google-cloud-storage google-compute-engine google-managed-vm managed-vm

我正在尝试部署到Google AppEngine。 (更确切地说:托管VM。)

我跑了gcloud preview app deploy d:\dev\mytest\yaml-war\app.yaml --version=joshua20160316d --project=mytest-test1

大约30分钟后,它失败了。

错误消息指示我在Cloud Developer Console中记录日志行(见下文),告诉我需要启用对Cloud Storage JSON API的访问。但是,Developer Console显示已启用Cloud Storage JSON API。 (见截图。)

另请注意,这适用于其他团队成员;并且针对不同项目的相同命令也成功了。所以,它是某种特定于项目和我的帐户的设置,但我不知道是什么。

我需要做些什么来完成这项工作?

screenshot; API is enabled

Failure setting up GCS logging: failed to create GCS logging client: error creating logfile: googleapi: Error 403: Access Not Configured. The API (Cloud Storage JSON API) is not enabled for your project. Please use the Google Developers Console to update your configuration., accessNotConfigured
{
 metadata: {
  severity:     "INFO"
  projectId: "mytest-test1"
  serviceName: "cloudbuild.googleapis.com"
  labels: {     
    cloudbuild.googleapis.com/build_id:
  "49697866-90f8-4771-82ef-7fe149f1d926"
  }
  timestamp: "2016-03-16T14:19:10.940059809Z"
  projectNumber: "232473234717"
 }
 textPayload: "Failure setting up GCS logging: failed to create GCS logging client: error creating logfile: googleapi: Error 403: Access Not Configured. The API (Cloud Storage JSON API) is not enabled for your project. Please use the Google Developers Console to update your configuration., accessNotConfigured"
 insertId: "41697866-90f8-4771-82ef-8fe149f1d926-0"
 log: "41697866-90f8-4771-82ef-8fe149f1d926"
}

本地日志包括以下内容。

Operation [operations/build/mytest-test1/MmFmNjFhNGQtZDU2Yi00NzczLWI5NTItNWYyNGYyZGYyM2FkOlAT] complete. Result: {
    "metadata": {
        "@type": "type.googleapis.com/google.devtools.cloudbuild.v1.BuildOperationMetadata", 
        "build": {
            "finishTime": "2016-03-16T13:35:28.453575Z", 
            "status": "FAILURE", 
            "timeout": "600.000s", 
            "startTime": "2016-03-16T13:35:28.199428Z", 
            "workerId": "worker-74ace662-26dc-47c5-b23b-0886f61a5fbe", 
            "logsBucket": "staging.mytest-test1.appspot.com", 
            "userId": "846527075559", 
            "results": {}, 
            "id": "2af61a4d-d57b-4773-b952-5e24f2df23ad", 
            "buildReceipt": {
                "clientId": "32555940559"
            }, 
            "source": {
                "storageSource": {
                    "object": "mytest-test1.default.joshua20160316d", 
                    "bucket": "staging.mytest-test1.appspot.com"
                }
            }, 
            "steps": [
                {
                    "args": [
                        "appengine.gcr.io/gcloud/mytest-test1.default.joshua20160316d"
                    ], 
                    "name": "gcr.io/cloud-builders/dockerizer"
                }
            ], 
            "sourceProvenance": {
                "resolvedStorageSource": {
                    "generation": "1458135324271000", 
                    "object": "mytest-test1.default.joshua20160316d", 
                    "bucket": "staging.mytest-test1.appspot.com"
                }
            }, 
            "projectId": "mytest-test1", 
            "images": [
                "appengine.gcr.io/gcloud/mytest-test1.default.joshua20160316d"
            ], 
            "projectNum": "232473234717", 
            "foremanId": "cloud-build/foreman.server/ir/0", 
            "createTime": "2016-03-16T13:35:26.145234Z"
        }
}, 
"done": true, 
"name": "operations/build/mytest-test1/MmFmNjFhNGQtZDU2Yi00NzczLWI5NTItNWYyNGYyZGYyM2FkOlAT", 
"error": {
    "message": "Build failed; check build logs for details", 
    "code": 2
}

}

1 个答案:

答案 0 :(得分:2)

这可能听起来很愚蠢,但您是否尝试过禁用和重新启用API? https://console.developers.google.com/apis/api/storage_api/overview?project=232474234717(你有截图)。 [是的,尝试过;没有帮助]

其次,您可以尝试使用--bucket标志指定自己的GCS存储桶。默认情况下,构建使用为项目自动设置的特殊存储桶。

最后,如果指定--use_cloud_build=0,您将启用旧版构建系统,其中VM将在您的项目中启动,执行构建,然后关闭。较新的云构建服务旨在取代旧系统,速度提高1-2分钟。

对不起,你在这里遇到了障碍。