Skip to content

[Bug]: Gateway crashes on transient network failures (unhandled fetch rejection) #2272

@Morrvick

Description

@Morrvick

Summary
Gateway process crashes with an unhandled promise rejection when network connectivity is intermittent or unstable. Instead of catching and retrying failed fetch calls, the rejection bubbles up and terminates the process.

Steps to reproduce
Run gateway on an unstable network connection (e.g., mobile hotspot with variable connectivity)
Send/receive messages via Telegram
Wait for a network hiccup (brief connectivity loss or high latency spike)
Gateway crashes
Expected behavior
Network failures should be caught and handled gracefully — retry with backoff, log a warning, or fail the specific operation without crashing the entire gateway process.

Actual behavior
Unhandled promise rejection crashes the gateway:

TypeError: fetch failed
at node:internal/deps/undici/undici:14902:13
at processTicksAndRejections (node:internal/process/task_queues:105:5)
Systemd auto-restarts the service, but this causes session interruption and repeated restarts (68+ restarts observed in ~2 hours on an unstable connection).

Environment
Clawdbot version: 2026.1.24-3
OS: Linux 6.17.0-8-generic (Ubuntu, x64)
Install method: npm -g
Node: v22.22.0

Logs or screenshots
Jan 26 09:43:58 node[13836]: [clawdbot] Unhandled promise rejection: TypeError: fetch failed
Jan 26 09:43:58 node[13836]: at node:internal/deps/undici/undici:14902:13
Jan 26 09:43:58 systemd[1123]: clawdbot-gateway.service: Main process exited, code=exited, status=1/FAILURE
Jan 26 09:43:58 systemd[1123]: clawdbot-gateway.service: Failed with result 'exit-code'.
Jan 26 09:44:28 systemd[1123]: clawdbot-gateway.service: Scheduled restart job, restart counter is at 61.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions