GoogleCloudPlatform / genai-for-marketing

Showcasing Google Cloud's generative AI for marketing scenarios via application frontend, backend, and detailed, step-by-step guidance for setting up and utilizing generative AI tools, including examples of their use in crafting marketing materials like blog posts and social media content, nl2sql analysis, and campaign personalization.
https://cloud.google.com/vertex-ai/
Apache License 2.0
309 stars 113 forks source link

gcloud SDK CLI authentication scopes #138

Closed chmstimoteo closed 2 weeks ago

chmstimoteo commented 2 weeks ago

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


I can reproduce this. It is related to at least the latest version ❯ gcloud --version Google Cloud SDK 499.0.0 This is breaking demos and pipelines all around.

While I'm not able to reproduce it in earlier version: ❯ gcloud --version Google Cloud SDK 492.0.0

chmstimoteo commented 2 weeks ago

@thekoma to review the fix.

Related to: https://www.googlecloudcommunity.com/gc/Developer-Tools/Adding-cloud-platform-scopes-to-google-cloud-sdk-auth/td-p/826183

chmstimoteo commented 2 weeks ago

@thekoma fixed this issue: https://github.com/GoogleCloudPlatform/genai-for-marketing/blob/main/infra/README.md by setting the right scopes as per the forum above.