Spaces: creating a folder at the space root fails with "Create failed:" (empty error) #209
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Cordy/Cairn#209
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found dogfooding the openbao-custody instance (keyCustody
openbao, postQuantum).Repro:
Create failed:with nothing after the colon (empty error).So the failure is specific to creating a folder at the top level of a space.
Two problems likely stacked:
mkdir(note the space key already exists from a prior file upload, and file writes into the space work, so it is specifically the folder-create-at-root path).Create failed:with an empty body). Likely theapi()raw-Responsepattern where the caller doesn'tawait res.json()on the error branch — same class as #136. Even once the backend is fixed, the empty-error display should be fixed so the next failure is diagnosable.Possibly related to #174 (spaces create Conflict/invisible). First step: read the pod log for the failed create request's status + error, then the mkdir handler + space scope path, then the frontend create-folder error display.
Diagnosis so far.
Folder-create uses
POST /api/v1/dirs→h.Store.Mkdir(always wired; unrelated to the spaces-management API in #210). Through the scope driver (scope.go), Mkdir at a space root resolves cleanly for a member of the group, runsensureReal, theninner.Mkdir("/spaces/<group>/<name>"). The only structural difference from the working cases — a folder in/home, or a folder deeper inside an existing space subfolder — is the encryption identity: a space key vs the user key.Since file writes into the space and folder-create deeper inside the space both succeed, the space key itself is fine — so the failure is specific to Mkdir at the top level of a space. The empty
Create failed:toast is a separate frontend bug: theapi()raw-Responseisn't parsed on the error branch, so no message surfaces (#136 class), which is why the real cause is invisible from the UI.To pin the backend error I need the exact server response — the pod-log window didn't capture the failing request. Next step: reproduce the folder-create at a space root while tailing the
cairn-openbaopod, read the status +writeErrbody, then trace whether it's the encrypt layer's space-key handling on a dir marker at the space root or a scope/inner Mkdir edge.Reproduced in-browser — and it is NOT a Mkdir bug. Corrected diagnosis:
POST /api/v1/dirs→201(verified in the pod log — madedebug-rootfolderinsideFall 3with no error).Create failed:happens on the "New folder" button at the top-level Spaces list. That button doesn't call/dirs— it callsPOST /api/v1/spaces(create a new space), which returns404(19-byte404 page not found) — the exact same unwired-h.Spacescause as #210.So #209 and #210 are one backend issue (the spaces-management API isn't registered on this instance because no Keycloak admin client is configured), surfaced through two different buttons, plus the frontend swallowing the 404.
Reframed, the real defects are:
Create failed:with no message; add-member silently nothing) — it must surface the real response,#136class.Folder creation within a space is fine and needs no change.
Fixed and verified live. Root cause was exactly the stacked pair called out here: the create-space POST at a Space root 404'd because spaces management was only wired when a Keycloak admin client was configured (openbao custody has none), and the frontend swallowed the error (
api()rawResponsenever.json()'d on the failure branch → emptyCreate failed:).Resolved by the #211 epic rather than a point patch:
Verified on v0.6.18, both deployment types:
app-owned-spacepersisted across a redeploy.IdP-managed spaces enabled (power mode)): create-space + members controls present and working.Empty-error class closed too: failures now surface the real message on both paths. Closing.