deploy-document-archive: pytest's "Enable tracemalloc…" hint out of the paperless-ngx build trips the masked-exit "traceback" marker and reds a fully converged deploy #1287

Closed
opened 2026-09-07 05:23:07 +00:00 by matou-build-agent · 1 comment

The failure

Drive 20260907T041410Z (commit 25551a2b), 10 green / 1 red, deploy-document-archive after 3334881 ms (55.6 min — under the 75 m ceiling 25551a2b set, so NOT a timeout):

deploy failed (clean-retry): provision: deploy gateway: clan: deploy failed on 1 node(s):
gateway: clan: masked_exit on gateway: clan reported success but the log shows a real failure:
[gateway] paperless-ngx>   Enable tracemalloc to get traceback where the object was allocated.
[gateway] paperless-ngx>   Enable tracemalloc to get traceback where the object was allocated.
[gateway] paperless-ngx>   Enable tracemalloc to get traceback where the object was allocated.

clean-retry here is the RecoveryMode label the failure carries (internal/provision/deploy.go:97), not evidence of a second attempt — the control-plane log records exactly ONE provision deploy failed.

The evidence: the deploy CONVERGED

  • logs/guest-system-journal.log:59-177 — 05:15:27 the paperless slice is created, redis-paperless starts, paperless-scheduler-pre-start applies every migration (account, auditlog, auth, authtoken, django_celery_results, documents, … all OK); logs/guest-system-journal.log:285 shows paperless-web-start up by 05:16:05.
  • logs/guest-failed-units.log — systemctl --failed on the guest: 0 loaded units listed.
  • logs/guest-control-plane.log:198 — the deploy is declared failed at 05:16:05, i.e. 38 s AFTER the service it deployed came up. The classifier reddened a healthy node.

The defect

logSaysFailed (internal/clan/errors.go:353-419) is the masked-exit detector: on a zero exit it scans the activation log line-by-line for failure markers, one of which is "traceback" (internal/clan/errors.go:411).

The tripping line is pytest's own hint, printed beside a ResourceWarning / unraisable-exception warning when tracemalloc is off: "Enable tracemalloc to get traceback where the object was allocated." (the interpreter words the same hint "Enable tracemalloc to get the object allocation traceback"). It says only we could have told you where this object came from — it is never a failure.

It reaches the scan because a nix build that runs its checkPhase on the guest streams the derivation's stdout through activation, clan-prefixed and package-tagged — hence the [gateway] paperless-ngx> prefix. This became reachable now because the document-archive deploy builds its Python/OCR closure on the box rather than substituting it (25551a2b: "builds tesseract from source").

There was no exemption for it, so a benign build-test warning was recorded as masked-exit proof. This is the fifth entry in this detector's documented false-positive family: failed to reload (2026-08-05), error (ignored) (2026-08-07), cannot read ssh key (#456), warning: error: (#451).

Suspected layer

Failure classification, internal/clan/errors.go — not clan, not nix, not paperless. The build succeeded, the activation succeeded, the guest converged.

The fix

One line-by-line exemption on the distinctive phrase "tracemalloc to get" (covers both the pytest and interpreter wordings and nothing else), placed with the four existing exemptions, plus TestClassify_PytestTracemallocHintIsNotMasked pinning the drive's verbatim lines, the chunk-split form, and that a real Traceback (most recent call last): beside the hint still classifies masked_exit and carries that real line as proof.

Note on the repeated signature

8bcb93da00e3 was healed once before (1e85bf4d, drive 20260907T023209Z), but that heal did not resist — it worked. That red was a deploy timeout with two blind readouts; with the readouts fixed and the ceiling raised (25551a2b), this drive ran the deploy to full convergence and surfaced a different fault, in a different layer, with a different error class. The signature is leg-coarse; the defect is new.

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

