-
-
Notifications
You must be signed in to change notification settings - Fork 69.6k
Telegram media group fetch intermittently fails on Node.js 25 (undici IPv6) #36010
Copy link
Copy link
Open
Description
Description
Intermittent TypeError: fetch failed when downloading photos from Telegram media groups (multiple photos sent at once). Single photo messages work fine.
Environment
- OpenClaw: 2026.3.1 (stable)
- Node.js: 25.6.1 (arm64, macOS 26.3)
- OS: macOS Sequoia 26.3 (Apple Silicon)
Error
[telegram] media group: skipping photo that failed to fetch: MediaFetchError: Failed to fetch media from https://api.telegram.org/file/bot<token>/photos/file_XXXX.jpg: TypeError: fetch failed
Frequency
- 5 failures across 8 days (Feb 26 – Mar 4)
- Only happens with media groups (multiple photos), never single photo messages
- 1 out of N photos in a group fails, rest download fine
Root cause suspicion
Node.js 25 undici HTTP client + IPv6 resolution. When multiple concurrent fetches hit api.telegram.org, one occasionally fails due to IPv6/IPv4 race condition.
Workarounds applied (partial fix)
/etc/hosts:149.154.166.110 api.telegram.org(force IPv4)NODE_OPTIONS=--dns-result-order=ipv4firstin LaunchAgent plist- Patched all
ssrf-*.jsfiles: addedfamily: 4to dispatcher options - These reduced frequency but didn't eliminate it completely
Related
- [Bug]: Telegram photo/media download fails in Openclaw bot with MediaFetchError: TypeError: fetch failed #24854 (IPv6 media download bug)
Suggestion
Consider adding a retry mechanism for media group photo downloads — if one fetch fails, retry once before skipping. This would eliminate the user-visible error for intermittent network issues.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Give feedbackNo fields configured for issues without a type.