Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Adding cloud-platform scopes to google cloud sdk auth

I'm having an error when generating auth tokens in the terminal with the cloud-platform scope.
When I run:
```
gcloud auth application-default login --scopes https://www.googleapis.com/auth/drive,https://www.googleapis.com/auth/cloud-platform
```

I have an error in the token generation:
```
ERROR: (gcloud.auth.application-default.login) There was a problem refreshing your current auth tokens: None could not be converted to bytes
Please run:

$ gcloud auth login

to obtain new credentials.

If you have already logged in with a different account, run:

$ gcloud config set account ACCOUNT

to select an already authenticated account to use.
```
The suggested actions (re-login and change account) don't work.
My colleagues (with the same permissions as myself) have no issue running this command and authentication. This issue is persistent for my account in other machines.

Both the SDK documentation and gemini suggestions have no solution. I tried all of these:

Troubleshooting Steps
- Re-authenticate with gcloud auth login:
- Open your terminal or command prompt.
- Run: gcloud auth login
- Follow the prompts to authenticate with your Google account in your web browser.
Check GOOGLE_APPLICATION_CREDENTIALS (if applicable):
- If you're using a service account key file:
- Ensure the GOOGLE_APPLICATION_CREDENTIALS environment variable is set correctly and points to the absolute path of your service account key file.
- Verify that the key file exists and has the correct permissions.
- Clear gcloud Credentials Cache:
- Run: gcloud auth application-default revoke
- Try the original command again: gcloud auth application-default login --scopes https://www.googleapis.com/auth/drive,https://www.googleapis.com/auth/cloud-platform
- Update or Reinstall Google Cloud SDK:
- Update: gcloud components update
- Reinstall (if the issue persists): Follow the instructions for your operating system on the official Google Cloud SDK installation page: https://cloud.google.com/sdk/docs/install

Solved Solved
0 4 1,530
1 ACCEPTED SOLUTION

Downgraded Google Cloud SDK version to 492.0.0 and this error is no longer happening

View solution in original post

4 REPLIES 4