fix(client create): honest conflict message — name the owner, handle cluster_in_use#191
Open
LukasWodka wants to merge 1 commit into
Open
fix(client create): honest conflict message — name the owner, handle cluster_in_use#191LukasWodka wants to merge 1 commit into
LukasWodka wants to merge 1 commit into
Conversation
…cluster_in_use The CLI mapped every provisioning 409 to a static "registered to a different tracebloc account — sign in to that account, or ask your admin" — which was often FALSE (the same-account phantom case) and a dead end. With the backend's fix #2 (backend#1021) the 409 body now distinguishes: • cluster_conflict — genuinely another account; body carries owner_email; • cluster_in_use — a same-account client is live on this cluster. New conflictMessage() parses the 409 body and picks the right guidance: • cross-account → "registered to another tracebloc account (<owner_email>) — ask them to release it, or sign in as that account" (contact-the-owner, never "delete the cluster" — it isn't ours to wipe; names the owner when supplied); • cluster_in_use → "another tracebloc client (<name>) in your account is already live on this cluster — offboard it first with `tracebloc delete`, or provision on a separate machine". Degrades gracefully against a backend without fix #2 (empty/unparseable body → the generic cross-account text). The client-side not-owned refusal (no HTTP body) keeps the generic message. Reworded crossAccountConflictMsg to match. Companion to backend#1021 (fix #2) and cli#190 (fix #1) of the phantom-client migration. Tests: owner_email surfaced; cluster_in_use names the live client and does NOT read as cross-account; existing cross-account + client-side-refusal messages updated to the new wording. Full suite green; gofmt -s / errcheck / ineffassign / misspell clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The CLI mapped every provisioning 409 to a single static message — "registered to a different tracebloc account — sign in to that account, or ask your admin" — which was frequently false (the same-account phantom case) and a dead end.
With the backend's fix #2 (backend#1021) the 409 body now distinguishes two cases, and this PR makes the CLI read them:
cluster_conflict(+owner_email)cluster_in_use(+holder_name)tracebloc delete, or provision on a separate machine"This is the CLI companion to fix #2, and part of the phantom-client migration alongside cli#190 (fix #1).
Notes
crossAccountConflictMsgreworded to match ("another … ask its owner to release it").Tests
owner_emailsurfaced + contact-the-owner guidance;cluster_in_usenames the live client and must not read as cross-account; existing cross-account + client-side-refusal assertions updated to the new wording. Fullgo test ./...green;gofmt -s/errcheck/ineffassign/misspellclean.Note
Low Risk
User-facing error text and JSON parsing only; no auth or provisioning flow changes beyond clearer 409 handling.
Overview
tracebloc client createno longer treats every provisioning 409 as a generic cross-account conflict. It parses the API error body and shows guidance that matches what the backend reports (fix #2).For
cluster_conflict, the message can includeowner_emailand tells the user to ask that owner to release the cluster or sign in as that account. Forcluster_in_use, it names the live client (holder_name) and points totracebloc deleteor another machine—without implying another account. The sameconflictMessagelogic applies on PATCH anchor backfill 409s during R7 adopt.If the body is missing or old, behavior falls back to updated generic cross-account copy (“another tracebloc account … ask its owner to release it”). Tests cover owner email,
cluster_in_use, and updated wording.Reviewed by Cursor Bugbot for commit 3f1c6c8. Bugbot is set up for automated code reviews on this repo. Configure here.