gitea: clear duplicate mesh-tools tokens by id and back off a failed mint (hq issue 739) #314

Closed
mesh-tools wants to merge 1 commits from fix/739-token-duplicates into main
Member

Part of hq issue 739 (the control-node overloaded on 2026-10-14).

Seen

At 22:27 local mesh-tools #34's walk restarted node-tools; the gitea watcher and its tools came back as two processes, each with its own token source (token.ts:127-135 shares one only within a process). At 22:28:46 the forge rejected the kept token; from then every gitea call minted again, got "already holds", and its delete by name failed with 422 multiple matches for token name 'mesh-tools' — several times a minute, each with two admin logins, and every forge-reading step failed (merge checks, open-pulls, the bazarr build's protection check). Probable cause: two mints raced and left two tokens with the same name. The operator deleted both tokens by hand on 2026-10-15; the forge tools work again.

Change

  • When a delete by name answers 422, list the admin account's tokens and delete each one named mesh-tools by its id, then mint.
  • A failed mint is not tried again for 30 s, so a broken forge is not hammered.
  • Two new tests; the gitea TypeScript check passes 103 of 103.

Not in this pull request

  • Two processes each minting their own token (the race itself) — a token shared across processes or one minter.
  • mesh-delivery's open-pulls read every minute since #303.

Acceptance

With two mesh-tools tokens on the forge, the next gitea call clears both and mints one, and gitea tools answer.

Part of hq issue 739 (the control-node overloaded on 2026-10-14). ## Seen At 22:27 local mesh-tools #34's walk restarted node-tools; the gitea watcher and its tools came back as two processes, each with its own token source (`token.ts:127-135` shares one only within a process). At 22:28:46 the forge rejected the kept token; from then every gitea call minted again, got "already holds", and its delete by name failed with `422 multiple matches for token name 'mesh-tools'` — several times a minute, each with two admin logins, and every forge-reading step failed (merge checks, open-pulls, the bazarr build's protection check). Probable cause: two mints raced and left two tokens with the same name. The operator deleted both tokens by hand on 2026-10-15; the forge tools work again. ## Change - When a delete by name answers 422, list the admin account's tokens and delete each one named `mesh-tools` by its id, then mint. - A failed mint is not tried again for 30 s, so a broken forge is not hammered. - Two new tests; the gitea TypeScript check passes 103 of 103. ## Not in this pull request - Two processes each minting their own token (the race itself) — a token shared across processes or one minter. - mesh-delivery's open-pulls read every minute since #303. ## Acceptance With two `mesh-tools` tokens on the forge, the next gitea call clears both and mints one, and gitea tools answer.
mesh-tools added 1 commit 2026-10-15 08:34:06 +00:00
Drop every mesh-tools token by id when the forge holds two, and stop re-minting on every call (hq issue 739)
mesh/merge-gate head ee2160d00c22 merged into trunk c71c513027e5 — fail: builds gitea → novox; no bus step; head ee2160d00c22 does not merge cleanly into t…
mesh/repo-check head ee2160d00c22 merged into trunk c71c513027e5 — fail: head ee2160d00c22 does not merge cleanly into trunk c71c513027e5: in conflict modu…
mesh/delivery stopped: the pull request closed unmerged
ee2160d00c
On 2026-10-14 from 22:28 local the forge held two tokens named mesh-tools.
gitea refuses a delete by such a name with 422 "multiple matches", so every
gitea tool call re-entered the mint, made two basic-auth calls that hash the
admin password, and failed: several times a minute, on a control-node that was
already overloaded, and mesh-delivery could read neither open pulls nor views.

The watcher and the tools run as separate bundles, so the in-process sharing
of one token source does not cover them; two mints racing leave two tokens by
the name, because the forge's check that a name is unused is not atomic.

A 422 on the delete by name now lists the account's tokens and drops each one
carrying the name by its id, then mints. A failed mint is not asked of the
forge again for 30 s: the same error is answered without a call.
Author
Member

