Skip to content

fix: let Doctor repair a release install while its Gateway runs, without lsof or ss - #204017

Merged
fuller-stack-dev merged 3 commits into
openclaw:mainfrom
fuller-stack-dev:fix/doctor-release-launcher-drain
Nov 23, 2026
Merged

fuller-stack-dev merged 3 commits into
openclaw:mainfrom
fuller-stack-dev:fix/doctor-release-launcher-drain

Conversation

@fuller-stack-dev

@fuller-stack-dev fuller-stack-dev commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Related: #202954 (same refusal class; #203152 fixed it for hosts that have lsof or ss)

What Problem This Solves

After openclaw update moves an install onto releases, its Gateway service runs the resident launcher (~/.openclaw/git-install/openclaw-launcher.mjs) and the Gateway serves as the launcher's child. On a Linux host without lsof or ss, openclaw doctor --fix with the Gateway running stops with exit 1:

Doctor could not enter maintenance. Error: Gateway process changed during maintenance drain Stop the Gateway service and other OpenClaw processes using this state, then run openclaw doctor --fix from an independent shell.

Nothing changed: the same launcher and child keep serving before and after. Doctor is the repair path that update messages and docs point to, so on this layout it does no repair and tells the user to stop services by hand. openclaw update repair runs the same maintenance stop.

User Impact

On a release install, openclaw doctor --fix and openclaw update repair now do their maintenance with the Gateway running and bring it back, as they already do on an in-place install, whether or not lsof or ss is installed. No step is left to the user.

Why This Change Was Made

Maintenance drain must confirm that the Gateway answering on the port is the service's own before it stops the service. When the service's main PID is a launcher, #203152 accepts the child only from port listener attribution (lsof or ss): every listener is that PID and its parent is the service's main PID. Without either tool the listener is unattributed, the check fails, and the drain reports a changed process that never changed.

The fix stays in that one check (isServiceResident in src/cli/update-cli/update-command-service-drain.ts, the single owner every drain caller uses). When the port is busy but no listener names its process, it accepts the reported PID only if its kernel parent (/proc/<pid>/stat, readLinuxProcessStat) is the service's main PID. Attributed listener evidence still decides when present. A Gateway that is not the service's child, a host with no procfs, and a Gateway replaced mid-drain (boot id pin) are still refused. When no listener row names a PID (no lsof/ss, or ss lists the socket without an owner), it accepts the reported PID only if its kernel parent is the service's main PID; a row that names another PID still refuses. Production change: about 10 lines plus an import. No config, stored field, schema, protocol, dependency or permission change.

Route served (bridge rule in src/cli/update-cli/AGENTS.md): Doctor's maintenance stop and openclaw update repair on owned release installs, plus the immutable-activation and in-place stops that share the drain. The release update path in src/update/ restarts through the Gateway itself and has no equivalent check, so it needs no change.

Update behavior for published updaters: the check runs in the installed CLI, so an install gets this fix when the release it runs contains this commit. A release install made by main before this change gets it on its next openclaw update; that update runs through src/update/, which restarts the Gateway through the Gateway itself and does not use this drain, so it is not blocked by the bug. Published in-place updaters (2026.11.7 and earlier) never create release installs. Their Gateway runs as the service's main process unless runtime recovery reran it under another Node (#202954); on such a host without lsof or ss, they keep refusing until the install runs a release with this fix. No backport is intended. The release-install layout exists only on main.

Steps left to a person: none.

Root cause and hypotheses ruled out
  • Red on unmodified origin/main c40587d3511 (real systemd cell, below): launcher PID 7970 and Gateway child 7977 have the same PIDs, start times and NRestarts=1 before and after Doctor. The journal shows no stop or restart. This rules out (a) the launcher replacing its child during the drain and (c) a restart racing the drain.
  • (b) Doctor recording the launcher PID in one place and the child PID in another is the class fix: let updates stop a Gateway that OpenClaw reran under a compatible Node #203152 addressed. Its listener check is the only path that can accept the child.
  • Falsifier: the same origin/main build and cell with only iproute2 (ss) installed before the cell. Doctor exits 0, does its maintenance, and reports "Gateway restarted and verified after Doctor maintenance." The only difference is listener attribution, so missing lsof/ss is the cause.
  • The cell image has no lsof and no ss. ps is present.
  • The Doctor refusal only appears once the launcher is resident. After the first hop (published 2026.11.6 to T) the Gateway still runs in place as the service's main process, and the drain's pid === runtimePid path accepts it. The launcher takes over at T to T1.

Evidence

All cells: published [email protected] installed with npm, real systemd user Gateway service written by openclaw gateway install, 256 MiB agent database with a busy writer, then openclaw update --yes to T (2026.11.11) and T1 (2026.11.12), a no-op update, then the step shown. T and T1 are built from the named source commit plus a version-bump-only commit. Docker on OrbStack with systemd as PID 1; synthetic state only. Each candidate step is a published updater (2026.11.6) driving the candidate, which makes it the published-driver × candidate cell.

Cell (image has no lsof, no ss) Step Exit Maintenance ran Gateway after Readiness outage
RED, unmodified origin/main c40587d3511 openclaw doctor --fix --non-interactive --yes, Gateway running 1, "Gateway process changed during maintenance drain" no same launcher 7970 and child 7977, probe ok none
FALSIFIER, same c40587d3511 with ss installed same 0, "Gateway restarted and verified after Doctor maintenance." yes launcher 13853, child 13867, probe ok 46.8 s
GREEN, final PR code 33fd225, driver published 2026.11.7 (current latest) same 0, "Gateway restarted and verified after Doctor maintenance." yes launcher 7569 to 13172, child 7576 to 13186, probe ok 46.6 s
GREEN, first PR commit 09618b0, driver 2026.11.6 same 0, "Gateway restarted and verified after Doctor maintenance." yes launcher 7957 to 13568, child 7964 to 13582, probe ok 46.4 s
GREEN, sibling, 33fd225 from 2026.11.7 openclaw update repair --yes, Gateway running 0, Doctor maintenance ran, Gateway restarted and verified yes launcher 17484, child 17498, probe ok 53.2 s
GREEN, sibling, 09618b0 from 2026.11.6 same 0 yes launcher 17888, child 17902, probe ok 53.5 s
GREEN, adjacent openclaw doctor --fix on the release install with the Gateway stopped by systemctl --user stop 0, Doctor started and verified the Gateway, same as the in-place behavior for explicit --fix --yes yes launcher 19301, child 19310, probe ok Gateway was down by request

The outage is Doctor's own stop, repair and verified restart, and it matches the falsifier's 46.8 s on base. The update hops in all three cells exit 0 (T: 165 s with a 59.5 s outage; T1: about 110 s with a 12 s outage), which also makes them the published-driver (2026.11.6) × candidate cells.

Decisive raw lines (RED, then GREEN)
RED c40587d3511
MainPID=7970 NRestarts=1 ActiveState=active SubState=running
   7977    7970 Mon Nov 23 08:38:17 2026 node ... ~/.openclaw/git-install/openclaw/dist/index.js gateway
doctor-exit=1 doctor-ms=7851
Doctor: maintenance begin
Doctor: maintenance release
Doctor could not enter maintenance. Error: Gateway process changed during maintenance drain Stop the Gateway service and other OpenClaw processes using this state, then run openclaw doctor --fix from an independent shell.
MainPID=7970 NRestarts=1 ActiveState=active SubState=running
   7977    7970 Mon Nov 23 08:38:17 2026 node ... ~/.openclaw/git-install/openclaw/dist/index.js gateway
--- step doctor-fix outages (s): []        after-doctor-fix: openclaw gateway probe exit 0

GREEN 09618b0
MainPID=7957 NRestarts=1 ActiveState=active SubState=running
   7964    7957 Mon Nov 23 09:20:28 2026 node ... ~/.openclaw/git-install/openclaw/dist/index.js gateway
doctor-exit=0 doctor-ms=62404
Doctor: maintenance ready
Doctor: maintenance finish
Restarted systemd service: openclaw-gateway.service
Gateway restarted and verified after Doctor maintenance.
Doctor: maintenance release
MainPID=13568 NRestarts=0 ActiveState=active SubState=running
  13582   13568 Mon Nov 23 09:23:07 2026 node ... ~/.openclaw/git-install/openclaw/dist/index.js gateway
--- step doctor-fix outages (s): [(46.4, 'closed', 15.5)]        after-doctor-fix: openclaw gateway probe exit 0
update-repair-exit=0 ms=72267 ... Gateway restarted and verified after Doctor maintenance.

