-
-
Notifications
You must be signed in to change notification settings - Fork 52.6k
Closed
Description
Description
Telegram media downloads (photos sent by users) fail with MediaFetchError: TypeError: fetch failed on hosts where IPv6 is not working.
Environment
- OpenClaw: 2026.2.21-2
- Node: v24.13.0
- OS: Ubuntu Linux (AWS EC2)
- Channel: Telegram
Symptoms
- All inbound Telegram photo attachments fail to download
- Error in logs:
MediaFetchError: Failed to fetch media from https://api.telegram.org/file/bot.../photos/file_XXX.jpg: TypeError: fetch failed - IPv4 connections to
api.telegram.orgsucceed, IPv6 fails (curl -4works,curl -6returns 000) - Node 24 defaults to IPv6-first (
happy eyeballs/verbatimDNS result order)
Attempted Workarounds
- Setting
NODE_OPTIONS=--dns-result-order=ipv4firstin the systemd service file — not respected for media fetch operations - The gateway process itself works fine (WebSocket, API calls) — only the media download path is affected
Expected Behavior
Media fetch should respect the Node DNS result order setting, or implement its own IPv4 fallback when IPv6 connections fail.
Suggested Fix
Either:
- Pass
family: 4as a fetch option when downloading Telegram files - Implement retry logic that falls back to IPv4 on connection failure
- Respect
NODE_OPTIONS=--dns-result-order=ipv4firstin the media fetch code path
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels