leetcode-downloader icon indicating copy to clipboard operation
leetcode-downloader copied to clipboard

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

Open szotsaki opened this issue 7 years ago • 2 comments

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 avatar Mar 12 '18 07:03 szotsaki

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 avatar Mar 12 '18 08:03 szotsaki

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

http_proxy= https_proxy= node fetch-submissions.js

szotsaki avatar Mar 12 '18 08:03 szotsaki