【发布时间】:2016-05-17 03:33:13
【问题描述】:
我在 project1 上创建了新的 VM 实例 (jenkins-server) 并在其上安装了 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
Project1 是使用完全权限创建的
Google SDK 版本是最新的:Google Cloud SDK 95.0.0
[编辑][更新]
在 project1 上,我在 jenkins-server 实例上使用了预安装 jenkins 的图像,但我仅使用 ubuntu 14.04 LTS 重新创建了该实例,并手动安装了其他所有内容(cloud sdk、tomcat server、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
这是默认和自定义存储桶的相同错误
感谢您的帮助
【问题讨论】:
-
第二个错误,gsutil是在什么上下文下执行的?异常中列出的文件是有效文件吗?
-
@TravisHobrla 它正在 mvn gcloud:deploy 命令下执行,输出如下: [INFO] Building synchronization state... [INFO] Caught non-retryable exception while Listing file:/// tmp/tmpofq2NO: [Errno 2] 没有这样的文件或目录: '/tmp/tmpofq2NO/babfa40c84b6077baf7352fbefd86de948e26b3c.pem' [INFO] CommandException: 捕获不可重试异常 - 正在中止 rsync [INFO] 调试:运行命令:[/bin/bash /home/tareq/google-cloud-sdk/bin/gsutil -m rsync -R -c /tmp/tmpofq2NO gs://staging.tradeos-test1.appspot.com/],环境:[无]
-
@TravisHobrla 请注意 /tmp 下不存在此文件
-
@TravisHobrla 请在此处查看完整内容:[链接]code.google.com/p/google-cloud-sdk/issues/…
-
谢谢 - 我认为您提交的问题描述得很好。
标签: jenkins google-cloud-storage gcloud google-managed-vm google-cloud-sdk