Spaces: newly created space doesn't appear; retrying says "Create failed: Conflict" #174

Closed
opened 2026-08-10 00:49:12 +00:00 by Cordy · 1 comment
Owner

Dogfood note (Nikola): created a folder at the Spaces root (= self-service space creation, #94); it did not show up in the UI. Recreating with the same name → "Create failed: Conflict".

Probable mechanism (to verify): space creation succeeds on the first attempt — IdP group created, owner added, backend dir made — which is why the retry conflicts (the group exists). But the creator's visible spaces come from their resolved groups, and live group resolution (#96) caches per user for 60 seconds; the session snapshot doesn't have the new group either. So the new space is invisible for up to a minute, which reads as "creation failed".

Candidate fixes, in preference order:

  1. After a successful space create, invalidate/bypass the creator's group cache so the next listing resolves fresh — the space appears immediately.
  2. Failing that, optimistic UI: insert the new space into the listing client-side with a "provisioning…" affordance.
  3. Either way: the Conflict message should say what conflicts ("a space (IdP group) with this name already exists — it may take up to a minute to appear after creation").

Follow-up questions for Nikola:

  • Did the space appear on its own after ~1 minute (or after a re-login)? That confirms the cache theory; if it never appeared, this is a different bug (group created but owner membership failed — a Keycloak service-account permission gap would do that) and I need the pod log from around the creation time.
  • Was this on the dogfood (.249, OIDC/Keycloak) or the throwaway (local auth)? On local auth there are no IdP groups at all, and space creation failing there would be its own issue.
Dogfood note (Nikola): created a folder at the Spaces root (= self-service space creation, #94); it did not show up in the UI. Recreating with the same name → "Create failed: Conflict". **Probable mechanism (to verify):** space creation succeeds on the first attempt — IdP group created, owner added, backend dir made — which is why the retry conflicts (the group exists). But the creator's *visible* spaces come from their resolved groups, and live group resolution (#96) caches per user for **60 seconds**; the session snapshot doesn't have the new group either. So the new space is invisible for up to a minute, which reads as "creation failed". **Candidate fixes, in preference order:** 1. After a successful space create, **invalidate/bypass the creator's group cache** so the next listing resolves fresh — the space appears immediately. 2. Failing that, optimistic UI: insert the new space into the listing client-side with a "provisioning…" affordance. 3. Either way: the Conflict message should say *what* conflicts ("a space (IdP group) with this name already exists — it may take up to a minute to appear after creation"). **Follow-up questions for Nikola:** - Did the space appear on its own after ~1 minute (or after a re-login)? That confirms the cache theory; if it *never* appeared, this is a different bug (group created but owner membership failed — a Keycloak service-account permission gap would do that) and I need the pod log from around the creation time. - Was this on the dogfood (.249, OIDC/Keycloak) or the throwaway (local auth)? On local auth there are no IdP groups at all, and space creation failing there would be its own issue.
Author
Owner

Retested on v0.6.8 (Nikola) — cannot reproduce; creating a space no longer returns "Conflict" or leaves the space invisible. Likely fixed incidentally along the way (state-in-backend / spaces changes since this was filed).

Closing as cannot-reproduce. Reopen if it recurs — and if so, capture the exact POST /api/v1/spaces request/response and whether a partial space object landed in .cairn-state/.

Retested on v0.6.8 (Nikola) — cannot reproduce; creating a space no longer returns "Conflict" or leaves the space invisible. Likely fixed incidentally along the way (state-in-backend / spaces changes since this was filed). Closing as cannot-reproduce. Reopen if it recurs — and if so, capture the exact `POST /api/v1/spaces` request/response and whether a partial space object landed in `.cairn-state/`.
Cordy closed this issue 2026-08-11 15:57:43 +00:00
Sign in to join this conversation.
No labels
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: Cordy/Cairn#174
No description provided.