Two-way door. Revertible: the change is one self-contained if strings.Contains(judged, "tracemalloc to get") { continue } block inside logSaysFailed (internal/clan/errors.go) — a later commit deletes it and the detector is bit-for-bit what it was; nothing persists, no state or schema is touched. Proven here: TestClassify_PytestTracemallocHintIsNotMasked (internal/clan/clan_test.go) was written first and failed on the drive's verbatim proof lines, then passed; it also pins the converse — a real Traceback (most recent call last): sharing the log with the hint still classifies masked_exit and carries that real line, and the hint never travels as proof — so the exemption cannot silently swallow a genuine failure. Mechanical, not a design decision: the detector's own doc-comment states its contract — "Kept deliberately narrow — only phrases clan/nixos-anywhere are known to print under a lying success… so benign activation noise can be exempted without blinding the detector" — and this repo has applied exactly that repair four times already (failed to reload, error (ignored), cannot read ssh key, warning: error:). A pytest hint out of a build's checkPhase is benign noise by that definition; exempting it makes the classifier do what it already means to do. Nothing a community sees, no default, route, secrets shape, message at a trust moment, or security posture changes — and the direction of the change is the safe one: it stops a converged deploy being reported as failed. A checkPhase that genuinely fails dies non-zero and never reaches this zero-exit scan at all. Built on the workstation (never the drive host) and closed through the close-report gate — the same gate a swarm worker passes.

drive 20260907T041410Z red at deploy-document-archive (sig 8bcb93da00e3) — self-fixed on the fast lane, commit 48b6f5caec4ea87266471eb4f9a954eb27ded928; checks: targeted (red-first): go test ./internal/clan/ -run TestClassify_PytestTracemallocHintIsNotMasked -v → FAIL before the fix (clan_test.go:416: a pytest tracemalloc hint must not mask a real success, got clan: masked_exit on gateway: … Enable tracemalloc to get traceback where the object was allocated.), PASS after. package: go test ./internal/clan/ → ok (18.5s). consumers: go test ./internal/provision/ ./internal/controlapi/ → both ok. whole tree: go test ./internal/... → every package ok, no failures. go build ./... → clean; gofmt -l internal/clan/ → clean. Commit shape: 2 files, 19 non-test lines added (internal/clan/errors.go 19/0), 0 deletions; no assertion, test or leg touched — the only test change is a new test added.. evidence: /home/swarm/swarm/Matou/idss/test-results/private-path/20260907T041410Z on matou-workstation.