Update proof rules (#203915), from the cells' raw logs:

  • Route: each update hop was a plain openclaw update --yes. The shipped updater's run records trigger cli, and the candidate hops record trigger api. The Gateway journal has [gateway] update.run <runId> actor=gateway-client for both candidate hops in the red, green and green-2026.11.7 cells. No OPENCLAW_UPDATE_PACKAGE_SPEC, --tag, --no-restart or shortened --timeout was used.
  • Service: the unit comes from openclaw gateway install. After each step the cell saved the unit's ExecStart, MainPID, NRestarts, ActiveState and SubState, and the running process tree. ExecStart is the package entry before the first release hop and ~/.openclaw/git-install/openclaw-launcher.mjs gateway after it. NeedDaemonReload was not captured.
  • Freshness: the green cell names source 33fd225. The final head ba03d34 adds only a merge of main, and git diff 33fd225 ba03d34 is empty for src/cli/update-cli, src/daemon, src/infra/ports-inspect.ts, src/shared/pid-alive.ts, src/cli/daemon-cli, src/commands, src/update and docs/cli/update. Public npm view openclaw dist-tags at landing: latest 2026.11.7 (the driver of the final green cell), beta 2026.11.10-beta.1, extended-stable 2026.10.33.
  • Next build: T and T1 are version-bump-only builds of the tested commit, so no schema migration or rollback ran. This change does not touch either.
  • Installed code: the change does not touch src/update/launcher.ts, run.ts, preflight.ts or convert-service.ts, so the T to T+1 to T+2 rule does not apply.
  • Platforms: only the Linux systemd user service ran. A Linux container without a user bus has no service to drain. The macOS LaunchAgent (see Not proven) and the Windows Scheduled Task are unproven.

Adjacent guards (behavior unchanged, base vs head):

Step Base c40587d3511 Head
Doctor --fix on a plain in-place install (after the first hop), Gateway running exit 0, maintenance ran, restarted and verified, outage 92.7 s exit 0, same messages, outage 85.7 s
Doctor --fix on the release install, Gateway stopped with systemctl --user stop exit 0, started and verified the Gateway (explicit --fix --yes keeps recovery) exit 0, same

Negative control for a Gateway that is really not the service's: covered by the unit table (another parent, another PID, no procfs, boot id change) because a foreign Gateway cannot be injected mid-drain in the cell. Final head ba03d34 is 33fd225 plus a merge of unrelated main commits; none touch update, Doctor, daemon, port inspection or src/update/.

Unit regression (src/cli/update-cli/update-command-service-drain.test.ts): the launcher-child table gains unattributed-port cases (no listener rows, and a row without a PID). On base c40587d3511 the three "kernel parent is the launcher" cases fail with Gateway process changed during maintenance drain (3 failed, 69 passed). On the head, 72 of 72 pass. Negative controls in the same table: an unattributed port whose kernel parent is another process (normal and explicit drain), no procfs, and attributed listeners of another PID (even when the kernel parent matches), and a PID-less row next to a row naming another PID. All are refused and the native stop is never called. The existing boot-id case still refuses a Gateway replaced mid-drain.

Checks on the head: focused tests including test/scripts/update-restart-module-outcome.test.ts and test/scripts/eager-import-closure.test.ts (all pass), pnpm tsgo:core, pnpm tsgo:test:src, oxlint on touched files, pnpm check:docs, the session identity ratchet, pnpm check:baseline-ratchets --base 08eaf404075 --no-merge-base, and git diff --check: all pass.

Recordings: replay of each cell's raw step output, home paths shortened to ~. Full raw logs are not attached because the Crabbox artifact store rejected uploads from this machine (http 401).

RED (unmodified origin/main c40587d3511):

doctor-release-red.mp4

FALSIFIER (same base, ss installed):

doctor-release-falsifier.mp4

GREEN (first PR commit, driver 2026.11.6):

doctor-release-green.mp4

GREEN (final PR code, driver 2026.11.7):

doctor-release-green-final.mp4

Tests audited: the whole of update-command-service-drain.test.ts (fixtures, helpers, imports, setup and teardown). The launcher-child table was extended in place, not duplicated. The new readLinuxProcessStat mock is reset to null in beforeEach. Nothing was removed. An independent reviewer audited the file; its two suggestions (cover the explicit-drain refusal, and word the fallback as "unattributed listener" instead of only "no lsof or ss") are applied. A ClawSweeper local review (one round, GPT 6.2 Sol) found that ss can list the socket with no owner; that input is now handled and tested, and the 2026.11.7 driver cell it asked for is above. autoreview does not run on this machine.

Not proven

  • macOS launchd. The Doctor drain runs on Linux only, and macOS has lsof; no launchd cell was run.
  • A Git-checkout release install. It uses the same launcher (src/update/launcher.ts forks the Gateway as a child), so the same check applies, but no Git-checkout cell was run.
  • Hosts where ss runs but cannot see the socket's owner take the same fallback. This is covered only by the unit test.
  • Separate observation, not changed here: systemctl --user stop on the launcher service leaves the unit failed (launcher exits 1 after force-terminating its child), on base and head alike.

…of or ss

A release install's service runs the resident launcher, and the Gateway
serves as its child. Maintenance drain accepted that child only from port
listener attribution, which needs lsof or ss. Without them Doctor and
update repair refused with 'Gateway process changed during maintenance
drain' while the same Gateway kept serving. When the listener is
unattributed, require the kernel parent of the reporting process to be
the service's main process instead.
@clawsweeper

clawsweeper Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation cli CLI command changes size: S labels Nov 23, 2026
…ut an owner

ss prints a LISTEN row without process details when it cannot see the
socket's owner. Treat a busy port whose listener rows all lack a PID like
an unattributed one and use the kernel-parent check; rows that name a
different PID still refuse.
@clawsweeper clawsweeper Bot added the clawsweeper:intake:bug Preliminary submission classification; full source review pending. label Nov 23, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 23, 2026
@clawsweeper

clawsweeper Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Allow maintenance drain to verify a launcher’s Gateway child through kernel parentage when port-listener ownership is unavailable.

Example: A Linux release install runs launcher PID 7957 and Gateway child PID 7964 without lsof or ss.

  • Before: doctor --fix exits 1 with “Gateway process changed during maintenance drain.”
  • After: Doctor verifies the child’s kernel parent, completes maintenance, and restarts and verifies the Gateway.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, useful patch with convincing changed-path terminal evidence, held below a complete proof assessment by the outstanding latest-stable upgrade requirement.
Proof confidence 🦐 gold shrimp (3/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Doctor’s normal repair command refuses a healthy release installation and asks the operator to stop services manually.
Reason: The maintainer-authored direction restores automatic maintenance for a demonstrated installation layout without adding a user-facing option.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR repairs a source-confirmed Doctor refusal with a focused change, and no introduced correctness defect was found.

Priority: P2
Reviewed head: ba03d34cc4440009d74f648340f3036dfade88e4

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Provide the required v2026.11.7-to-candidate upgrade run followed by Doctor maintenance without lsof or ss, showing settings and data preserved and the Gateway verified afterward, with sensitive values redacted.
Agent review details

How this fits together

Doctor and update repair use the shared maintenance drain to connect to the resident Gateway, verify its relationship to the owned service, and authorize a graceful service stop.

flowchart TD
  A[Doctor or update repair] --> B[Owned service inspection]
  B --> C[Maintenance drain]
  C --> D[Gateway identity response]
  D --> E[Listener or kernel parent verification]
  E --> F[Service stop and repair]
  F --> G[Gateway restart and verification]
Loading

Technical review

Best possible solution:

Keep resident verification in the existing drain owner, using kernel parentage only when no listener identifies its process.

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

Current main rejects a serving launcher child when listener attribution is empty; supplied real systemd logs show that refusal and isolate missing attribution by installing ss.

Is this the best way to solve the issue?

The patch repairs the shared identity check with the existing procfs reader, preserves attributed-listener refusals, and avoids new state, configuration, or competing ownership.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Launcher-child resident verification and documentation changes intended behavior with a stated reason (a27f0c3: Recognize a Gateway rerun beneath the service launcher while refusing unrelated listeners; the new fallback addresses demonstrated hosts where listener attribution is unavailable.)
  • Existing launcher-child regression table keeps the original intent (a27f0c3: Cover ordinary and explicit drains plus foreign-parent and foreign-listener refusals; this PR retains those cases and extends the same table.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Focused introduced change: The pinned introduction diff changes only the existing resident check, its regression table, and the corresponding documentation; conflicting attributed listeners retain the existing refusal. (src/cli/update-cli/update-command-service-drain.ts:208, ba03d34cc444)
  • Current-main failure and original intent: Current main requires a nonempty attributed listener list for a launcher child. The behavior was added by fix: let updates stop a Gateway that OpenClaw reran under a compatible Node #203152 to recognize runtime-recovery children while refusing unrelated processes. (src/cli/update-cli/update-command-service-drain.ts:207, db2f0c561254)
  • Production caller and launcher contract: Doctor reaches this drain through the Linux managed-service maintenance stop, and the release launcher forks the serving Gateway directly; release updates have a separate restart owner. (src/cli/update-cli/update-command-service-maintenance.ts:621, ba03d34cc444)
  • Supplied production-path evidence: The complete PR body contains real systemd red, listener-tool falsifier, and green terminal excerpts showing Doctor repair, update repair, and subsequent Gateway probes; its captured source identity is 4de0dfa6cb286a4603d47416ad0d7da0011bb941e2cce6f73f61954c96710404. (ba03d34cc444)
  • Latest stable upgrade requirement: The latest stable release is v2026.11.7, published before this PR; the supplied upgrade cells start from 2026.11.6, while root policy requires latest-stable upgrade evidence for Doctor changes. (AGENTS.md, ba03d34cc444)
  • Media inspection limitation: All three downloaded recordings lack prepared metadata and contact sheets because “ffprobe failed: spawnSync ffprobe ENOENT”; opening the green recording through the available web fallback returned “Cache miss,” so the review relies on the independently readable terminal excerpts.

Likely related people:

  • Peter Steinberger: Raw commit a27f0c3 adds src/cli/update-cli/update-command-service-drain.ts:194 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: a27f0c3b4e8d; files: src/cli/update-cli/update-command-service-drain.ts)
  • Jason (Json): Raw commit ff75829 adds src/cli/update-cli/update-command-service-drain.ts:106 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: ff7582981434; files: src/cli/update-cli/update-command-service-drain.ts)
  • Dallin Romney: Raw commit 14886e4 adds src/cli/update-cli/update-command-service-drain.ts:32 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 14886e46e823; files: src/cli/update-cli/update-command-service-drain.ts)

