Hi everyone,
I’m running into a very persistent issue with the n8n Telegram Trigger that I have been unable to solve after extensive troubleshooting.
My Setup:
- n8n running in a Docker container.
- Hosted on a Hetzner Cloud server (Ubuntu).
- Using a Caddy reverse proxy for SSL.
The Problem: When I try to activate the Telegram Trigger node, I immediately get the following error: Bad Request: bad webhook: Failed to resolve host: Temporary failure in name resolution
The Paradox / What I’ve Already Tried: The strange part is that the container’s networking seems to be working correctly. The problem appears to be specific to the n8n process itself, not the underlying container OS.
Here is what has already been verified and attempted:
- Correct Docker Installation: The initial Docker installation was a Snap package. This has been completely removed and Docker has been reinstalled from the official
aptrepository. - General DNS Works: From inside the n8n container,
ping google.comworks perfectly. - Specific Domain DNS Works: From inside the n8n container,
ping my-webhook-domain.duckdns.orgalso resolves the correct IP and works perfectly. - Hairpin NAT / Loopback: We tried to mitigate any loopback issues by adding an
extra_hostsentry to thedocker-compose.yamlto map the domain tohost-gateway. This did not solve the issue. - Forced DNS: We tried forcing the n8n service to use public DNS servers (
8.8.8.8and1.1.1.1) directly in thedocker-compose.yaml. This did not solve the issue. - n8n Environment Variables: We have double-checked and simplified the environment variables, using the correct
N8N_WEBHOOK_URL. - Hetzner Firewall: I have confirmed that there is no active Hetzner Cloud Firewall applied to this server.
- Bypassed Proxy: As a final diagnostic test, we tried bypassing Caddy entirely by exposing port
5678and setting the webhook URL tohttp://<SERVER_IP>:5678/. This still resulted in the exact sameFailed to resolve hosterror.
Despite all of this, the name resolution seems to fail only for the n8n process when the trigger is activated.
Does anyone have an idea what could be causing this at a deeper level within the Hetzner/Ubuntu/Docker environment? I’m out of ideas.
Here is my docker-compose.yaml:
services:
n8n:
image: n8nio/n8n
restart: unless-stopped
environment:
- N8N_PATH=/n8n
- N8N_EDITOR_BASE_URL=...
- N8N_PUBLIC_API_BASE_URL=...
- WEBHOOK_URL=...
- N8N_PROTOCOL=...
- N8N_HOST=...
volumes:
- ~/.n8n:/home/node/.n8n
- /data:/data
extra_hosts:
- "...duckdns.org:host-gateway"
dns:
- 8.8.8.8
- 1.1.1.1
caddy:
image: caddy:2
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- caddy_data:/data
- caddy_config:/config
volumes:
caddy_data:
caddy_config:
My Caddyfile:
...duckdns.org {
handle /n8n* {
uri strip_prefix /n8n
reverse_proxy n8n:5678
}
handle {
respond "404 not found" 404
}
header {
X-Content-Type-Options nosniff
}
}
