Open ongspxm opened 4 months ago
I have the same issue, I'm using node-vault to connect to a hashicorp vault. My colleagues have the same code working on their laptop, the same code worked for me before, but now I get:
AggregateError:
at internalConnectMultiple (node:net:1116:18)
at afterConnectMultiple (node:net:1680:7)
at TCPConnectWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
code: 'ETIMEDOUT',
[errors]: [
Error: connect ETIMEDOUT 35.92.220.35:8200
at createConnectionError (node:net:1643:14)
at Timeout.internalConnectMultipleTimeout (node:net:1702:38)
at listOnTimeout (node:internal/timers:575:11)
at processTimers (node:internal/timers:514:7) {
errno: -110,
code: 'ETIMEDOUT',
syscall: 'connect',
address: '35.92.220.35',
port: 8200
},
Error: connect EHOSTUNREACH 64:ff9b::235c:dc23:8200
at createConnectionError (node:net:1643:14)
at afterConnectMultiple (node:net:1673:16)
at TCPConnectWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
errno: -113,
code: 'EHOSTUNREACH',
syscall: 'connect',
address: '64:ff9b::235c:dc23',
port: 8200
}
]
}
node --version
v21.7.0
I'm on MacOS, Sonoma 14.4
Update: It was my ISP, not a node issue. I connected over personal hotspot instead of wifi and then the call to the same url worked.
sh-3.2$ node --version v21.6.2 sh-3.2$ cat test.js https = require('https') https.get('https://api.telegram.org/botXXXYYYZZZ/getMe', (res)=>{ res.on('data', console.log); }); sh-3.2$ node test.js <Buffer 7b 22 6f 6b 22 3a 66 61 6c 73 65 2c 22 65 72 72 6f 72 5f 63 6f 64 65 22 3a 34 30 34 2c 22 64 65 73 63 72 69 70 74 69 6f 6e 22 3a 22 4e 6f 74 20 46 6f ... 5 more bytes> sh-3.2$ node test.js <Buffer 7b 22 6f 6b 22 3a 66 61 6c 73 65 2c 22 65 72 72 6f 72 5f 63 6f 64 65 22 3a 34 30 34 2c 22 64 65 73 63 72 69 70 74 69 6f 6e 22 3a 22 4e 6f 74 20 46 6f ... 5 more bytes> sh-3.2$ node test.js <Buffer 7b 22 6f 6b 22 3a 66 61 6c 73 65 2c 22 65 72 72 6f 72 5f 63 6f 64 65 22 3a 34 30 34 2c 22 64 65 73 63 72 69 70 74 69 6f 6e 22 3a 22 4e 6f 74 20 46 6f ... 5 more bytes> sh-3.2$ node test.js <Buffer 7b 22 6f 6b 22 3a 66 61 6c 73 65 2c 22 65 72 72 6f 72 5f 63 6f 64 65 22 3a 34 30 34 2c 22 64 65 73 63 72 69 70 74 69 6f 6e 22 3a 22 4e 6f 74 20 46 6f ... 5 more bytes> sh-3.2$ node test.js <Buffer 7b 22 6f 6b 22 3a 66 61 6c 73 65 2c 22 65 72 72 6f 72 5f 63 6f 64 65 22 3a 34 30 34 2c 22 64 65 73 63 72 69 70 74 69 6f 6e 22 3a 22 4e 6f 74 20 46 6f ... 5 more bytes> sh-3.2$ node test.js <Buffer 7b 22 6f 6b 22 3a 66 61 6c 73 65 2c 22 65 72 72 6f 72 5f 63 6f 64 65 22 3a 34 30 34 2c 22 64 65 73 63 72 69 70 74 69 6f 6e 22 3a 22 4e 6f 74 20 46 6f ... 5 more bytes> sh-3.2$ node test.js <Buffer 7b 22 6f 6b 22 3a 66 61 6c 73 65 2c 22 65 72 72 6f 72 5f 63 6f 64 65 22 3a 34 30 34 2c 22 64 65 73 63 72 69 70 74 69 6f 6e 22 3a 22 4e 6f 74 20 46 6f ... 5 more bytes> sh-3.2$ node test.js <Buffer 7b 22 6f 6b 22 3a 66 61 6c 73 65 2c 22 65 72 72 6f 72 5f 63 6f 64 65 22 3a 34 30 34 2c 22 64 65 73 63 72 69 70 74 69 6f 6e 22 3a 22 4e 6f 74 20 46 6f ... 5 more bytes> sh-3.2$ node test.js <Buffer 7b 22 6f 6b 22 3a 66 61 6c 73 65 2c 22 65 72 72 6f 72 5f 63 6f 64 65 22 3a 34 30 34 2c 22 64 65 73 63 72 69 70 74 69 6f 6e 22 3a 22 4e 6f 74 20 46 6f ... 5 more bytes>
on macos 14.3.1 intel with node 21.6.2, I could not reproduce
I'm experiencing the same issue with net.connect()
inside a Docker container (node:21 image). My docker does not have IPv6 enabled.
The issue seems to be related to a dual-stack IPv4+IPv6 host. In my case it's the WHOIS server at whois.nic.io
. If I force net.connect() to use IPv4-only { family: 4 }
the problem does not occur.
I would expect the connection be successful using IPv4 if IPv6 fails, but it seems if I let it try IPv6 then IPv4 fails too. Like I mentioned, when I force net.connect() to not use IPv6 it's all fine.
Details
im trying to use the telegram bot api. but it doesnt work reliably for me when i try accessing the same url in curl or browser it can get it reliably
but if i run the same code 9 out of 10 times, i get the following error:
and there will be some occasion that it works (just retrying the same code multiple times)
tried the timeout options and it didnt work too
Node.js version
v21.6.1
Example code
No response
Operating system
linux
Scope
library
Module and version
Not applicable.