🦞OpenClaw Guide
Telegram

Telegram Connection Failed — WebSocket Error 1006

Telegram messages fail with WebSocket 1006 errors. Usually an IPv4/IPv6 issue on your VPS.

⚠️ The Problem

Your OpenClaw gateway starts, but Telegram messages fail with errors like: `` WebSocket closed with code 1006 (no reason given) telegram sendMessage failed: Network request for 'sendMessage' failed! TypeError: fetch failed `` The bot might receive your messages but can't send replies back.

🔍 Why This Happens

This is almost always an IPv4/IPv6 address selection issue. Many VPS providers (Hostinger, DigitalOcean, etc.) have IPv6 configured but not fully working. Node.js sometimes tries IPv6 first, and when it fails, you get these cryptic errors. Other possible causes: - Telegram API temporarily unreachable - Firewall blocking outgoing connections - DNS resolution issues

The Fix

Add the autoSelectFamily option to your config. Edit ~/.openclaw/openclaw.json:

json
{  "channels": {    "telegram": {      "network": {        "autoSelectFamily": true      }    }  }}

Or set it via CLI:

bash
openclaw config set channels.telegram.network.autoSelectFamily true

Then restart the gateway:

bash
openclaw gateway restart

To verify the fix, test that your server can reach Telegram:

bash
curl -4 -I https://api.telegram.orgcurl -6 -I https://api.telegram.org

If -6 fails but -4 works, the autoSelectFamily fix is correct.

🔥 Your AI should run your business, not just answer questions.

We'll show you how.$97/mo (going to $197 soon)

Join Vibe Combinator →

📋 Quick Commands

CommandDescription
openclaw config set channels.telegram.network.autoSelectFamily trueEnable auto address family selection
openclaw gateway restartApply the change
openclaw channels status --probeCheck Telegram connection

Related Issues

🐙 Your AI should run your business.

Weekly live builds + template vault. We'll show you how to make AI actually work.$97/mo (going to $197 soon)

Join Vibe Combinator →

Still stuck?

Join our Discord community for real-time help.

Join Discord