Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gcloud stop working - "was unexpected at this time."

I just update my google cloud SDK on windows 10 (gcloud components update). After the update the gcloud command stop working. All I get is (for example : gcloud -h): PATH\lib\gcloud.py" -h" was unexpected at this time.

I try to re-install but it didn't help:(

enter image description here

like image 250
Tal Yahav Avatar asked Dec 19 '19 23:12

Tal Yahav


1 Answers

As noted in the other answers, this is a bug with the 274.0.0 version of gcloud. Another report of this issue actually identifies where the bug is and offers this fix:

If you are stuck and need an immediate solution, here's a workaround that will move you forward, but you should reinstall the Cloud SDK from scratch when a fix is ready.

  1. Open C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk-bin\gcloud.cmd in your editor
  2. Near line 170, change ) ELSE ( to be just )
  3. Remove the ) on the last line in the file.

That should get you working in the short term (albeit with an extraneous error message every time you run a command). After getting it working you can revert to version 273.0.0 (so that you stop getting the error message and aren't using a modified version) using:

gcloud components update --version=273.0.0
like image 151
cjc Avatar answered Oct 19 '22 10:10

cjc