How Do You Troubleshoot the Google Kubernetes Engine error “Request had insufficient authentication scopes”?

Problem scenario
You run a command like this:
gcloud container clusters get-credentials standard-cluster-1 --region us-central1-a

But you receive one of the following messages:
"Fetching cluster endpoint and auth data.
ERROR: (gcloud.container.clusters.get-credentials) ResponseError: code=403, message=Request had insufficient authentication scopes."

ERROR: (gcloud.projects.describe) User [123456789-compute@developer.gserviceaccount.com] does not have permission to access projects instance [123456789] (or it may not exist): Request had insufficient
authentication scopes.
'@type': type.googleapis.com/google.rpc.ErrorInfo
domain: googleapis.com
metadata:
method: google.cloudresourcemanager.v1.Projects.GetProject
service: cloudresourcemanager.googleapis.com
reason: ACCESS_TOKEN_SCOPE_INSUFFICIENT

What should you do?

Solution
Here is a basic solution that is ideal for a proof-of-concept. It is not ideal for an enterprise environment. Ideally the server you are using is either secure, or you plan on terminating it in an hour or two.

Procedures
1. Log into the GCP console
2. Go to Compute engine in the web UI.
3. Stop the VM.
4. Click on the hyperlinked name of the VM.
5. Click "Edit"
6. Check the option to "Allow full access to all Cloud APIs" if it was not checked. (If it was chosen, these directions will not help you. Please try to find something else.)
7. Click Save
8. Restart the VM.
9. Try again.

Leave a comment

Your email address will not be published. Required fields are marked *