## The failure Drive `20260907T041410Z` (commit `25551a2b`), 10 green / 1 red, `deploy-document-archive` after 3334881 ms (55.6 min — under the 75 m ceiling `25551a2b` set, so NOT a timeout): ``` deploy failed (clean-retry): provision: deploy gateway: clan: deploy failed on 1 node(s): gateway: clan: masked_exit on gateway: clan reported success but the log shows a real failure: [gateway] paperless-ngx> Enable tracemalloc to get traceback where the object was allocated. [gateway] paperless-ngx> Enable tracemalloc to get traceback where the object was allocated. [gateway] paperless-ngx> Enable tracemalloc to get traceback where the object was allocated. ``` `clean-retry` here is the RecoveryMode label the failure carries (`internal/provision/deploy.go:97`), not evidence of a second attempt — the control-plane log records exactly ONE `provision deploy failed`. ## The evidence: the deploy CONVERGED - `logs/guest-system-journal.log:59-177` — 05:15:27 the paperless slice is created, redis-paperless starts, `paperless-scheduler-pre-start` applies **every** migration (`account`, `auditlog`, `auth`, `authtoken`, `django_celery_results`, `documents`, … all `OK`); `logs/guest-system-journal.log:285` shows `paperless-web-start` up by 05:16:05. - `logs/guest-failed-units.log` — `systemctl --failed` on the guest: **`0 loaded units listed.`** - `logs/guest-control-plane.log:198` — the deploy is declared failed at **05:16:05**, i.e. **38 s AFTER** the service it deployed came up. The classifier reddened a healthy node. ## The defect `logSaysFailed` (`internal/clan/errors.go:353-419`) is the masked-exit detector: on a zero exit it scans the activation log line-by-line for failure markers, one of which is `"traceback"` (`internal/clan/errors.go:411`). The tripping line is **pytest's own hint**, printed beside a `ResourceWarning` / unraisable-exception warning when tracemalloc is off: *"Enable tracemalloc to get traceback where the object was allocated."* (the interpreter words the same hint *"Enable tracemalloc to get the object allocation traceback"*). It says only *we could have told you where this object came from* — it is never a failure. It reaches the scan because a nix build that runs its `checkPhase` **on the guest** streams the derivation's stdout through activation, clan-prefixed and package-tagged — hence the `[gateway] paperless-ngx> ` prefix. This became reachable now because the document-archive deploy builds its Python/OCR closure on the box rather than substituting it (`25551a2b`: "builds tesseract from source"). There was no exemption for it, so a benign build-test warning was recorded as masked-exit proof. This is the fifth entry in this detector's documented false-positive family: `failed to reload` (2026-08-05), `error (ignored)` (2026-08-07), `cannot read ssh key` (#456), `warning: error:` (#451). ## Suspected layer Failure classification, `internal/clan/errors.go` — not clan, not nix, not paperless. The build succeeded, the activation succeeded, the guest converged. ## The fix One line-by-line exemption on the distinctive phrase `"tracemalloc to get"` (covers both the pytest and interpreter wordings and nothing else), placed with the four existing exemptions, plus `TestClassify_PytestTracemallocHintIsNotMasked` pinning the drive's verbatim lines, the chunk-split form, and that a real `Traceback (most recent call last):` beside the hint **still** classifies `masked_exit` and carries that real line as proof. ### Note on the repeated signature `8bcb93da00e3` was healed once before (`1e85bf4d`, drive `20260907T023209Z`), but that heal did not resist — it worked. That red was a deploy **timeout** with two blind readouts; with the readouts fixed and the ceiling raised (`25551a2b`), this drive ran the deploy to full convergence and surfaced a different fault, in a different layer, with a different error class. The signature is leg-coarse; the defect is new. ## Proposed ruling (Ruled by the healer under ADR 0174 — veto anytime) Two-way door. **Revertible:** the change is one self-contained `if strings.Contains(judged, "tracemalloc to get") { continue }` block inside `logSaysFailed` (`internal/clan/errors.go`) — a later commit deletes it and the detector is bit-for-bit what it was; nothing persists, no state or schema is touched. **Proven here:** `TestClassify_PytestTracemallocHintIsNotMasked` (`internal/clan/clan_test.go`) was written first and failed on the drive's verbatim proof lines, then passed; it also pins the converse — a real `Traceback (most recent call last):` sharing the log with the hint still classifies `masked_exit` and carries that real line, and the hint never travels as proof — so the exemption cannot silently swallow a genuine failure. **Mechanical, not a design decision:** the detector's own doc-comment states its contract — *"Kept deliberately narrow — only phrases clan/nixos-anywhere are known to print under a lying success… so benign activation noise can be exempted without blinding the detector"* — and this repo has applied exactly that repair four times already (`failed to reload`, `error (ignored)`, `cannot read ssh key`, `warning: error:`). A pytest hint out of a build's checkPhase is benign noise by that definition; exempting it makes the classifier do what it already means to do. Nothing a community sees, no default, route, secrets shape, message at a trust moment, or security posture changes — and the direction of the change is the safe one: it stops a converged deploy being reported as failed. A checkPhase that genuinely fails dies non-zero and never reaches this zero-exit scan at all. Built on the workstation (never the drive host) and closed through the close-report gate — the same gate a swarm worker passes. drive `20260907T041410Z` red at `deploy-document-archive` (sig 8bcb93da00e3) — self-fixed on the fast lane, commit `48b6f5caec4ea87266471eb4f9a954eb27ded928`; checks: targeted (red-first): `go test ./internal/clan/ -run TestClassify_PytestTracemallocHintIsNotMasked -v` → FAIL before the fix (`clan_test.go:416: a pytest tracemalloc hint must not mask a real success, got clan: masked_exit on gateway: … Enable tracemalloc to get traceback where the object was allocated.`), PASS after. package: `go test ./internal/clan/` → ok (18.5s). consumers: `go test ./internal/provision/ ./internal/controlapi/` → both ok. whole tree: `go test ./internal/...` → every package ok, no failures. `go build ./...` → clean; `gofmt -l internal/clan/` → clean. Commit shape: 2 files, 19 non-test lines added (`internal/clan/errors.go` 19/0), 0 deletions; no assertion, test or leg touched — the only test change is a new test added.. evidence: `/home/swarm/swarm/Matou/idss/test-results/private-path/20260907T041410Z` on matou-workstation. <!-- rehearsal-sig: 8bcb93da00e3 -->
Author
Member

