Google Cloud SDK error causes bq error

After updating the Google Cloud SDK 189.0.0, the previously subtle bq query --nouse_legacy_sql " ... " command will now look like this:

$ python --version Python 2.7.13 :: Anaconda, Inc. $ bq version This is BigQuery CLI 2.0.29 $ bq query --nouse_legacy_sql "SELECT country, model, iid, version, count(*) as n, max(t) AS t FROM an6.sm GROUP BY country, model, iid, version ORDER BY t DESC LIMIT 10 " bq.py should not be invoked. Use bq command instead. $

Re-restore the previous version.

 $ gcloud components restore Your Cloud SDK installation will be restored to its previous state. Do you want to continue (Y/n)? Y Restoring backup... Performing post processing steps...done. Restoration done! $ bq query --nouse_legacy_sql "SELECT country, model, iid, version, count(*) as n, max(t) AS t FROM an6.sm GROUP BY country, model, iid, version ORDER BY t DESC LIMIT 10 " Waiting on bqjob_r13976b38780fa35_00000161ab5076fe_1 ... (1s) Current status: DONE 
+5
source share
2 answers

Try canceling and initializing your gcloud credentials:

 gcloud auth revoke <credentials you're using> gcloud auth login 

or replace "login" with the command that you used for authentication, if it was different.

+7
source

If your previous condition was good, you can return the update to 189.0.0 by doing:

 gcloud components restore 

This returned my SDK back to 172.0.1 and bq to 2.0.26, which I was able to execute from the virtual machine again.

 $ bq query "SELECT COUNT(word) FROM [bigquery-public-data:samples.shakespeare] LIMIT 1000" Waiting on bqjob_r1ac52f8ef09f41c2_00000161a981cfac_1 ... (0s) Current status: DONE +--------+ | f0_ | +--------+ | 164656 | +--------+ 
+1
source

Source: https://habr.com/ru/post/1275430/


All Articles