{"action":"created","issue":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/issues/1230","repository_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-node","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/issues/1230/labels{/name}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/issues/1230/comments","events_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/issues/1230/events","html_url":"https://github.com/GoogleCloudPlatform/gcloud-node/issues/1230","id":148272383,"number":1230,"title":"Can't connect to local Datastore Emulator","user":{"login":"sebelga","id":2854616,"avatar_url":"https://avatars.githubusercontent.com/u/2854616?v=3","gravatar_id":"","url":"https://api.github.com/users/sebelga","html_url":"https://github.com/sebelga","followers_url":"https://api.github.com/users/sebelga/followers","following_url":"https://api.github.com/users/sebelga/following{/other_user}","gists_url":"https://api.github.com/users/sebelga/gists{/gist_id}","starred_url":"https://api.github.com/users/sebelga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebelga/subscriptions","organizations_url":"https://api.github.com/users/sebelga/orgs","repos_url":"https://api.github.com/users/sebelga/repos","events_url":"https://api.github.com/users/sebelga/events{/privacy}","received_events_url":"https://api.github.com/users/sebelga/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-14T07:14:18Z","updated_at":"2016-04-14T09:58:48Z","closed_at":null,"body":"Hi,\r\nI just updated from 0.29 to 30.3 and I can't connect to the Datastore emulator locally.\r\nThis is the steps I do:\r\n\r\nLaunch datastore with:\r\n```\r\ngcloud beta emulators datastore start --project=my-project-id --data-dir /path/to/some/dir --host-port localhost:8380\r\n```\r\nIt launches and tells me:\r\n```\r\nAPI endpoint: http://localhost:8380/datastore\r\n...\r\nDev App Server is now running\r\n``` \r\n\r\nInit gcloud-node with\r\n```\r\nvar config = {\r\n    projectId: 'my-project-id',\r\n    // keyFilename: '/some/path/to/credential.key.json', (tried both with and without)\r\n};\r\n\r\nvar gcloud = require('gcloud')(config);\r\nvar datastore = gcloud.datastore({\r\n        apiEndpoint: \"http://localhost:8380\"\r\n});\r\n```\r\nCreate an Entity\r\n```\r\nvar key = datastore.key('BlogPost');\r\ndatastore.save({\r\n    key: key,\r\n    data: {\r\n        title: 'Hello world'\r\n    }\r\n}, function(err) {\r\n    console.log(key.path);\r\n});\r\n```\r\n\r\nI receive this in err:\r\n\"{\"code\":503,\"metadata\":{\"_internal_repr\":{}}}\"\r\n\r\nI then changed the apiEndPoint to \"http://localhost:8380/datastore\" (as indicated when launching the emulator) but then it blocks the request (does not come into the callback) and in the terminal it says:\r\n\r\nE0414 09:11:46.140609000 4406423552 resolve_address_posix.c:126] getaddrinfo: nodename nor servname provided, or not know\r\n\r\nAs I said, I tried both with and withouth credentials without any difference.\r\n\r\nSome help would be greatly appreciated! :)\r\nThanks a lot for this great library.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/issues/comments/209859318","html_url":"https://github.com/GoogleCloudPlatform/gcloud-node/issues/1230#issuecomment-209859318","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/issues/1230","id":209859318,"user":{"login":"Thomas-T","id":669106,"avatar_url":"https://avatars.githubusercontent.com/u/669106?v=3","gravatar_id":"","url":"https://api.github.com/users/Thomas-T","html_url":"https://github.com/Thomas-T","followers_url":"https://api.github.com/users/Thomas-T/followers","following_url":"https://api.github.com/users/Thomas-T/following{/other_user}","gists_url":"https://api.github.com/users/Thomas-T/gists{/gist_id}","starred_url":"https://api.github.com/users/Thomas-T/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Thomas-T/subscriptions","organizations_url":"https://api.github.com/users/Thomas-T/orgs","repos_url":"https://api.github.com/users/Thomas-T/repos","events_url":"https://api.github.com/users/Thomas-T/events{/privacy}","received_events_url":"https://api.github.com/users/Thomas-T/received_events","type":"User","site_admin":false},"created_at":"2016-04-14T09:58:47Z","updated_at":"2016-04-14T09:58:47Z","body":"Hi,\r\n\r\nI had the same problem, it's due to the fact that the datastore emulator doesn't implements GRPC yet.\r\nyou can see the workaround in the changelog : \r\nhttps://github.com/GoogleCloudPlatform/gcloud-node/releases/tag/v0.30.0\r\n\r\n`Additionally, we are now using gRPC to give a performance boost to your Datastore calls. As of now, the gcloud SDK does not have a gRPC emulator, meaning if you wish to use a localhost backend instead of the upstream API, you will have to use the gcd.sh tool directly.`"}}