openclaw - 💡(How to fix) Fix [Bug][P1] Frequent internal SIGTERM self-restarts (14 times in 2 days) + deliver silent failures (orphan delivers) [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#63100Fetched 2026-04-09 07:58:35
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Participants

The openclaw gateway process receives frequent SIGTERM signals from within the openclaw framework itself (not from external sources), causing 14 restarts over 2 days. This leads to:

  1. Channel registration loss during restart window (7-12s), causing message tool failures
  2. Deliver orphans - deliver pipeline calls that never complete sending (2/197 = 1.0%)
  3. No graceful shutdown - in-progress operations are terminated immediately

Error Message

  1. Why do deliver calls sometimes silently fail without error logs (orphan delivers)?
  2. Deliver failures should produce error logs, not fail silently

Root Cause

The openclaw gateway process receives frequent SIGTERM signals from within the openclaw framework itself (not from external sources), causing 14 restarts over 2 days. This leads to:

  1. Channel registration loss during restart window (7-12s), causing message tool failures
  2. Deliver orphans - deliver pipeline calls that never complete sending (2/197 = 1.0%)
  3. No graceful shutdown - in-progress operations are terminated immediately
RAW_BUFFERClick to expand / collapse

Description

The openclaw gateway process receives frequent SIGTERM signals from within the openclaw framework itself (not from external sources), causing 14 restarts over 2 days. This leads to:

  1. Channel registration loss during restart window (7-12s), causing message tool failures
  2. Deliver orphans - deliver pipeline calls that never complete sending (2/197 = 1.0%)
  3. No graceful shutdown - in-progress operations are terminated immediately

Environment

  • OpenClaw version: 2026.4.2
  • Node.js: 22.22.1
  • OS: Ubuntu (cloud VM), process managed by systemd --user (but NOT registered as a .service)

SIGTERM Source Investigation

We thoroughly investigated the SIGTERM source:

CheckResult
Parent processPID 1247 = /usr/lib/systemd/systemd --user\
\systemctl --user status openclaw\Unit not found (not a registered service)
\crontab -l\Only Tencent Cloud stargate task, unrelated
\systemctl list-timers --all\17 system timers, none openclaw-related
\dmesg\ OOMNo OOM kill records
auditdNot installed

Conclusion: SIGTERM originates from openclaw's internal mechanism, not from external cron/timer/manual operations.

We also verified that WebSocket 4009 disconnects do NOT trigger SIGTERM (48 disconnects vs 14 SIGTERMs, no time correlation).

SIGTERM Timeline (14 events)

TimeIntervalNew PID
Apr 7 11:13:56-171535
Apr 7 18:47:237.6h283918
Apr 7 19:36:3549min296724
Apr 7 20:34:1758min311359
Apr 7 21:17:1243min323913
Apr 7 21:20:373min327347
Apr 7 22:13:0352min341828
Apr 7 22:14:341.5min344708
Apr 8 07:30:519.3h487342
Apr 8 07:48:5218min495368
Apr 8 07:54:265.5min506229
Apr 8 08:35:1241min521054
Apr 8 11:57:473.4h584362
Apr 8 11:59:041.3min587343

4 instances have extremely short intervals (1-5.5 minutes).

Deliver Orphan Evidence

Out of 197 deliver calls, 2 had no corresponding \Sent markdown chunk:

  1. 2026-04-07T22:10:51 - \deliver called, kind: tool\ -> no Sent -> SIGTERM at 22:13:03 (132s later)
  2. 2026-04-08T12:49:59 - \deliver called, kind: final\ -> no Sent (no nearby SIGTERM)

We also verified: all 14 SIGTERMs did NOT directly interrupt an in-progress deliver (nearby delivers had completed Sent).

Questions for Maintainers

  1. What internal operations trigger gateway SIGTERM self-restart? (/reset? /compact? agent shell commands?)
  2. Is there a mechanism to add graceful shutdown (wait for in-progress delivers to complete)?
  3. Why do deliver calls sometimes silently fail without error logs (orphan delivers)?

Suggested Improvements

  1. Add graceful shutdown: wait for in-progress deliver/HTTP calls before terminating
  2. Log the reason for SIGTERM self-restart (which internal operation triggered it)
  3. Deliver failures should produce error logs, not fail silently
  4. After restart, block agent requests until channel plugin registration is confirmed complete

extent analysis

TL;DR

The OpenClaw gateway process can be stabilized by implementing a graceful shutdown mechanism to wait for in-progress deliver and HTTP calls before terminating, and logging the reason for SIGTERM self-restart.

Guidance

  • Investigate the internal operations that trigger the gateway SIGTERM self-restart, such as /reset or /compact agent shell commands, to understand the root cause of the issue.
  • Implement a mechanism to add a graceful shutdown, allowing in-progress delivers to complete before terminating the process, to prevent channel registration loss and deliver orphans.
  • Modify the deliver call logic to produce error logs when failures occur, instead of failing silently, to improve debugging and issue tracking.
  • Consider adding a delay after restart to block agent requests until channel plugin registration is confirmed complete, to prevent message tool failures.

Example

No specific code snippet can be provided without knowing the internal implementation of the OpenClaw framework, but a possible approach to implement a graceful shutdown could involve using a callback mechanism to wait for in-progress delivers to complete before terminating the process.

Notes

The provided information suggests that the SIGTERM signals originate from within the OpenClaw framework itself, but the exact internal operations triggering these signals are unknown. Further investigation and debugging are necessary to determine the root cause of the issue.

Recommendation

Apply a workaround by implementing a graceful shutdown mechanism and logging the reason for SIGTERM self-restart, as this will help stabilize the OpenClaw gateway process and provide valuable insights into the root cause of the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING