Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnknownEndpoint exception not thrown with Node14 #3393

Closed
workeitel opened this issue Aug 10, 2020 · 1 comment · Fixed by #3396
Closed

UnknownEndpoint exception not thrown with Node14 #3393

workeitel opened this issue Aug 10, 2020 · 1 comment · Fixed by #3396
Assignees
Labels
bug This issue is a bug.

Comments

@workeitel
Copy link
Contributor

Describe the bug

Node 14 changed the value of error.errno to be a numeric value: nodejs/node#28140

That impacts the translation of the UnknownEndpoint exception:

if (err.code === 'NetworkingError' && err.errno === 'ENOTFOUND') {

Is the issue in the browser/Node.js?
nodejs 14

If on Node.js, are you running this on AWS Lambda?

no

Details of the browser/Node.js version

$ node -v
v14.7.0

SDK version number
master branch HEAD

To Reproduce (observed behavior)

$ node14
> process.version
'v14.7.0'
> const AWS = require(".");
> ec2.describeInstances({}).promise().then(e => console.log(e), e => console.log(e));
> Error: getaddrinfo ENOTFOUND something.invalid
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26)
    at GetAddrInfoReqWrap.callbackTrampoline (internal/async_hooks.js:129:14) {
  errno: -3008,
  code: 'NetworkingError',
  syscall: 'getaddrinfo',
  hostname: 'something.invalid',
  region: 'us-east-1',
  retryable: true,
  time: 2020-08-10T11:34:15.386Z
}
$ node12
> process.version
'v12.18.3'
> const AWS = require(".");
undefined
> const ec2 = new AWS.EC2({ region: "us-east-1", endpoint: "https://something.invalid" });
undefined
> ec2.describeInstances({}).promise().then(e => console.log(e), e => console.log(e));
Promise { <pending> }
> UnknownEndpoint: Inaccessible host: `something.invalid'. This service may not be available in the `us-east-1' region.
    at Request.ENOTFOUND_ERROR (/Volumes/unix/aws-sdk-js/lib/event_listeners.js:501:46)
    at Request.callListeners (/Volumes/unix/aws-sdk-js/lib/sequential_executor.js:106:20)
    at Request.emit (/Volumes/unix/aws-sdk-js/lib/sequential_executor.js:78:10)
    at Request.emit (/Volumes/unix/aws-sdk-js/lib/request.js:688:14)
    at ClientRequest.error (/Volumes/unix/aws-sdk-js/lib/event_listeners.js:339:22)
    at ClientRequest.<anonymous> (/Volumes/unix/aws-sdk-js/lib/http/node.js:96:19)
    at ClientRequest.emit (events.js:315:20)
    at ClientRequest.EventEmitter.emit (domain.js:483:12)
    at TLSSocket.socketErrorListener (_http_client.js:426:9)
    at TLSSocket.emit (events.js:315:20) {
  code: 'UnknownEndpoint',
  region: 'us-east-1',
  hostname: 'something.invalid',
  retryable: true,
  originalError: Error: getaddrinfo ENOTFOUND something.invalid
      at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26)
      at GetAddrInfoReqWrap.callbackTrampoline (internal/async_hooks.js:120:14) {
    errno: 'ENOTFOUND',
    code: 'NetworkingError',
    syscall: 'getaddrinfo',
    hostname: 'something.invalid',
    region: 'us-east-1',
    retryable: true,
    time: 2020-08-10T11:35:54.953Z
  },
  time: 2020-08-10T11:35:54.953Z
}

Expected behavior
Node14 throws a UnknownEndpoint exception as well

@workeitel workeitel added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Aug 10, 2020
@AllanZhengYP AllanZhengYP self-assigned this Aug 12, 2020
@AllanZhengYP
Copy link
Contributor

Hi @workeitel Thank you for bringing it up. I will post a PR to fix this shortly

@ajredniwja ajredniwja removed the needs-triage This issue or PR still needs to be triaged. label Aug 12, 2020
AllanZhengYP added a commit to AllanZhengYP/aws-sdk-js that referenced this issue Aug 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants