How to enable GCP service, I get a PERMISSION_DENIED
Asked Answered
A

3

6

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?

Assertion answered 8/1, 2021 at 8:22 Comment(2)
Hmm let's see if it's the Not Found that's causing the issue, or the permission denied. What do you see in the console? console.cloud.google.com/apis/library/container.googleapis.comInaccuracy
I was able to enable the service from console.Assertion
L
1

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

Laudian answered 8/1, 2021 at 9:53 Comment(1)
Confirmed. Running gcloud services enable service:container.googleapis.com gives me same error as OP (even though I have all IAM perms at organization level). Removing service: from the command successfully enables the service.Anguilla
M
0

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.

Modify answered 17/7, 2021 at 13:30 Comment(0)
S
-1

Based on the two responses above to omit 'service' and to end at 'container' (without adding .googleapis.com) I made variations of the command. This one worked: gcloud services enable serviceusage.googleapis.com .

C:\NewApp\CourierApp>gcloud services enable serviceusage.googleapis.com
Operation "operations/acat.p2-####72866531-5309f688-fea1-446d-&&&&-f545c9a5e1f6" 

finished successfully. Of course I had made various API 'Roles', 'Admin management' modifications on the google.console to no avail. Perhaps this passed after one of those server updates.

Other prompts I tried:

  gcloud services enable maps.googleapis.com
  gcloud services enable:container
  gcloud services enable:container.googleapis.com

Schnook answered 20/9, 2024 at 20:29 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.