unknown: Service 'containerregistry.googleapis.com' is not enabled for consumer 'project:next'

Viewed 3712

I had dockerized my Next.js app, and was trying to deploy it to google cloud, but while pushing the docker image to the registry, I encountered this error.

unknown: Service 'containerregistry.googleapis.com' is not enabled for consumer 'project:next'

I had enabled this API for all the possible projects, but it keeps retrying.

The command I am using was

gcloud builds submit --tag gcr.io/next/helloworld --project next-317511
1 Answers

As referred in the comments from @John Hanley and @Yogesh. I’ll summarize a possible troubleshooting that you can follow in order to solve your issue:

  1. Check that Billing is enabled for the particular project where I you were trying to have the container.
  2. Ensure that your hostname, project ID, image name, and tag or digest are spelled correctly as stated in the documentation.
  3. Enable API link here to enable the container registry API and see if you got a successful message for the particular project (Container Registry API has been enabled.)
  4. If it still doesn't work, please disable the API and enable it again.
  5. Delete the image with this command and try it again.

gcloud container images delete [image] --force-delete-tags

  1. As an extra information, check Granting IAM permissions in order to know how to manage permissions in Cloud Storage buckets. You would need to have permissions in the Storage Admin role. Also, the QuickStart of container registry could help for pushing and pulling the images to the Container Registry.
Related