You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Datastore module for nodejs fails to use application-default-credentials or GOOGLE_APPLICATION_CREDENTIALS env variable.
Environment details
OS: macOS High Sierra 10.13.1 (17B48)
Node.js version: v6.11.5 | v8.1.2
npm version: 3.10.10
yarn version: 0.21.3
google-cloud-node version:
google-cloud/datastore: "^1.1.0"
gcloud version
Google Cloud SDK 178.0.0
beta 2017.09.15
bq 2.0.27
core 2017.10.30
gsutil 4.28
Steps to reproduce
setup gcloud via "gcloud init"
For failure with application-default-credentials
a. gcloud beta auth application-default login
b. command informs that ~/.config/gcloud/application_default_credentials.json has been created
c. all documentations suggests that datastore should work when user authenticate via gcloud
d. in node app:
import * as Datastore from "@google-cloud/datastore";
const datastore = new Datastore();
c. error returned in console
Cannot read property 'apiEndpoint' of undefined
For failure with GOOGLE_APPLICATION_CREDENTIALS env variable
a. create & download json service account key via google console
b. Set env variable
c. all documentations suggests that datastore should check env variable GOOGLE_APPLICATION_CREDENTIALS for path to the key file
d. in node app:
import * as Datastore from "@google-cloud/datastore";
const datastore = new Datastore();
c. error returned in console
Cannot read property 'apiEndpoint' of undefined
What works:
a. create & download json service account key via google console
d. in node app:
import * as Datastore from "@google-cloud/datastore";
const datastore = new Datastore({
keyFilename: '/some/path/to/key.json'
});
c. no error returned, datastore client works
Am I doing something wrong? Is that a correct behaviour?
This forces a developer to hardcode the path to credentials while in local dev.
The text was updated successfully, but these errors were encountered:
thefill
changed the title
Datastore client fails to instantiate in local functions-emulator
Datastore client fails to instantiate in local environment
Nov 19, 2017
stephenplusplus
changed the title
Datastore client fails to instantiate in local environment
Constructors require options object
Nov 19, 2017
Datastore module for nodejs fails to use application-default-credentials or GOOGLE_APPLICATION_CREDENTIALS env variable.
Environment details
Steps to reproduce
a. gcloud beta auth application-default login
b. command informs that ~/.config/gcloud/application_default_credentials.json has been created
c. all documentations suggests that datastore should work when user authenticate via gcloud
d. in node app:
a. create & download json service account key via google console
b. Set env variable
d. in node app:
a. create & download json service account key via google console
d. in node app:
Am I doing something wrong? Is that a correct behaviour?
This forces a developer to hardcode the path to credentials while in local dev.
The text was updated successfully, but these errors were encountered: