[SOLVED] Telegram API timeouts - IPv4/IPv6 DNS resolution issue

Hi everyone,

I wanted to share a solution for Telegram API timeouts that started affecting my workflows in late July.

Problem Description:

  • Started experiencing consistent timeouts when calling Telegram APIs (both via Telegram node and HTTP Request node)

  • Error: The connection timed out, consider setting the 'Retry on Fail' option in the node settings

  • Direct curl commands from terminal worked perfectly fine

  • Issue occurred on OVH Kimsufi server

What I tried (that didn’t work):

  1. Changing Telegram API keys - same timeout issues (topic: Access bot token for telegram trigger to coonnect )

  2. Updating to [email protected] as suggested in topic: Performance problems with the 1.105.x and 1.106.0 releases - #29 by umnz - no improvement

  3. Using HTTP Request POST node instead of Telegram node - same timeout errors

Solution: Set the Node.js DNS resolution to prefer IPv4:

export NODE_OPTIONS="--dns-result-order=ipv4first"

After applying this setting, all Telegram API calls work instantly without any timeout issues. I think the issue was related to Node.js DNS resolution order. Probably, on some hosting providers like OVH, IPv6 resolution can be slow or problematic, causing timeouts in Node.js applications even when IPv4 connectivity works perfectly.

3 Likes

I’m certain this finding is going to help others, thank you for sharing!

i’ve spent 4h trying to understand the reason my basic telegram worklow was failing and timeouting and this solved it. thanks..