由于Cloud Storage JSON API支持,部署AppEngine版本失败 [英] Failure deploying AppEngine version because of Cloud Storage JSON API enablement

本文介绍了由于Cloud Storage JSON API支持,部署AppEngine版本失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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



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



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

该错误消息指示我在Cloud Developer中登录行控制台(见下文)告诉我需要启用对云存储JSON API的访问。但是,开发者控制台显示Cloud Storage JSON API已启用。 (见截图。)



另外,请注意,这对其他团队成员有效;而针对不同项目的相同命令也取得成功。所以,这是针对该项目和我的帐户的某种特定设置,但我不知道该怎么做。



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



 设置GCS日志记录失败:创建GCS日志记录客户端失败:创建日志文件时出错:googleapi:错误403:访问未配置。 API(云存储JSON API)未针对您的项目启用。请使用Google Developers Console更新您的配置。accessNotConfigured 
{
metadata:{
severity:INFO
projectId:mytest-test1
serviceName :cloudbuild.googleapis.com
标签:{
cloudbuild.googleapis.com/build_id:
49697866-90f8-4771-82ef-7fe149f1d926
}
timestamp:2016-03-16T14:19:10.940059809Z
projectNumber:232473234717
}
textPayload:设置GCS日志失败:无法创建GCS日志记录客户端:错误创建日志文件:googleapi:错误403:未配置访问API(云存储JSON API)未启用您的项目,请使用Google Developers Console更新您的配置,accessNotConfigured
insertId:41697866- 90f8-4771-82ef-8fe149f1d926-0
log:41697866-90f8-4771-82ef-8fe149f1d926
}

本地日志包括以下内容。

 操作[操作/建立d / mytest-test1 / MmFmNjFhNGQtZDU2Yi00NzczLWI5NTItNWYyNGYyZGYyM2FkOlAT] complete。结果:{
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
$ bprojectId: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,
错误:{
消息:构建失败;检查构建日志的详细信息,
code:2
}

}

解决方案

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

第二,你可以尝试指定你的拥有 - 存储桶标记的GCS存储桶默认情况下,构建使用专门为您的项目设置的存储桶。



最后,如果您指定 - use_cloud_build = 0 ,您将启用遗留构建系统,虚拟机将在您的项目中启动,然后关闭,较新的云构建服务旨在取代传统系统,速度提升1-2分钟。



很抱歉,您在这里遇到了障碍。


I am trying to deploy to Google AppEngine. (More precisely: Managed VM.)

I ran gcloud preview app deploy d:\dev\mytest\yaml-war\app.yaml --version=joshua20160316d --project=mytest-test1.

After about 30 minutes, it failed.

The error message directs me to log lines in the Cloud Developer Console (see below) which tell me that access to the Cloud Storage JSON API needs to be enabled. However, the Developer Console shows that the Cloud Storage JSON API is already enabled. (See screenshot.)

Also, note that this works for other team members; and that the same command against a different project also succeeded. So, it is some sort of setting specific to the project and my account, but I don't know what.

What do I need to do to make this work?

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"
}

The local log includes the following.

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
}

}

解决方案

This may sound silly, but have you tried disabling and re-enabling the API? https://console.developers.google.com/apis/api/storage_api/overview?project=232474234717 (you have a screenshot of this). [yes, tried; didn't help]

Second, you could try specifying your own GCS bucket with the --bucket flag. By default the build uses a special bucket that is automatically set up for your project.

Finally, if you specify --use_cloud_build=0, you will enable the legacy build system where a VM will spin up in your project, do the build, and then shut down. The newer cloud build service is intended to replace the legacy system and is 1-2 minutes faster.

I'm sorry you are hitting a roadblock here.

这篇关于由于Cloud Storage JSON API支持,部署AppEngine版本失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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