Skip to content

[Bug]: Doctor and spawn-broker cleanup fail when the host denies process-group signals (OpenShell sandbox) #198130

Closed

Description

@EmilienM

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

On Linux hosts that deny kill(2) with a negative PID, openclaw doctor --fix and spawn-broker shutdown fail because OpenClaw can never confirm that a process group is gone. OpenShell's sandbox does exactly this: its child seccomp filter returns EPERM for any process-group signal, including the signal 0 probe (NVIDIA/OpenShell#4130, crates/openshell-sandbox/src/linux/child_seccomp.rs). isChildProcessTreeAlive() and the spawn-broker groupGone() treat that EPERM as "still alive", so every wait runs to its deadline. In OpenClaw Enterprise this blocks Agent startup after an upgrade (openclaw/openclaw-enterprise#5706).

Steps to reproduce

  1. On x86_64 Linux, run a command under a seccomp filter that returns EPERM for kill() with a negative PID, the same rule OpenShell installs. A ~30-line Python wrapper that does this is in this comment (negpid_seccomp.py).
  2. From a source checkout with an isolated HOME: python3 -I negpid_seccomp.py node openclaw.mjs doctor --fix --non-interactive.

Expected behavior

Doctor completes, as it does without the filter. Process groups whose members have all exited are confirmed gone.

Actual behavior

Doctor exits 1 after about 12 s at "Preserve original state": Command cleanup could not confirm that owned work stopped. Closing a SpawnBrokerHost under the same filter fails after about 7.5 s with Spawn broker group cleanup could not be confirmed for pgid=… | ERR_SPAWN_BROKER_UNAVAILABLE | kill EPERM, which is the error OpenClaw Enterprise reports from Doctor's inspection cleanup. Older builds (2026.10.8) report Doctor processes remain unsettled … Doctor root process extinction could not be proven for the same reason.

OpenClaw version

2026.11.3 (main 664a791); also seen in OpenClaw Enterprise runtimes pinned to 513c127 and 2026.10.8

Operating system

Linux x86_64 (local host and OpenShift 4.22 sandbox pods)

Install method

Source checkout; OpenClaw Enterprise runtime image

Model

Not model-related

Provider / routing chain

Not provider-related

Logs

Doctor: Preserve original state (10s elapsed)
Doctor: maintenance release
Command cleanup could not confirm that owned work stopped
Spawn broker cleanup did not complete | Spawn broker group cleanup could not be confirmed for pgid=<broker> | ERR_SPAWN_BROKER_UNAVAILABLE | kill EPERM

Impact

Any OpenClaw running inside an OpenShell sandbox (or under another negative-PID kill deny) can't finish Doctor maintenance or shut the spawn broker down cleanly. OpenClaw Enterprise holds Agent startup until Doctor reports settled maintenance, so affected Agents cannot start after an upgrade.

Additional information

Signals to a single positive PID still work under the filter, which is how OpenClaw Enterprise's own wrapper already handles this case (it falls back to child.kill() on EPERM). A fix PR follows.

Activity

  1. added
    clawsweeper:intake:bug
    P1
    clawsweeper:linked-pr-open
    clawsweeper:no-new-fix-pr
    clawsweeper:source-repro
    impact:other
    issue-rating: 🦞 diamond lobster
    maturity:stable
    and removed
    clawsweeper:intake:bug
    on Nov 13, 2026
  2. clawsweeper commented on Nov 13, 2026

    @clawsweeper
    Contributor

    Codex review: this still needs some work.

    Summary
    Current main retains the reported failure path, and an open same-author fix PR explicitly closes this issue.

    Reproducibility: Current source establishes that permanent EPERM keeps both liveness probes unresolved until cleanup fails; the reporter supplies a filtered Linux reproduction, but this review ran no tests or live commands.

    Root-cause cluster
    Relationship: canonical
    Canonical: #198130
    Summary: The open draft PR targets the exact denied-group-signal failure; zombie-only broker cleanup overlaps the same owner but has a distinct cause.

    Members:

    Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

    Next step
    Review #198132 for filtered Linux Doctor completion and descendant cleanup, keeping this issue open until the fix merges.

    Review details

    Best possible solution:

    Restore reliable extinction confirmation and owned-child termination under denied group signals through the existing process owners.

    Do we have a high-confidence way to reproduce the issue?

    Current source establishes that permanent EPERM keeps both liveness probes unresolved until cleanup fails; the reporter supplies a filtered Linux reproduction, but this review ran no tests or live commands.

    Is this the best way to solve the issue?

    Fixing the shared process observation and signaling owners is appropriate, provided the linked PR proves real filtered cleanup while retaining genuine permission-error custody.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • The filtered Linux reproduction and proposed repair were not independently executed during this read-only issue review.
    • A repair must preserve uncertain cleanup for genuine permission failures and verify that live descendants are terminated, rather than merely suppressing the settlement error.

    Codex review notes: model internal, reasoning medium; reviewed against d1c800bf9518.

    Label changes

    Label changes:

    • add P1: The report describes blocked Doctor maintenance and post-upgrade agent startup in affected Linux sandboxes, supported by current-source cleanup paths.
    • add impact:other: Permanent process-group signal denial prevents cleanup settlement and maintenance completion.
    • add maturity:stable: The primary Linux Gateway host surface is M4, and its Diagnostics and Repair contract explicitly covers Doctor checks and operator repair.
    • add issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.
    • add clawsweeper:source-repro: Current issue advisory state selects this label.
    • add clawsweeper:linked-pr-open: Current issue advisory state selects this label.
    • add clawsweeper:no-new-fix-pr: Current issue advisory state selects this label.

    Label justifications:

    • P1: The report describes blocked Doctor maintenance and post-upgrade agent startup in affected Linux sandboxes, supported by current-source cleanup paths.
    • impact:other: Permanent process-group signal denial prevents cleanup settlement and maintenance completion.
    • maturity:stable: The primary Linux Gateway host surface is M4, and its Diagnostics and Repair contract explicitly covers Doctor checks and operator repair.
    Evidence reviewed

    What I checked:

    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge; those execution lanes are retired.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

    Reviewed November 13, 2026, 1:13 AM ET / 06:13 UTC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1clawsweeper:linked-pr-openclawsweeper:no-new-fix-prclawsweeper:source-reproimpact:otherissue-rating: 🦞 diamond lobstermaturity:stable

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions