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

ETIMEDOUT error when sending http request to some domains/subdomains #52075

Closed
tayweekiam opened this issue Mar 13, 2024 · 1 comment
Closed

Comments

@tayweekiam
Copy link

tayweekiam commented Mar 13, 2024

Version

v20.10.0

Platform

Linux fedora 6.7.9-200.fc39.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Mar 6 19:35:04 UTC 2024 x86_64 GNU/Linux

Subsystem

net

What steps will reproduce the bug?

Here is a code snippet to reproduce the bug on the platform specified:

const https = require('https');

const botToken = 'even-a-valid-token-doesnt-work';
const method = 'sendMessage';

https.get(`https://api.telegram.org/bot${botToken}/${method}`).on('error', (err) => {
  console.log('error: ', err);
});

How often does it reproduce? Is there a required condition?

It happens only for some domain/subdomain. For example the problem occurs when making a request with the telegram bot API subdomain api.telegram.org

What is the expected behavior? Why is that the expected behavior?

There shouldn't be any errors.

What do you see instead?

The error below was thrown:

Error:  AggregateError
    at internalConnectMultiple (node:net:1114:18)
    at internalConnectMultiple (node:net:1177:5)
    at Timeout.internalConnectMultipleTimeout (node:net:1687:3)
    at listOnTimeout (node:internal/timers:575:11)
    at process.processTimers (node:internal/timers:514:7) {
  code: 'ETIMEDOUT',
  [errors]: [
    Error: connect ETIMEDOUT 149.154.167.220:443
        at createConnectionError (node:net:1634:14)
        at Timeout.internalConnectMultipleTimeout (node:net:1685:38)
        at listOnTimeout (node:internal/timers:575:11)
        at process.processTimers (node:internal/timers:514:7) {
      errno: -110,
      code: 'ETIMEDOUT',
      syscall: 'connect',
      address: '149.154.167.220',
      port: 443
    },
    Error: connect ENETUNREACH 2001:67c:4e8:f004::9:443 - Local (:::0)
        at internalConnectMultiple (node:net:1176:40)
        at Timeout.internalConnectMultipleTimeout (node:net:1687:3)
        at listOnTimeout (node:internal/timers:575:11)
        at process.processTimers (node:internal/timers:514:7) {
      errno: -101,
      code: 'ENETUNREACH',
      syscall: 'connect',
      address: '2001:67c:4e8:f004::9',
      port: 443
    }
  ]
}

Additional information

I tried to ping api.telegram.org and there wasn't any problem.

I found this issue (#47822) and was able to workaround the problem by disabling family auto selection but I am raising this issue in case it can be helpful for the maintainers.

My intuition tells me that this issue is related to some configuration in the OS but I am not sure, do advise if possible!

Thank you!

@tayweekiam tayweekiam changed the title ETIMEDOUT error for some domain ETIMEDOUT error when sending a request to some domain/subdomains Mar 13, 2024
@tayweekiam tayweekiam changed the title ETIMEDOUT error when sending a request to some domain/subdomains ETIMEDOUT error when sending http request to some domains/subdomains Mar 13, 2024
@tayweekiam
Copy link
Author

Nevermind, seems like the fix is not backported to v20.x yet, I will keep a lookout for it, thanks

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

No branches or pull requests

1 participant