Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Gateway crashes on unhandled fetch rejection (TypeError: fetch failed) #2895

@ryuforthepeople

Description

@ryuforthepeople

Description

The gateway crashes completely when an outbound HTTP request fails (e.g., to an external API like Brave Search, Anthropic, or Deepgram). Instead of gracefully handling the error and reporting it to the user, it throws an unhandled promise rejection and the process exits.

Steps to Reproduce

  1. Run the gateway normally
  2. Trigger an action that makes an outbound fetch (e.g., web_search, API call)
  3. Have the fetch fail (network timeout, rate limit, DNS failure)
  4. Gateway crashes

Actual Behavior

[clawdbot] Unhandled promise rejection: TypeError: fetch failed
    at node:internal/deps/undici/undici:16416:13
    at processTicksAndRejections (node:internal/process/task_queues:103:5)

Process exits. Requires manual restart.

Expected Behavior

The gateway should catch the failed fetch, log the error, and return a user-friendly message like: "The requested action failed due to a network error. Please try again."

The gateway should never crash on a failed HTTP request.

Environment

  • Clawdbot version: 2026.1.24-3
  • OS: Alpine Linux (x64)
  • Node: v24.13.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions