Failed to create Google HTTP client: google: could not find default credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information.
I already add to path set GOOGLE_APPLICATION_CREDENTIALS="C:\Users\username\Downloads\google-account.json"
but still failed to create google http client
And also what do you mean by this?
All commands must be run with the GOOGLE_APPLICATION_CREDENTIALS environment variable set to the path where the JSON key is located.
is it something like this? in cmd GOOGLE_APPLICATION_CREDENTIALS="PATH" FirestoreRestore -backup -wait -p myapp -b gs://mybucket -n backup
Oh! You're on windows :)
According to the WINDOWS section of Google's auth guide, you can set an environment variable in your session with set GOOGLE_APPLICATION_CREDENTIALS=[PATH].
Oh! You're on windows :)
According to the
WINDOWSsection of Google's auth guide, you can set an environment variable in your session withset GOOGLE_APPLICATION_CREDENTIALS=[PATH].
I already did (setting up the environmental variables path manually). But still failed to create google http client.
Hmm, this uses Google's default authentication token code. The library they use says:
It looks for credentials in the following places, preferring the first location found:
- A JSON file whose path is specified by the GOOGLE_APPLICATION_CREDENTIALS environment variable.
- A JSON file in a location known to the gcloud command-line tool. On Windows, this is %APPDATA%/gcloud/application_default_credentials.json. On other systems, $HOME/.config/gcloud/application_default_credentials.json.
- On Google App Engine standard first generation runtimes (<= Go 1.9) it uses the appengine.AccessToken function.
- On Google Compute Engine, Google App Engine standard second generation runtimes (>= Go 1.11), and Google App Engine flexible environment, it fetches credentials from the metadata server. (In this final case any provided scopes are ignored.)
You might try putting the credential file in your appdata folder?
Failed to create Google HTTP client: google: error getting credentials using GOOGLE_APPLICATION_CREDENTIALS environment variable: open "C:\Users\username\AppData\Roaming\gcloud\googleaccount.json": The filename, directory name, or volume label syntax is incorrect.