GeezerVison is showing github.com — Unhelpful error message · Issue #325 · googleapis/google-cloud-node
Unhelpful error message #325Labels 🚨This issue needs some love.triage meI really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns. DescriptionI'm using gcloud-node and yesterday my code worked, today it doesn't work anymore. The problem is that the only error message I am getting is the following:
{ [Error: getaddrinfo ENOTFOUND] code: 'ENOTFOUND', errno: 'ENOTFOUND', syscall: 'getaddrinfo' }
It turns out that this was caused by me (I've moved the initialization with project id and key file name to a place where it apparently has no effect).
What did you expect to happen?
Better error message! Which address are you trying to resolve? Any likely causes that you can think of? Activityjgeewax commented on Dec 6, 2014 ContributorAuthor More actions (copied and pasted from someone else, I'll be asking the reporter to come add more detail here) stephenplusplus commented on Dec 15, 2014 I ran into this while testing out GAE dev + gcloud for #328. This error comes from https://github.com/stephenplusplus/google-service-account/blob/v1.0.3/connection.js#L80:
if (/*G[AC]E*/!this.keyFile && !this.credentials)
return request({
method: "get",
uri: METADATA_TOKEN_URL,
headers: {
"Metadata-Flavor": "Google"
},
json: true
}, function (err, res, body) {
if (err || !body.access_token) return callback(err)
var exp = new Date(Date.now() + body.expires_in * 1000)
callback(null, new Token(body.access_token, exp))
})
In gcloud, we didn't get a keyFilename or credentials object from the user, so we passed undefined values for them to google-service-account (GSA). To GSA, that's interpreted as "we're on GCE, where a user doesn't have to provide that information," so it pings the metadata server to get a token. When it gets an error that that endpoint doesn't exist, it just sends the error back to gcloud, which is then handed back to the user.
Long story short: #331 is a new PR that will listen specifically for that error and throw a more helpful error. added type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns. and removed on Feb 2, 2015
MetadataMetadata🚨This issue needs some love.triage meI really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns. DevelopmentNo branches or pull requestsIssue actions
|