Skip to content

Unhelpful error message #325

Description

@jgeewax

I'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?

Activity

  1. jgeewax commented on Dec 6, 2014

    @jgeewax
    ContributorAuthor

    (copied and pasted from someone else, I'll be asking the reporter to come add more detail here)

  2. stephenplusplus commented on Dec 15, 2014

    @stephenplusplus
    Contributor

    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.

  3. added
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    and removed on Feb 2, 2015
  4. added this to the Core Stable milestone on Feb 2, 2015
  5. 31 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

🚨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.

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions