I Cant Init Google Cloud Sdk on Ubuntu

I cant init Google Cloud SDK on Ubuntu

The user gcbirzan responded my questions at an irc channel (which I recommend), it is #appengine on irc.freenode.net

I had to run this:

sudo chown ariel -R /home/ariel/.config/gcloud

I also leave the transcription of the chat here:

[14:12] Q: Hello

[14:13] Q: I am just beggining with app engine, and for instance, anyone could tell me what is the difference between this file((https://cloud.google.com/sdk/docs/quickstart-linux#before-you-begin)) and this one ((https://cloud.google.com/appengine/downloads#Google_App_Engine_SDK_for_Python)) (seems to be the same but it is 40.2MB and the one I used was 7.5MB)

[14:15] A: Google cloud sdk is gcloud and friends, you need it for flex and other google cloud platform stuff.

[14:15] A: The appengine sdk is the one that comes with a local dev server and all the other stuff, and is probably what you want

[14:15] A: well. go wild, get both

[14:16] Q: ok

[14:16] Q: thanks

[14:16] Q: and could you please help me with this ? I cant init Google Cloud SDK on Ubuntu

[14:17] A: sudo chown ariel -R /home/ariel/.config/gcloud

[14:19] Q: it works !

gcloud command not found - while installing Google Cloud SDK

So below is my previous fix for this problem, but it turns out it isn't permanent. It works but every time you restart Terminal, you'd have to do the same thing which isn't practical.

So that is why I suggest you delete the current google-cloud-sdk directory, and just redo the installation. Be sure (as Zachary has mentioned) to answer yes (Y) to the prompt Modify profile to update your $PATH and enable bash completion? (Y/n).

Here is my old answer, but just redo the installation:

I had the same problem, gcloud wasn't working for me. But then, in the same directory as my google-cloud-sdk folder which I had just installed (my home directory), I found this file called test. Inside this test file I found two commands:

# The next line updates PATH for the Google Cloud SDK.
source '[path-to-my-home]/google-cloud-sdk/path.bash.inc'
# The next line enables bash completion for gcloud.
source '[path-to-my-home]/google-cloud-sdk/completion.bash.inc'

After I ran these two source commands in terminal, gcloud worked!

Unable to initialize gcloud environment

On linux when you install the SDK it prompts to put following into your ~/.bashrc so PATH and such are setup to make cmds like gcloud visible

# The next line updates PATH for the Google Cloud SDK.
source '/home/scott/google-cloud-sdk/path.bash.inc'

# The next line enables shell command completion for gcloud.
source '/home/scott/google-cloud-sdk/completion.bash.inc'

If you are not on linux/OSX then the SDK install will have similar

Error while trying to authenticate with `gcloud init`

I had the same problem and gcloud has slightly changed the way their auth flow works.

Run gcloud auth login and then copy the whole output (not just the URL) to a terminal on a computer that has both a web browser and gcloud CLI installed. The command you should copy looks like

gcloud auth login --remote-bootstrap="https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=****.apps.googleusercontent.com&scope=openid+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fappengine.admin+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcompute+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Faccounts.reauth&state=****&access_type=offline&code_challenge=****&code_challenge_method=S256&token_usage=remote"

When you run that on your computer that has a web browser, it will open a browser window and prompt you to log in. Once you authorize your app in the web browser you get a new URL in your terminal that looks like

https://localhost:8085/?state=****&code=****&scope=email%20openid%20https://www.googleapis.com/auth/userinfo.email%20https://www.googleapis.com/auth/cloud-platform%20https://www.googleapis.com/auth/appengine.admin%20https://www.googleapis.com/auth/compute%20https://www.googleapis.com/auth/accounts.reauth&authuser=0&hd=****&prompt=consent

Paste this new URL back into the prompt in your headless machine after Enter the output of the above command: (in your case, this would be in your WSL2 terminal). Press enter and you get the output

You are now logged in as [****].
Your current project is [None]. You can change this setting by running:
$ gcloud config set project PROJECT_ID
[8]+ Done code_challenge_method=S256


Related Topics



Leave a reply



Submit