gcloud トラブルシューティング

gcloudを使っていた際に起きたエラー内容と解決方法を記録していきます。

There was a problem refreshing your current auth tokens

There was a problem refreshing your current auth tokens: ('invalid_grant: Bad Request', '{\n  "error": "invalid_grant",\n  "error_description": "Bad Request"\n}')
Please run:

  $ gcloud auth login

to obtain new credentials.

If you have already logged in with a different account:

    $ gcloud config set account ACCOUNT

to select an already authenticated account to use.

書いてある通りに gcloud auth login を入力してブラウザ上での操作後、以下のように怒られます。

ERROR: There was a problem with web authentication. Try running again with --no-launch-browser.
ERROR: (gcloud.auth.login) Failed to find "code" in the query parameters of the redirect.

no-launch-browser オプションをつける必要があるみたいですね。

gcloud auth login --no-launch-browser