gpt4 book ai didi

google-cloud-platform - 服务帐户 `gcloud source repos clone` 不工作

转载 作者:行者123 更新时间:2023-12-01 15:30:53 37 4
gpt4 key购买 nike

将我的个人项目部署到 GCE(Google Compute Engine),我尝试在 Google Cloud Platform 中克隆一个 git repo。但它没有用。我猜 GCP 中的 git repo 在内部使用 code.google.com,这与服务帐户不兼容。它打印

Cloning into '/home/...'...
fatal: remote error: Invalid username/password.
You may need to use your generated googlecode.com password; see https://code.google.com/hosting/settings
ERROR: (gcloud.source.repos.clone) Command '['git', 'clone', 'https://source.developers.google.com/p/.../r/...', '/home/...', '--config', 'credential.helper="gcloud.sh"']' returned non-zero exit status 128

当前登录 ...-compute@developer.gserviceaccount.com 并且图像是 Debian(GCE 默认)

最佳答案

您的 GCE 实例是如何创建的?

你需要确保它有 https://www.googleapis.com/auth/source.full_control范围。列出您可以运行的范围

gcloud compute instances describe INSTANCE_NAME \
--zone=INSTANCE_ZON --format="yaml(serviceAccounts)"

如果您使用了 gcloud command to create the instance您可以使用 --scopes 标志来包含源范围。

或者,如果您使用 developer console要创建 GCE 实例,请确保在“服务帐户”部分中选择“允许对所有云 API 的完全访问”。

关于google-cloud-platform - 服务帐户 `gcloud source repos clone` 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38067253/

37 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com