N8n on Hugging Face Space: getaddrinfo ENOTFOUND api.telegram.org Connection Error

Hello Hugging Face Community,

I’m encountering a persistent network connection issue with my n8n instance hosted on a Hugging Face Space, and I’m hoping for some guidance.

Problem Description: My n8n workflow, which includes a node attempting to interact with the Telegram Bot API, is consistently failing with connection errors. The primary and most specific error I’m seeing repeatedly is:

The connection cannot be established, this usually occurs due to an incorrect host (domain) value getaddrinfo ENOTFOUND api.telegram.org

This error suggests a DNS resolution failure for api.telegram.org specifically from within the Hugging Face Space environment.

Context:

  • Application: n8n
  • Hosting: Hugging Face Spaces
  • Goal: The n8n workflow needs to make outbound HTTP requests to api.telegram.org.

Troubleshooting Steps Taken:

  1. Verified Target Host: I’ve meticulously checked the api.telegram.org URL in my n8n Telegram node configuration for any typos, and it appears correct.
  2. External Reachability: I’ve confirmed that api.telegram.org is perfectly reachable and resolvable from my local machine (e.g., via ping and web browser).
  3. Wait and Retry: I’ve waited for some time and retried running the workflow, but the error persists.
  4. Space Restart/Redeploy: I have tried restarting/re-deploying my Hugging Face Space to clear any transient environment issues.
  5. Hugging Face Status Page: I’ve checked the Hugging Face status page and haven’t found any reported widespread network issues.

Given that the error is explicitly getaddrinfo ENOTFOUND api.telegram.org and my Space is unable to resolve this common domain, it seems like there might be an underlying DNS or network configuration issue specific to my Space’s environment.

Has anyone else experienced similar ENOTFOUND errors from their Hugging Face Spaces when trying to connect to standard external APIs like Telegram? Are there any specific network settings or diagnostic steps I can perform within the Space itself, or any known limitations that might cause this?

Any insights or suggestions would be greatly appreciated!

Thank you for your time and help.

4 Likes

It seems that the connection is not working at all.

No connection. HTTPSConnectionPool(host='api.telegram.org', port=443): Max retries exceeded with url: / (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7f75e0a37eb0>: Failed to resolve 'api.telegram.org' ([Errno -5] No address associated with hostname)"))
No connection. HTTPConnectionPool(host='api.telegram.org', port=80): Max retries exceeded with url: / (Caused by NameResolutionError("<urllib3.connection.HTTPConnection object at 0x7f75e09df7c0>: Failed to resolve 'api.telegram.org' ([Errno -5] No address associated with hostname)"))

BTW, to OpanAI with HTTP case:

/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py:1097: InsecureRequestWarning: Unverified HTTPS request is being made to host 'api.openai.com'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings
  warnings.warn(
Connected to https://api.openai.com, but the server returned an error. Status code: 421

Same issue here. Everything was working fine for a month, but crashed few days ago

1 Like

Thanks John.
Does this suggest issue is with Huggingface?

1 Like

That is exactly what happened to my space.

1 Like

Yeah. I’m not sure if this is a problem or normal regulation, but it can only be resolved on the Hugging Face side. The DNS server referenced from Hugging Face Spaces cannot resolve the name for that site. Alternatively, you may need to consider using a proxy.

I’m not sure where is the appropriate place to raise issues related to server network settings like this. General support: website@huggingface.co

1 Like

Same issue here recently. Sometimes it can trigger the receive message flow, but the send messages are not working either.

1 Like

Support’s answer was to upgrade space’s hardware, subscribe to Pro and see if the issue persists. I guess they don’t care.

2 Likes

For now, I’ve reported it on HF Discord’s Feedback.

3 Likes