Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google cloud platform ubuntu 18.04 GCP虚拟机上的gcloud init无法正常工作_Google Cloud Platform_Google Compute Engine_Google Cloud Sdk - Fatal编程技术网

Google cloud platform ubuntu 18.04 GCP虚拟机上的gcloud init无法正常工作

Google cloud platform ubuntu 18.04 GCP虚拟机上的gcloud init无法正常工作,google-cloud-platform,google-compute-engine,google-cloud-sdk,Google Cloud Platform,Google Compute Engine,Google Cloud Sdk,在我成功声明使用xxx之后-compute@developer.gserviceaccount.com并得到信息: You are logged in as: [347619542646-compute@developer.gserviceaccount.com]. 我收到以下警告,使我无法选择项目 警告:列出可用项目失败:HttpError访问:响应:,内容 输入要使用的项目id: 如何解决此问题?这实际上不是关于权限的问题,但请求缺少必需的oAuth2作用域 只需以项目所有者的身份运行g

在我成功声明使用xxx之后-compute@developer.gserviceaccount.com并得到信息:

You are logged in as: [347619542646-compute@developer.gserviceaccount.com].
我收到以下警告,使我无法选择项目

警告:列出可用项目失败:HttpError访问:响应:,内容
输入要使用的项目id:

如何解决此问题?

这实际上不是关于权限的问题,但请求缺少必需的oAuth2作用域


只需以项目所有者的身份运行
gcloud init
,而不是无缘无故地使事情复杂化。

谢谢,你的意思是我不应该使用服务帐户,而应该使用我自己的帐户吗(xxx@gmail.com)我解决了这个问题,我所有的一切都是这样的:1。停止你的虚拟机,转到详细信息并点击编辑。向下滚动并将
云API访问范围
更改为
允许完全访问所有云API
f.e。
WARNING: Listing available projects failed: HttpError accessing <https://cloudresourcemanager.
googleapis.com/v1/projects?alt=json&filter=lifecycleState%3AACTIVE&pageSize=201>: response: <{
'www-authenticate': 'Bearer realm="https://accounts.google.com/", error="insufficient_scope", 
scope="https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/cloud-pl
atform.read-only https://www.googleapis.com/auth/cloudplatformprojects https://www.googleapis.
com/auth/cloudplatformprojects.readonly"', 'vary': 'Origin, X-Origin, Referer', 'content-type'
: 'application/json; charset=UTF-8', 'date': 'Mon, 24 Aug 2020 21:25:23 GMT', 'server': 'ESF',
 'cache-control': 'private', 'x-xss-protection': '0', 'x-frame-options': 'SAMEORIGIN', 'x-cont
ent-type-options': 'nosniff', 'server-timing': 'gfet4t7; dur=70', 'transfer-encoding': 'chunke
d', 'status': '403', 'content-length': '138', '-content-encoding': 'gzip'}>, content <{
  "error": {
    "code": 403,
    "message": "Request had insufficient authentication scopes.",
    "status": "PERMISSION_DENIED"
  }
}
>
Enter project id you would like to use: