redeploy-services: PeerTube's sign-in plugin install dies with an empty stderr — pnpm add is killed by the unit's seccomp filter on chown(2) (SIGSYS), and PeerTube reports it as a bare HTTP 400 #1622

Closed
opened 2026-09-19 03:07:17 +00:00 by matou-build-agent · 1 comment

The failure

Drive 20260919T021605Z (#1620 run 2, the roles proof part 2) went red at redeploy-services, 29/30 legs green (artifacts/verdict.json, artifacts/legs.json:leg=redeploy-services). The switch died at exit 4 with:

[gateway] peertube-oidc-start[16329]: video-oidc: plugin install failed (HTTP 400): {"type":"about:blank","title":"Bad Request","detail":"Cannot install plugin peertube-plugin-auth-openid-connect","status":400,...}
[gateway] systemd[1]: Failed to start Provision PeerTube's kanidm OAuth2 client + the auth-openid-connect plugin (video port, spec #1535/#1544).

This is link 3 of the PeerTube-8-on-a-nixpkgs-PeerTube-≤7-unit chain. Links 1 (pnpm not on the unit PATH, GOTCHAS #261, f48c2dee) and 2 (pnpm's store/state in the read-only HOME + the 60× retry storm, GOTCHAS #262, a3253331) were both live on this drive and both held — the retry cap fired loud and correctly after three refusals (peertube-oidc.service journal, 03:00:26: "PeerTube refused the plugin install 3 times — giving up rather than hammering the plugin index"), which is what made link 3 readable at all.

Evidence, from the kept box

PeerTube's own journal blamed pnpm but carried nothing:

peertube[16322]: "message": "Command failed: pnpm add peertube-plugin-auth-openid-connect@1.2.0\n",
peertube[16322]: "cmd": "pnpm add peertube-plugin-auth-openid-connect@1.2.0"
peertube[16322]: "stderr": ""

An empty stderr on a command that had all but finished: /var/lib/peertube/storage/plugins/node_modules/ holds peertube-plugin-auth-openid-connect, openid-client, jose, oauth4webapi fully linked; pnpm-lock.yaml is written and lockfile-verified.jsonl records the 02:57:29 verification. Only package.json stayed {}, with pnpm's temp package.json.442308548 ({"dependencies":{"peertube-plugin-auth-openid-connect":"1.2.0"}}) orphaned beside it — plus one orphaned pnpm-lock.yaml.<n> per attempt.

coredumpctl on the box named the cause outright:

$ coredumpctl list
TIME                          PID UID GID SIG    COREFILE EXE
Sat 2026-09-19 02:57:36 UTC 16508 993 992 SIGSYS present  .../nodejs-slim-24.15.0/bin/node
... (six, one per install attempt, all SIGSYS)

$ coredumpctl info 16508
        Signal: 31 (SYS)
  Command Line: .../node .../pnpm-11.5.3/bin/pnpm add peertube-plugin-auth-openid-connect@1.2.0
          Unit: peertube.service
Stack trace of thread 16516:
#0  0x000077833d112dfb chown (libc.so.6 + 0x112dfb)
#1  0x000077833ef5332c uv__fs_work (libuv.so.1 + 0x1832c)
#2  0x000077833ef49d3a worker (libuv.so.1 + 0xed3a)

The unit's filter (systemctl cat peertube, lines 60–63):

SystemCallFilter=~@cpu-emulation @debug @keyring @ipc @memlock @mount @obsolete @privileged @setuid
SystemCallFilter=fchown
SystemCallFilter=pipe
SystemCallFilter=pipe2

and on the same box:

$ systemd-analyze syscall-filter @privileged | grep chown
    @chown
$ systemd-analyze syscall-filter @chown
    chown  chown32  fchown  fchown32  fchownat  lchown  lchown32

So: @privileged is denied, @privileged contains @chown, and nixpkgs hands back exactly one member — fchown, the entry point PeerTube ≤ 7's yarn used. pnpm 11 rewrites package.json and the lockfile through write-file-atomic, which chowns the temp file by path. chown(2) is denied → SIGSYS → core dump. seccomp kills without a word, which is exactly why stderr was empty, node printed no stack, and PeerTube could say no more than Cannot install plugin.

The suspected layer

The video port's render, internal/clan/video.go:260 (renderPeerTubeDaemon) — the same place links 1 and 2 were fixed. Nothing in the harness, the fixtures or PeerTube's own logic is at fault; the unit's syscall allowlist names one entry point of the ownership family and pnpm 11 uses another.

The fix (cc1bced9)

internal/clan/video.go hands the whole family back:

systemd.services.peertube.serviceConfig.SystemCallFilter = lib.mkAfter [ "@chown" ];

lib.mkAfter because the entry MUST land after the module's own deny list — NixOS's unitOption concatenates list definitions, and an unprefixed entry landing first would make the whole filter an allow-list instead of a deny-list. Covered by TestRenderVideo_ThePeerTubeUnitMayChownItsOwnPluginFiles (substring + a real nix-instantiate --parse, the #257 double-definition guard). GOTCHAS #263 records the diagnostic rule: a child killed by seccomp says nothing, so ask the box for the core dump before theorising about the child.

Render-proven; live-unproven until the next fire, the same standing as links 1 and 2.

Proposed ruling (Ruled by the healer under ADR 0174 — veto anytime)

Two-way door. The change is one rendered Nix line in internal/clan/video.go; reverting it is deleting that line and its test, with no migration, no persisted state and no data shape touched — a later commit undoes it completely.

Proven by TestRenderVideo_ThePeerTubeUnitMayChownItsOwnPluginFiles (internal/clan/video_test.go), written red-first: it failed against the pre-fix render and passes after, and it parses the whole module with a real nix-instantiate --parse so a second definition of the attribute cannot slip through as a substring match (GOTCHAS #257).

Mechanical repair, not a design decision. It reads as a security-posture edit and I weighed it as one; on the substance it is not. The decision — "the PeerTube unit may change ownership of the plugin files it owns" — was already taken upstream, by nixpkgs, when the module re-allowed fchown after denying @privileged. That is the same capability this commit grants; the only delta is the sibling entry points of the same syscall group (chown, lchown, fchownat; the 32-bit members are unreachable under SystemCallArchitectures=native), which do by path what fchown already does by fd. And the ceiling is unchanged: the unit runs User=peertube with CapabilityBoundingSet= empty and NoNewPrivileges=true, so without CAP_CHOWN it can only ever chown its own files to its own uid/gid — there is no privilege for the added entries to reach. Nothing a community sees, no route, no secret, no default, no message at a trust moment. It is the same class as links 1 and 2 of this chain (a PATH, an XDG dir): making the unit do what it already meant to do, for the tool PeerTube 8 actually shells out to.

The one judgement worth a second eye is the breadth — @chown rather than the single chown the core dump named. I chose the family deliberately: naming one entry point of this group is precisely how the bug arose, and this chain has already cost three paid drives, one per link. If Ben prefers minimal-and-evidence-driven, narrowing [ "@chown" ] to [ "chown" ] is a one-token follow-up. Built on the workstation (never the drive host) and closed through the close-report gate — the same gate a swarm worker passes.

drive 20260919T021605Z red at redeploy-services (sig 03347fc9985d) — self-fixed on the fast lane, commit dd3cceaf583e587e5ab46935505ad41efb8ea4ed; checks: targeted: GOWORK=/home/dev/rehearsal-heal/idss/go.work go test ./internal/clan -run TestRenderVideo_ThePeerTubeUnitMayChownItsOwnPluginFiles — FAIL before the fix (red-first), ok git.matou.nz/Matou/idss/internal/clan 0.080s after. package: GOWORK=/home/dev/rehearsal-heal/idss/go.work go test ./internal/clan ./internal/videosvc — ok git.matou.nz/Matou/idss/internal/clan 27.118s, ok git.matou.nz/Matou/idss/internal/videosvc 0.004s. Diff: 3 files, 60 non-test lines added, 0 removed; no assertion, test or leg touched.. evidence: /home/dev/swarm/Matou/idss/test-results/drive-rented-services/20260919T021605Z on matou-workstation.

## The failure Drive `20260919T021605Z` (#1620 run 2, the roles proof part 2) went red at `redeploy-services`, 29/30 legs green (`artifacts/verdict.json`, `artifacts/legs.json:leg=redeploy-services`). The switch died at exit 4 with: ``` [gateway] peertube-oidc-start[16329]: video-oidc: plugin install failed (HTTP 400): {"type":"about:blank","title":"Bad Request","detail":"Cannot install plugin peertube-plugin-auth-openid-connect","status":400,...} [gateway] systemd[1]: Failed to start Provision PeerTube's kanidm OAuth2 client + the auth-openid-connect plugin (video port, spec #1535/#1544). ``` This is link 3 of the PeerTube-8-on-a-nixpkgs-PeerTube-≤7-unit chain. Links 1 (`pnpm` not on the unit PATH, GOTCHAS #261, `f48c2dee`) and 2 (pnpm's store/state in the read-only HOME + the 60× retry storm, GOTCHAS #262, `a3253331`) were both live on this drive and both held — the retry cap fired loud and correctly after three refusals (`peertube-oidc.service` journal, 03:00:26: *"PeerTube refused the plugin install 3 times — giving up rather than hammering the plugin index"*), which is what made link 3 readable at all. ## Evidence, from the kept box PeerTube's own journal blamed pnpm but carried nothing: ``` peertube[16322]: "message": "Command failed: pnpm add peertube-plugin-auth-openid-connect@1.2.0\n", peertube[16322]: "cmd": "pnpm add peertube-plugin-auth-openid-connect@1.2.0" peertube[16322]: "stderr": "" ``` An empty stderr on a command that had all but finished: `/var/lib/peertube/storage/plugins/node_modules/` holds `peertube-plugin-auth-openid-connect`, `openid-client`, `jose`, `oauth4webapi` fully linked; `pnpm-lock.yaml` is written and `lockfile-verified.jsonl` records the 02:57:29 verification. Only `package.json` stayed `{}`, with pnpm's temp `package.json.442308548` (`{"dependencies":{"peertube-plugin-auth-openid-connect":"1.2.0"}}`) orphaned beside it — plus one orphaned `pnpm-lock.yaml.<n>` per attempt. `coredumpctl` on the box named the cause outright: ``` $ coredumpctl list TIME PID UID GID SIG COREFILE EXE Sat 2026-09-19 02:57:36 UTC 16508 993 992 SIGSYS present .../nodejs-slim-24.15.0/bin/node ... (six, one per install attempt, all SIGSYS) $ coredumpctl info 16508 Signal: 31 (SYS) Command Line: .../node .../pnpm-11.5.3/bin/pnpm add peertube-plugin-auth-openid-connect@1.2.0 Unit: peertube.service Stack trace of thread 16516: #0 0x000077833d112dfb chown (libc.so.6 + 0x112dfb) #1 0x000077833ef5332c uv__fs_work (libuv.so.1 + 0x1832c) #2 0x000077833ef49d3a worker (libuv.so.1 + 0xed3a) ``` The unit's filter (`systemctl cat peertube`, lines 60–63): ``` SystemCallFilter=~@cpu-emulation @debug @keyring @ipc @memlock @mount @obsolete @privileged @setuid SystemCallFilter=fchown SystemCallFilter=pipe SystemCallFilter=pipe2 ``` and on the same box: ``` $ systemd-analyze syscall-filter @privileged | grep chown @chown $ systemd-analyze syscall-filter @chown chown chown32 fchown fchown32 fchownat lchown lchown32 ``` So: `@privileged` is denied, `@privileged` contains `@chown`, and nixpkgs hands back exactly **one** member — `fchown`, the entry point PeerTube ≤ 7's yarn used. pnpm 11 rewrites `package.json` and the lockfile through write-file-atomic, which chowns the temp file **by path**. `chown(2)` is denied → SIGSYS → core dump. seccomp kills without a word, which is exactly why stderr was empty, node printed no stack, and PeerTube could say no more than `Cannot install plugin`. ## The suspected layer The video port's render, `internal/clan/video.go:260` (`renderPeerTubeDaemon`) — the same place links 1 and 2 were fixed. Nothing in the harness, the fixtures or PeerTube's own logic is at fault; the unit's syscall allowlist names one entry point of the ownership family and pnpm 11 uses another. ## The fix (`cc1bced9`) `internal/clan/video.go` hands the whole family back: ```nix systemd.services.peertube.serviceConfig.SystemCallFilter = lib.mkAfter [ "@chown" ]; ``` `lib.mkAfter` because the entry MUST land after the module's own deny list — NixOS's `unitOption` concatenates list definitions, and an unprefixed entry landing *first* would make the whole filter an allow-list instead of a deny-list. Covered by `TestRenderVideo_ThePeerTubeUnitMayChownItsOwnPluginFiles` (substring + a real `nix-instantiate --parse`, the #257 double-definition guard). GOTCHAS #263 records the diagnostic rule: a child killed by seccomp says nothing, so ask the box for the core dump before theorising about the child. Render-proven; live-unproven until the next fire, the same standing as links 1 and 2. ## Proposed ruling (Ruled by the healer under ADR 0174 — veto anytime) **Two-way door.** The change is one rendered Nix line in `internal/clan/video.go`; reverting it is deleting that line and its test, with no migration, no persisted state and no data shape touched — a later commit undoes it completely. **Proven by** `TestRenderVideo_ThePeerTubeUnitMayChownItsOwnPluginFiles` (`internal/clan/video_test.go`), written red-first: it failed against the pre-fix render and passes after, and it parses the whole module with a real `nix-instantiate --parse` so a second definition of the attribute cannot slip through as a substring match (GOTCHAS #257). **Mechanical repair, not a design decision.** It reads as a security-posture edit and I weighed it as one; on the substance it is not. The decision — *"the PeerTube unit may change ownership of the plugin files it owns"* — was already taken upstream, by nixpkgs, when the module re-allowed `fchown` after denying `@privileged`. That is the same capability this commit grants; the only delta is the sibling entry points of the same syscall group (`chown`, `lchown`, `fchownat`; the 32-bit members are unreachable under `SystemCallArchitectures=native`), which do by path what `fchown` already does by fd. And the ceiling is unchanged: the unit runs `User=peertube` with `CapabilityBoundingSet=` empty and `NoNewPrivileges=true`, so without CAP_CHOWN it can only ever chown its own files to its own uid/gid — there is no privilege for the added entries to reach. Nothing a community sees, no route, no secret, no default, no message at a trust moment. It is the same class as links 1 and 2 of this chain (a PATH, an XDG dir): making the unit do what it already meant to do, for the tool PeerTube 8 actually shells out to. The one judgement worth a second eye is the *breadth* — `@chown` rather than the single `chown` the core dump named. I chose the family deliberately: naming one entry point of this group is precisely how the bug arose, and this chain has already cost three paid drives, one per link. If Ben prefers minimal-and-evidence-driven, narrowing `[ "@chown" ]` to `[ "chown" ]` is a one-token follow-up. Built on the workstation (never the drive host) and closed through the close-report gate — the same gate a swarm worker passes. drive `20260919T021605Z` red at `redeploy-services` (sig 03347fc9985d) — self-fixed on the fast lane, commit `dd3cceaf583e587e5ab46935505ad41efb8ea4ed`; checks: targeted: `GOWORK=/home/dev/rehearsal-heal/idss/go.work go test ./internal/clan -run TestRenderVideo_ThePeerTubeUnitMayChownItsOwnPluginFiles` — FAIL before the fix (red-first), `ok git.matou.nz/Matou/idss/internal/clan 0.080s` after. package: `GOWORK=/home/dev/rehearsal-heal/idss/go.work go test ./internal/clan ./internal/videosvc` — `ok git.matou.nz/Matou/idss/internal/clan 27.118s`, `ok git.matou.nz/Matou/idss/internal/videosvc 0.004s`. Diff: 3 files, 60 non-test lines added, 0 removed; no assertion, test or leg touched.. evidence: `/home/dev/swarm/Matou/idss/test-results/drive-rented-services/20260919T021605Z` on matou-workstation. <!-- rehearsal-sig: 03347fc9985d -->
Author
Member

close-report for #1622 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 1622,
  "status": "success",
  "commits": [
    "dd3cceaf583e587e5ab46935505ad41efb8ea4ed"
  ],
  "changed_files": [
    "docs/GOTCHAS.md",
    "internal/clan/video.go",
    "internal/clan/video_test.go"
  ],
  "tests": [
    {
      "command": "targeted: `GOWORK=/home/dev/rehearsal-heal/idss/go.work go test ./internal/clan -run TestRenderVideo_ThePeerTubeUnitMayChownItsOwnPluginFiles` — FAIL before the fix (red-first), `ok git.matou.nz/Matou/idss/internal/clan 0.080s` after. package: `GOWORK=/home/dev/rehearsal-heal/idss/go.work go test ./internal/clan ./internal/videosvc` — `ok git.matou.nz/Matou/idss/internal/clan 27.118s`, `ok git.matou.nz/Matou/idss/internal/videosvc 0.004s`. Diff: 3 files, 60 non-test lines added, 0 removed; no assertion, test or leg touched.",
      "exit_code": 0
    }
  ],
  "criteria": {
    "the red leg is now green": "healed on the fast lane, commit dd3cceaf583e587e5ab46935505ad41efb8ea4ed"
  },
  "summary": "`pnpm add` was being killed by the PeerTube unit's seccomp filter on the denied `chown(2)` (SIGSYS, six core dumps, empty stderr → a bare HTTP 400 from PeerTube); the render now hands the `@chown` family back to the unit with `lib.mkAfter`, which reaches no further than the `fchown` nixpkgs already allowed.",
  "blockers": []
}
**close-report** for #1622 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1622, "status": "success", "commits": [ "dd3cceaf583e587e5ab46935505ad41efb8ea4ed" ], "changed_files": [ "docs/GOTCHAS.md", "internal/clan/video.go", "internal/clan/video_test.go" ], "tests": [ { "command": "targeted: `GOWORK=/home/dev/rehearsal-heal/idss/go.work go test ./internal/clan -run TestRenderVideo_ThePeerTubeUnitMayChownItsOwnPluginFiles` — FAIL before the fix (red-first), `ok git.matou.nz/Matou/idss/internal/clan 0.080s` after. package: `GOWORK=/home/dev/rehearsal-heal/idss/go.work go test ./internal/clan ./internal/videosvc` — `ok git.matou.nz/Matou/idss/internal/clan 27.118s`, `ok git.matou.nz/Matou/idss/internal/videosvc 0.004s`. Diff: 3 files, 60 non-test lines added, 0 removed; no assertion, test or leg touched.", "exit_code": 0 } ], "criteria": { "the red leg is now green": "healed on the fast lane, commit dd3cceaf583e587e5ab46935505ad41efb8ea4ed" }, "summary": "`pnpm add` was being killed by the PeerTube unit's seccomp filter on the denied `chown(2)` (SIGSYS, six core dumps, empty stderr → a bare HTTP 400 from PeerTube); the render now hands the `@chown` family back to the unit with `lib.mkAfter`, which reaches no further than the `fchown` nixpkgs already allowed.", "blockers": [] } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#1622
No description provided.