我在project1上创建了新的VM实例(jenkins-server),并在其上安装了jenkins服务器。其中一个jenkins作业应该构建我的应用程序并使用以下命令在project2上部署它
mvn gcloud:deploy -Dgcloud.gcloud_project=project2 -Dgcloud.version=jenkins-build-1
由于以下错误,命令失败:
[INFO] Beginning deployment...
[INFO] DEBUG: No bucket specified, retrieving default bucket.
[INFO] DEBUG: {u'status': u'PERMISSION_DENIED', u'message': u'Request had insufficient authentication scopes.',
u'code': 403}
[INFO] ERROR: Error Response: [403] Request had insufficient authentication scopes.
[INFO] DEBUG: Using bucket [].
[INFO] DEBUG: (gcloud.preview.app.deploy) Could not retrieve the default Google Cloud Storage bucket for [project2]. Please try again or use the [bucket] argument.
我在project2上创建了一个名为jenkins-server的新存储桶,并使用存储桶参数
再次尝试了该命令[INFO] Beginning deployment...
[INFO] DEBUG: Using bucket [gs://jenkins-server].
[INFO] DEBUG: Host: appengine.google.com
[INFO] DEBUG: (gcloud.preview.app.deploy) Required scopes ['https://www.googleapis.com/auth/appengine.admin', 'https://www.googleapis.com/auth/cloud-platform'] missing from [list of scopes]. This VM instance probably needs to be recreated with the missing scopes
使用完全权限
创建Project1Google SDK版本是最新的:Google Cloud SDK 95.0.0
[编辑] [UPDATE]
on project1我在jenkins-server实例上使用了预安装jenkins的映像,但我只用ubuntu 14.04 LTS重新创建了实例,并手动安装了其他所有东西(云sdk,tomcat服务器,jenkins,maven ......)
上面的问题消失了,但现在我得到了不同的错误
ERROR: (gcloud.preview.app.deploy) Could not synchronize files. The gsutil command exited with status [1]
在检查日志文件后,我可以看到以下错误:
Building synchronization state... Caught non-retryable exception while listing file:///tmp/tmpsgDQKG: [Errno 2] No such file or directory: '/tmp/tmpsgDQKG/cc79fffba16616623f47691da45b33db1beb4209.pem'
CommandException: Caught non-retryable exception - aborting rsync
默认和自定义存储桶
的错误相同感谢您的帮助
答案 0 :(得分:2)
根据提交的issue 532的详细信息,解决方法是使用gcloud config set app/use_gsutil false
进行部署,但现在这是gcloud版本106.0.0的默认值