-
-
Notifications
You must be signed in to change notification settings - Fork 69.4k
Unhandled fetch failures cause gateway crash #5199
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Description
The gateway crashes with \Unhandled promise rejection: TypeError: fetch failed\ when network requests timeout or fail.
Steps to Reproduce
- Run gateway normally
- Network briefly drops or API times out
- Gateway crashes instead of handling the error gracefully
Expected Behavior
The gateway should catch fetch errors and retry, or at least not crash completely.
Actual Behavior
\
[clawdbot] Unhandled promise rejection: TypeError: fetch failed
at node:internal/deps/undici/undici:16416:13
at processTicksAndRejections (node:internal/process/task_queues:104:5)
\\
Gateway exits and requires restart.
Environment
- Clawdbot version: 2026.1.24-3
- Node.js: v25.4.0
- OS: Windows 11
- Channels: Telegram
Workaround
Using a watchdog script to auto-restart, but this causes brief service interruptions.
Suggestion
Add try/catch with retry logic around fetch calls, or use a fetch wrapper with automatic retries.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Fields
Give feedbackNo fields configured for issues without a type.