Skip to main content
← Back to list
01Issue
FeatureClosedSwamp CLIPublicTeam
AssigneesNone

Relationships

#4758 Let a revoked worker token's name be reused (or delete revoked token records)

Opened by ehazlett · 11/14/2026

Problem

A worker's name is its enrollment token's name, and a token name can never be minted again: swamp worker token revoke leaves the record behind in state revoked, and swamp worker token create <name> then refuses that name for good. There is no command to delete a revoked token record, and swamp worker connect has no option to connect under a name other than the token's.

So a name is used up by any token that never served a worker. A common way to hit this:

  1. swamp worker token create web-01 to bootstrap a new machine.
  2. Delivering the token fails before the machine ever connects (a mistyped address, an unreachable host, a failed install).
  3. The token is revoked, as it should be, rather than left live and unwatched.
  4. swamp worker token create web-01 is now refused permanently, and the machine can only join the pool under a different name (web-01-2, …) that does not match its hostname.

A token that was revoked with zero bindings (it never enrolled a worker) has no history worth protecting under that name, yet it blocks the name exactly as a token that served a long-lived worker would.

Proposed solution

Any one of these would solve it:

  • Delete a revoked token record: swamp worker token delete <name> (or revoke --purge), allowed only once a token is revoked or expired, after which the name can be minted again.
  • Release names of never-used tokens: let create reuse the name of a token that is revoked with bindingCount: 0, or have the worker GC reap such records.
  • Decouple the worker name from the token name: e.g. swamp worker token create <token-name> --worker-name <name>, or swamp worker connect --name <name>, so a fresh token can enroll a machine under its usual name.

Alternatives considered

  • Minting under a suffixed name and mapping it back to the hostname in tooling. It works, but the pool, run history, and worker list then show a name that does not match the machine, and every consumer has to know the mapping.
  • Waiting for the revoked record to expire. Its expiry is the token's full original lifetime (months), and it is not documented whether the name becomes reusable then.
  • Editing the datastore by hand, which goes around swamp and is not something an operator should do.
02Bog Flow
✓OPEN○TRIAGED○IN PROGRESS◉CLOSED

Closed

11/16/2026, 12:11:55 PM

No activity in this phase yet.

03Sludge Pulse
Editable. Press Enter to edit.

ehazlett commented 11/16/2026, 12:11:25 PM

Retested on 20261112.171308.0 and 20261114.210101.0, with tokens created both locally and through swamp serve --auth-mode token (worker token create --server). A worker token revoked before it was ever used, and one revoked after a worker had connected with it, can both be created again under the same name, and a worker connects under that name. The refusal I reported came from a check in my own tooling, not from swamp. Closing as not reproducible.

ehazlett commented 11/16/2026, 12:11:55 PM

Closing per the retest above: not reproducible on current builds.

Sign in to post a ripple.