PR surface

Source +8, Tests +42, Docs +5. Total +55 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 15 7 +8
Tests 1 52 10 +42
Docs 1 12 7 +5
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 79 24 +55

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P2: Doctor and update repair refuse a valid Linux launcher-child installation without listener attribution, while the Gateway continues serving.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Doctor and update repair refuse a valid Linux launcher-child installation without listener attribution, while the Gateway continues serving.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 23, 2026, 4:58 AM ET / 09:58 UTC.

@fuller-stack-dev
fuller-stack-dev merged commit cff8782 into openclaw:main Nov 23, 2026
142 checks passed
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Merged via squash.

@fuller-stack-dev
fuller-stack-dev deleted the fix/doctor-release-launcher-drain branch November 23, 2026 10:22
tideclaw-bot pushed a commit that referenced this pull request Nov 24, 2026
…e Node (#203152)

* fix(update): drain a Gateway that runtime recovery reran under another Node

A service whose Node is unsupported or lacks a recommended security patch
reruns the Gateway under a compatible Node as a child of the launcher, so the
service's main PID never equals the PID the resident reports. Maintenance drain
refused every such update with 'Gateway process changed during maintenance
drain'. Accept the resident when every Gateway port listener is that process
and its parent is the service's main process, matching restart port ownership.

Refs #202954

* docs(update): runtime recovery reruns the Gateway only when its Node fails admission

Co-authored-by: Peter Steinberger <[email protected]>
(cherry picked from commit a27f0c3)
Release-companions: #204017 is a separate Linux release-install Doctor fallback when lsof/ss cannot attribute listeners; it is not required for this attributed-listener runtime-recovery case. #203486 pnpm recovery, #201668 data-risk repair, and #202591 snapshot cleanup only overlap documentation; #203236 is independent auto-update retry policy. The neighboring native drain suite remains unchanged.
Co-authored-by: RomneyDa <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 24, 2026
…out lsof or ss (openclaw#204017)

* fix: let Doctor drain a release install's Gateway on hosts without lsof or ss

A release install's service runs the resident launcher, and the Gateway
serves as its child. Maintenance drain accepted that child only from port
listener attribution, which needs lsof or ss. Without them Doctor and
update repair refused with 'Gateway process changed during maintenance
drain' while the same Gateway kept serving. When the listener is
unattributed, require the kernel parent of the reporting process to be
the service's main process instead.

* fix: also drain the launcher's Gateway when ss lists its socket without an owner

ss prints a LISTEN row without process details when it cannot see the
socket's owner. Treat a busy port whose listener rows all lack a PID like
an unattributed one and use the kernel-parent check; rows that name a
different PID still refuse.
tideclaw-bot pushed a commit that referenced this pull request Nov 24, 2026
…ate acts on it (#201668)

* fix(update): verify recorded data-at-risk marks before repair acts on them

* fix(update): verify any unverified data-at-risk mark and honor receipts in handoff recovery

* fix(update): recognize a Git release-mode service as its checkout's own

* fix(update): check a recorded data-at-risk mark before the next update, including already-current runs

* fix(update): lead data-at-risk refusals with triage and record them on the refused run

* fix(update): keep data-at-risk refusals within the recorded warning limit

* test(e2e): finish the seeded data-at-risk run with a terminal phase

* fix(update): name the agent route in killed-update recovery refusals

* fix(update): drop an unused import

* test(update): expect the agent route in killed-update refusals

* fix(update): verify the newest mark before restoration without comparing run ids

* fix(update): address review: keep the Gateway down on any inconsistent mark, resolve all marks, harden release ownership

* fix(update): break the admission-root import cycle and type the e2e schema read

* fix(update): address rating findings: agent rollback leftovers, helper restart, blocking findings first, shared Git metadata

* test(e2e): prove the next plain update resolves a mark with the Gateway running

* fix(update): address rating round 2: refuse marks before Doctor, registry-based rollback check, handoff fallback, async history read

* test(update): pick the repair run, not a settlement row, in the data-at-risk cell

* fix(update): resolve live-writer marks after Doctor holds the state

* fix(doctor): say a skipped stale-Gateway stop left the PID running

* fix(update): address rating round 3: leftovers before deferrals, retained rollback files, refusal after Doctor fails finalization

* docs(update): note retained rollback files and refusals after Doctor

* fix(doctor): say a stale Gateway stop could not be confirmed when nothing shows it running

* fix(update): address landing review: revert release-mode ownership, check leftovers first, handoff entry guard, durable rollback evidence

* test(update): follow main's Git release link layout in the launcher refusal test

* fix(update): treat uninspectable leftovers and unreadable databases as unchecked; true wording after Doctor

Release adaptation: Retain the stable installed-recovery harness. Do not add main's installed Docker service cell, later retired by #203808, or Git release-launcher wording/test because stable uses the in-place Git updater. Keep the state-verification, next-update, repair and interrupted-handoff paths and their compatible regressions.

Companion audit: #203486 is present-equivalent at 3081077 (preserved). #201978 is selected next in this lane. #203808 and #203966 involve the inapplicable installed service-cell layout; #203497 and #203194 change main's package/Git activation layout and are not applicable; #204017 depends on that release-install layout. #204077, #204043, #203555 and #203520 are independent authority, cleanup, helper-fixture and config-validation changes. #204151, #203917, #203849 and #203406 are separate guidance, cleanup or status changes, not required by the data-risk verifier. #203569 fixes a separate cron receipt fixture in the same Doctor suite; the touched stale-stop cases do not depend on it.

(cherry picked from commit a28f211)
Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit f8d4bc138ed2512c413cf96f66fe0eefb3b28d65)
tideclaw-bot pushed a commit that referenced this pull request Nov 26, 2026
…out lsof or ss (#204017)

* fix: let Doctor drain a release install's Gateway on hosts without lsof or ss

A release install's service runs the resident launcher, and the Gateway
serves as its child. Maintenance drain accepted that child only from port
listener attribution, which needs lsof or ss. Without them Doctor and
update repair refused with 'Gateway process changed during maintenance
drain' while the same Gateway kept serving. When the listener is
unattributed, require the kernel parent of the reporting process to be
the service's main process instead.

* fix: also drain the launcher's Gateway when ss lists its socket without an owner

ss prints a LISTEN row without process details when it cannot see the
socket's owner. Treat a busy port whose listener rows all lack a PID like
an unattributed one and use the kernel-parent check; rows that name a
different PID still refuse.

(cherry picked from commit cff8782)

Backport review: #205736 changes update cohort settlement and #204676 changes Git service layout; their only overlap is the update docs. Neither is a prerequisite for resident-child proof.

Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant