Skip to content

Unhandled fetch failures cause gateway crash #5199

@ma12cu5

Description

@ma12cu5

Description

The gateway crashes with \Unhandled promise rejection: TypeError: fetch failed\ when network requests timeout or fail.

Steps to Reproduce

  1. Run gateway normally
  2. Network briefly drops or API times out
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions