Skip to content

Gateway crashes on unhandled fetch failure (TypeError: fetch failed) #5152

@skywalkercyt

Description

@skywalkercyt

Description

Gateway crashes when a network request fails, instead of handling the error gracefully.

Error Log

19:46:07 [clawdbot] Non-fatal rejection (continuing): fetch failed
19:46:07 [clawdbot] Unhandled promise rejection: TypeError: fetch failed at node:internal/deps/undici/undici:13510:13

Context

  • The gateway was running normally (tick and health events working fine)
  • At 19:46:07, a fetch request failed (possibly to an LLM API, Telegram, or cron job like BibiGPT)
  • The promise rejection was not caught, causing the gateway to crash

Expected Behavior

Network failures should be caught and handled gracefully. The gateway should:

  1. Log the error
  2. Retry if appropriate
  3. Continue running (not crash)

Environment

  • OS: Windows Server 2019
  • Node: v22.18.0
  • Clawdbot version: 2026.1.24-3

Additional Context

This happened in the morning when opening the gateway. There was also a separate tool_use_id not found error earlier, but this fetch failure appears to be a different issue - pure network error handling.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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