Merge check at ee2160d0
Judged: head ee2160d00c22 merged into trunk c71c513027e5

  • mesh/merge-gate: FAIL — head ee2160d00c does not merge cleanly into trunk c71c513027: in conflict modules/gitea/test/token.test.ts, modules/gitea/token.ts (modules: gitea)
  • mesh/repo-check: FAIL — head ee2160d00c does not merge cleanly into trunk c71c513027: in conflict modules/gitea/test/token.test.ts, modules/gitea/token.ts

Delivery plan — builds gitea → novox; no bus step

  • tier 0: gitea
  • novox: receives gitea
  • gitea provides npm-package-registry, git: its consumers are sent again after it
  • gitea keeps data (ADR 0233): what it holds is backed up before it moves

Run by the build seat on novox as build-1792053249207229391 (builds --log build-1792053249207229391).

head ee2160d00c22 does not merge cleanly into trunk c71c513027e5: in conflict modules/gitea/test/token.test.ts, modules/gitea/token.ts
**Merge check** at `ee2160d0` Judged: head `ee2160d00c22` merged into trunk `c71c513027e5` - `mesh/merge-gate`: **FAIL** — head ee2160d00c22 does not merge cleanly into trunk c71c513027e5: in conflict modules/gitea/test/token.test.ts, modules/gitea/token.ts (modules: gitea) - `mesh/repo-check`: **FAIL** — head ee2160d00c22 does not merge cleanly into trunk c71c513027e5: in conflict modules/gitea/test/token.test.ts, modules/gitea/token.ts **Delivery plan** — builds gitea → novox; no bus step - tier 0: gitea - novox: receives gitea - gitea provides npm-package-registry, git: its consumers are sent again after it - gitea keeps data (ADR 0233): what it holds is backed up before it moves Run by the build seat on novox as `build-1792053249207229391` (`builds --log build-1792053249207229391`). ``` head ee2160d00c22 does not merge cleanly into trunk c71c513027e5: in conflict modules/gitea/test/token.test.ts, modules/gitea/token.ts ```
Author
Member

Delivery novox/mesh-catalog@ee2160d00c22 — stopped since 2026-10-15T08:44:31Z

Delivery plan — builds gitea → novox; no bus step

  • tier 0: gitea
  • novox: receives gitea
  • gitea provides npm-package-registry, git: its consumers are sent again after it
  • gitea keeps data (ADR 0233): what it holds is backed up before it moves

Transitions

  • 2026-10-15 08:34 (new) → proposed (announced): novox/mesh-catalog#314's head announced
  • 2026-10-15 08:34 proposed → checked (checked): a verdict names this commit and the trunk's head as its trunk commit
  • 2026-10-15 08:34 checked → rejected (refused): the gate failed or could not run, or the repository's own check failed
  • 2026-10-15 08:44 rejected → stopped (closed): the pull request closed unmerged

The commit's note under refs/notes/mesh-plan keeps every transition: git log --notes=mesh-plan.

<!-- mesh-delivery:view --> **Delivery** `novox/mesh-catalog@ee2160d00c22` — **stopped** since 2026-10-15T08:44:31Z **Delivery plan** — builds gitea → novox; no bus step - tier 0: gitea - novox: receives gitea - gitea provides npm-package-registry, git: its consumers are sent again after it - gitea keeps data (ADR 0233): what it holds is backed up before it moves **Transitions** - 2026-10-15 08:34 (new) → proposed (announced): novox/mesh-catalog#314's head announced - 2026-10-15 08:34 proposed → checked (checked): a verdict names this commit and the trunk's head as its trunk commit - 2026-10-15 08:34 checked → rejected (refused): the gate failed or could not run, or the repository's own check failed - 2026-10-15 08:44 rejected → stopped (closed): the pull request closed unmerged The commit's note under `refs/notes/mesh-plan` keeps every transition: `git log --notes=mesh-plan`.
mesh-tools closed this pull request 2026-10-15 08:39:22 +00:00

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: novox/mesh-catalog#314