Could not load the default credentials? (Node.js Google Compute Engine tutorial)

后端 未结 14 1529
情话喂你
情话喂你 2020-12-04 19:20

SITUATION:

I follow this tutorial: https://cloud.google.com/nodejs/tutorials/bookshelf-on-compute-engine

Everything works fine until I do

相关标签:
14条回答
  • 2020-12-04 19:47

    Yes, I had the same error. It's annoying cause Google Cloud Platform docs for their "getting started" bookshelf tutorial does not mention this anywhere. Which means that any new developer who tries this tutorial will see this error.

    Read this: https://developers.google.com/identity/protocols/application-default-credentials

    I fixed this issue by running: gcloud auth application-default login

    In order to run thisgcloud auth application-default login Visit: https://cloud.google.com/sdk/install 1) You have to install sdk into your computer 2) That will enable you to run the code 3) Log in to your associated gmail account then you are good to go!

    This will make you login, and after that you code locally will use that authentication.

    0 讨论(0)
  • 2020-12-04 19:48

    If you're running the app locally, then the gcloud beta auth application-default login command should suffice for acquiring local credentials (I updated the tutorial to say so).

    When running the app on Google Compute Engine, if the Compute Engine instance was created with the proper scopes (cloud-platform should be sufficient) then the app will authenticate with Google Cloud Platform APIs automatically without any extra work on your part.

    0 讨论(0)
提交回复
热议问题