错误:(gcloud.iot.devices.create)PERMISSION_DENIED

时间:2018-11-20 21:52:30

标签: google-cloud-platform gcloud google-cloud-iot

尝试执行gcloud命令时,我一直拒绝获得权限

gcloud iot devices create 'aq-rpi' --project='aqmon' --region='us-central1' --registry='aqmon' --public-key path=rsa_cert.pem,type=rs256

ERROR: (gcloud.iot.devices.create) PERMISSION_DENIED: The caller does not have permission

gcloud iam roles list --project aqmon

ERROR: (gcloud.iam.roles.list) User [my_name@gmail.com] does not have permission to access project [aqmon] (or it may not exist): You don't have permission to list roles in projects/aqmon.

我是项目的所有者,并且该项目是我通过仪表板创建的新创建的项目。

这是我第一次使用Google的IoT产品。我花了几个小时尝试不同的事情,但我茫然无措,甚至无法继续学习IoT Core的基本教程。我在做什么错了?

修改: 这是gcloud info

的输出
my_name@hephaestus:~/Documents/aq$ gcloud info
Google Cloud SDK [225.0.0]

Platform: [Mac OS X, x86_64] ('Darwin', 'hephaestus.local', '17.7.0', 'Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT 2018; root:xnu-4570.71.2~1/RELEASE_X86_64', 'x86_64', 'i386')
Python Version: [2.7.10 (default, Oct  6 2017, 22:29:07)  [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)]]
Python Location: [/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python]
Site Packages: [Disabled]

Installation Root: [/Users/my_name/Downloads/google-cloud-sdk]
Installed Components:
  core: [2018.11.09]
  gsutil: [4.34]
  bq: [2.0.37]
System PATH: [/Users/my_name/Downloads/google-cloud-sdk/bin:/Users/my_name/.rvm/gems/ruby-2.2.1/bin:/Users/my_name/.rvm/gems/ruby-2.2.1@global/bin:/Users/my_name/.rvm/rubies/ruby-2.2.1/bin:/Users/my_name/.nvm/versions/node/v8.9.4/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/my_name/.rvm/bin:/Users/my_name/.rvm/bin]
Python PATH: [/Users/my_name/Downloads/google-cloud-sdk/lib/third_party:/Users/my_name/Downloads/google-cloud-sdk/lib:/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip:/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/:/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin:/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac:/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages:/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk:/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old:/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload]
Cloud SDK on PATH: [True]
Kubectl on PATH: [False]

Installation Properties: [/Users/my_name/Downloads/google-cloud-sdk/properties]
User Config Directory: [/Users/my_name/.config/gcloud]
Active Configuration Name: [default]
Active Configuration Path: [/Users/my_name/.config/gcloud/configurations/config_default]

Account: [apanagar@gmail.com]
Project: [aqmon-223120]

Current Properties:
  [core]
    project: [aqmon-12345]
    account: [my_name@gmail.com]
    disable_usage_reporting: [False]

Logs Directory: [/Users/my_name/.config/gcloud/logs]
Last Log File: [/Users/my_name/.config/gcloud/logs/2018.11.20/13.49.34.950065.log]

git: [git version 2.17.2 (Apple Git-113)]
ssh: [OpenSSH_7.6p1, LibreSSL 2.6.2]

1 个答案:

答案 0 :(得分:1)

您正在尝试在命令中使用项目名称“ aqmon”,但您的项目实际上是“ aqmon-223120”。