0

I'm trying to setup the google cloud IoT core api in my project so that i can create an MQTT broker for a raspberry pi 4 to connect to my VM instance/server, but when it's time to setup the Cloud IoT core i keep on getting the same error over & over.

I was running through a tutorial on creating a device registry under the google cloud IoT core, the tutorial told me to create a device registry using this code

gcloud iot registries create
my-registry
--project=eegr-4pf-390-project
--region=us-central1
--event-notification-config=topic=projects/eegr-4pf-390-project/topics/my-topic

Then i get met with this request from the cloud shell:

      API [cloudiot.googleapis.com] not enabled on project [295150708670]. Would you like to enable and retry (this will take a few 

minutes)? (y/N)?

I hit the Y to attempt to enable the necessary API, but then i get hit with this response after a few seconds:

Enabling service [cloudiot.googleapis.com] on project [295150708670]... ERROR: (gcloud.iot.registries.create) PERMISSION_DENIED: Permission denied to enable service [cloudiot.googleapis.com] Help Token: Af4HWuKfO9fwsO14O_Ls0u10TTmMeGYSHXeWcSjBEt-Y448YJT0gBt0Z8vz03m5j78V4kUagafizS9PnyoPrtGSl50jrGgJvMSEyBHjZ6aN-GeFp

  • '@type': type.googleapis.com/google.rpc.PreconditionFailure violations:
    • subject: ?error_code=110002&service=servicemanagement.googleapis.com&permission=servicemanagement.services.bind&resource=295150708670 type: googleapis.com
  • '@type': type.googleapis.com/google.rpc.ErrorInfo domain: serviceusage.googleapis.com metadata: permission: servicemanagement.services.bind resource: '295150708670' service: servicemanagement.googleapis.com reason: AUTH_PERMISSION_DENIED

I got this error and i started looking around as to why, one site said to check if your project is under your billing, i made sure check that & i was still getting the error, another site said to check if your project ID is being set under the gcloud commands, i made sure to check that, i'm still getting the same error and now i'm out of ideas for possible fixes, i'm not sure where to try or to go to, though i will say when i looked up the API through the google cloud platofrm API libaries it wasn't showing up, maybe it's under a new name? i'm not sure, but i desprately need help on trying to install the Cloud IoT core API.

My IAM roles applied to my personal email:Editor, Owner, Cloud IoT Admin, API gateway admin

  • Which IAM roles are attached to the identity that you authorized the CLI `gcloud` with? That identity does not have permission to enable services/APIs. – John Hanley May 15 '23 at 22:53
  • I attached it with my personal email, i went under the IAM roles and added my personal email to the Cloud IoT admin & API Gateway admin roles to see if that would fix the problem, it hasn't. – TeddyBear21 May 16 '23 at 00:03
  • Neither of those IAM roles is related to enabling services. Edit your post and show the IAM roles attached to that identity. – John Hanley May 16 '23 at 00:43
  • I did that, the roles are located towards the bottom. – TeddyBear21 May 16 '23 at 01:57
  • What does `gcloud auth list` show? The `owner` role has the required permissions. Since you are getting an error enabling services, you must have the CLI configured differently. – John Hanley May 16 '23 at 02:19
  • I ran gcloud auth list --filter=status:ACTIVE --format="value(account)" into the SSH browser for my VM instance, and it shows my personal account as the active account – TeddyBear21 May 16 '23 at 05:03
  • Why did you add filters? I did not request that. Put details in your post. – John Hanley May 16 '23 at 05:05

0 Answers0