我从bitnami-jenkins图像创建了一个新的计算引擎实例,以自动部署我的应用程序引擎应用程序。我使用以下命令来做到这一点:
gcloud compute instances create deployer
--project myapp --image-project bitnami-launchpad
--image bitnami-jenkins-1-638-1-linux-debian-7-x86-64
--zone us-central1-a --machine-type g1-small
--metadata "bitnami-base-password=mypassword,bitnami-default-user=user,bitnami-key=jenkins,bitnami-name=Jenkins,bitnami-url=//bitnami.com/stack/jenkins,bitnami-description=Jenkins,startup-script-url=https://dl.google.com/dl/jenkins/p2dsetup/setup-script.sh"
--scopes "https://www.googleapis.com/auth/userinfo.email,https://www.googleapis.com/auth/devstorage.full_control,https://www.googleapis.com/auth/projecthosting,https://www.googleapis.com/auth/appengine.admin"
--tags "jenkins"
创建机器后,我创建了一个作业来部署代码,如下所示:
https://cloud.google.com/tools/cloud-repositories/docs/push-to-deploy
但是,我的工作失败,并出现以下错误:
ERROR: Error Response: [403] Request had insufficient authentication scopes.
ERROR: (gcloud.preview.app.deploy) Could not retrieve the default Google Cloud Storage bucket for [myapp]. Please try again or use the [bucket] argument.
还有其他人遇到过吗?我有一台装有旧版gcloud的jenkins机器。它从未抛出任何与云存储桶相关的错误。因此,我有一种直觉,即它与gcloud的较新版本有关。
请帮忙。谢谢。
编辑:这是gcloud命令的输出--verbosity debug
。gcloud输出
当我尝试使用最新版本的Cloud SDK(0.9.88)重现此错误时,出现以下错误消息:
ERROR: (gcloud.preview.app.deploy) Required scopes ['https://www.googleapis.com/auth/cloud-platform'] missing from ['https://www.googleapis.com/auth/appengine.admin', 'https://www.googleapis.com/auth/devstorage.full_control', 'https://www.googleapis.com/auth/projecthosting', 'https://www.googleapis.com/auth/userinfo.email']. This VM instance probably needs to be recreated with the missing scopes.
解决方案是像以前一样重新创建VM,但将范围添加https://www.googleapis.com/auth/cloud-platform
到--scopes
标志中提供的列表中。
我将确保文档得到修复以反映这一点。编辑:文档已修复。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句