close-report for #1287 — status success

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

envelope
{
  "issue": 1287,
  "status": "success",
  "commits": [
    "48b6f5caec4ea87266471eb4f9a954eb27ded928"
  ],
  "changed_files": [
    "internal/clan/clan_test.go",
    "internal/clan/errors.go"
  ],
  "tests": [
    {
      "command": "targeted (red-first): `go test ./internal/clan/ -run TestClassify_PytestTracemallocHintIsNotMasked -v` → FAIL before the fix (`clan_test.go:416: a pytest tracemalloc hint must not mask a real success, got clan: masked_exit on gateway: … Enable tracemalloc to get traceback where the object was allocated.`), PASS after. package: `go test ./internal/clan/` → ok (18.5s). consumers: `go test ./internal/provision/ ./internal/controlapi/` → both ok. whole tree: `go test ./internal/...` → every package ok, no failures. `go build ./...` → clean; `gofmt -l internal/clan/` → clean. Commit shape: 2 files, 19 non-test lines added (`internal/clan/errors.go` 19/0), 0 deletions; no assertion, test or leg touched — the only test change is a new test added.",
      "exit_code": 0
    }
  ],
  "criteria": {
    "the red leg is now green": "healed on the fast lane, commit 48b6f5caec4ea87266471eb4f9a954eb27ded928"
  },
  "summary": "pytest's benign \"Enable tracemalloc to get traceback…\" hint, streamed through activation from the paperless-ngx build's checkPhase, tripped logSaysFailed's \"traceback\" marker and masked_exit'd a deploy that had fully converged (0 failed units, all paperless migrations applied); added a narrow line-by-line exemption for that phrase plus a test pinning that a real traceback beside it still reds.",
  "blockers": []
}
**close-report** for #1287 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1287, "status": "success", "commits": [ "48b6f5caec4ea87266471eb4f9a954eb27ded928" ], "changed_files": [ "internal/clan/clan_test.go", "internal/clan/errors.go" ], "tests": [ { "command": "targeted (red-first): `go test ./internal/clan/ -run TestClassify_PytestTracemallocHintIsNotMasked -v` → FAIL before the fix (`clan_test.go:416: a pytest tracemalloc hint must not mask a real success, got clan: masked_exit on gateway: … Enable tracemalloc to get traceback where the object was allocated.`), PASS after. package: `go test ./internal/clan/` → ok (18.5s). consumers: `go test ./internal/provision/ ./internal/controlapi/` → both ok. whole tree: `go test ./internal/...` → every package ok, no failures. `go build ./...` → clean; `gofmt -l internal/clan/` → clean. Commit shape: 2 files, 19 non-test lines added (`internal/clan/errors.go` 19/0), 0 deletions; no assertion, test or leg touched — the only test change is a new test added.", "exit_code": 0 } ], "criteria": { "the red leg is now green": "healed on the fast lane, commit 48b6f5caec4ea87266471eb4f9a954eb27ded928" }, "summary": "pytest's benign \"Enable tracemalloc to get traceback…\" hint, streamed through activation from the paperless-ngx build's checkPhase, tripped logSaysFailed's \"traceback\" marker and masked_exit'd a deploy that had fully converged (0 failed units, all paperless migrations applied); added a narrow line-by-line exemption for that phrase plus a test pinning that a real traceback beside it still reds.", "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#1287
No description provided.