Skip to content

Unhandled promise rejection (rejection id: 2): Error: connect EINVAL 0.0.31.182:443 #1

New issue

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

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

Already on GitHub? # to your account

Open
szotsaki opened this issue Mar 12, 2018 · 2 comments

Comments

@szotsaki
Copy link

I followed the instructions given and node fetch-submissions.js gives me the following:

(node:18346) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: connect EINVAL 0.0.31.182:443 - Local (0.0.0.0:0)
(node:18346) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

host gives me:

$> host.leetcode.com
leetcode.com has address 104.27.161.90
leetcode.com has address 104.27.160.90
leetcode.com has IPv6 address 2400:cb00:2048:1::681b:a15a
leetcode.com has IPv6 address 2400:cb00:2048:1::681b:a05a

Pinging it:

$> ping leetcode.com
PING leetcode.com(2400:cb00:2048:1::681b:a05a (2400:cb00:2048:1::681b:a05a)) 56 data bytes
64 bytes from 2400:cb00:2048:1::681b:a05a (2400:cb00:2048:1::681b:a05a): icmp_seq=1 ttl=56 time=2.75 ms

node version: v8.9.4

@szotsaki
Copy link
Author

Catching the error gives me:

 Error: connect EINVAL 0.0.31.182:443 - Local (0.0.0.0:0)
    at Object._errnoException (util.js:1022:11)
    at _exceptionWithHostPort (util.js:1044:20)
    at internalConnect (net.js:971:16)
    at GetAddrInfoReqWrap.emitLookup [as callback] (net.js:1106:7)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:97:10)
  code: 'EINVAL',
  errno: 'EINVAL',
  syscall: 'connect',
  address: '0.0.31.182',

  ...

  currentUrl: 'https://8118/https://leetcode.com/api/problems/all/'

@szotsaki
Copy link
Author

Solved by temporarily turning off proxy (it's not handled apparently):

http_proxy= https_proxy= node fetch-submissions.js

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant