How to enable GCP service, I get a PERMISSION_DENIED

Viewed 5248

When I run gcloud services enable service:container.googleapis.com, I get the following error:

ERROR: (gcloud.services.enable) PERMISSION_DENIED: Not found or permission denied for service(s): service:container.googleapis.com.
- '@type': type.googleapis.com/google.rpc.PreconditionFailure
  violations:
  - subject: ?error_code=220002&services=service:container.googleapis.com
    type: googleapis.com
- '@type': type.googleapis.com/google.rpc.ErrorInfo
  domain: serviceusage.googleapis.com
  metadata:
    services: service:container.googleapis.com
  reason: SERVICE_CONFIG_NOT_FOUND_OR_PERMISSION_DENIED

What permission am I missing that's causing this error?

2 Answers

According to this document, it should be like this :

gcloud services enable [SERVICE_NAME]

or

gcloud services enable container.googleapis.com

You can also see the list of available services for a project, run:

gcloud services list --available

and To list the services the current project has enabled, run:

gcloud services list --enabled

I used below and it worked. I just used CONTAINER as service name rather than using container.googleapis.com

gcloud services enable container

Operation "operations/acf.p2-768261041254-0cc69e23-b9e8-449f" finished successfully.

Related