简体   繁体   中英

Google Cloud SDK: gcloud auth login gives me an error

Whenever I try to gcloud auth login, I get the following error.

C:\Program Files\Google\Cloud SDK>gcloud auth login
Your browser has been opened to visit:
https://accounts.google.com/o/oauth2/auth?redirect_uri=<loong url here>
Traceback (most recent call last):
  File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\bin\..\./lib\googlecloudsdk\gcloud\gcloud.py", line 183, in <module>
main()
  File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\bin\..\./lib\googlecloudsdk\gcloud\gcloud.py", line 179, in main
_cli.Execute()
  File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\bin\..\./lib\googlecloudsdk\calliope\cli.py", line 488, in Execute
post_run_hooks=self.__post_run_hooks)
  File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\bin\..\./lib\googlecloudsdk\calliope\backend.py", line 1016, in Run
result = command_instance.Run(args)
  File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\bin\..\./lib\googlecloudsdk\calliope\exceptions.py", line 86, in TryFunc
return func(*args, **kwargs)
  File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\gcloud\sdktools\auth\login.py", line 95, in Run
c_store.Store(creds, account)
  File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\bin\..\./lib\googlecloudsdk\core\credentials\store.py", line 272, in Store
_GetLegacyGen(account, creds).WriteTemplate()
  File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\bin\..\./lib\googlecloudsdk\core\credentials\store.py", line 277, in _GetLegacyGen
multistore_path=config.Paths().LegacyCredentialsMultistorePath(account),
  File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\bin\..\./lib\googlecloudsdk\core\config.py", line 474, in LegacyCredentialsMultistorePath
return os.path.join(self.LegacyCredentialsDir(account), 'multistore.json')
  File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\bin\..\./lib\googlecloudsdk\core\config.py", line 463, in LegacyCredentialsDir
return os.path.join(self.global_config_dir, 'legacy_credentials', account)
  File "C:\python27_x64\lib\ntpath.py", line 108, in join
path += "\\" + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xba in position 9: ordinal not in range(128)

Can anyone tell me how I am supposed to fix this problem? My OS is windows 8.1. The GCE I created is a LAMP server.

Which version of gcloud are you running? Google Cloud SDK 0.9.46?

Are you getting the authentication code in your browser?

I would try running gcloud without automatically launching the browser, ie gcloud auth login --no-launch-browser

use the following command instead
gcloud auth login --no-launch-browser
or gcloud auth login --no-browser
or consider upgrading your gcloud-CLI by running the following command
gcloud components update

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM