Spaces: opening a space whose folder is missing recreates it empty #961

Closed
opened 2026-10-18 11:36:02 +00:00 by Cordy · 2 comments
Owner

Found in the #931 research (2026-10-18).

What happens

When a space's backend folder is missing, opening the space recreates the folder empty (internal/storage/scope/scope.go around lines 287-307). A folder can go missing in three ways: a rename that has not finished converging, a delete outside Cairn, or a lost mount. The user sees an empty space with no explanation. Afterwards, the recreated empty folder can block or confuse convergence and recovery. The #931 research describes how it interacts with a half-finished rename.

Expected

A space whose folder is missing shows a clear state instead of an empty folder ("This space's storage folder is missing; an administrator has been notified"). Cairn logs a WARN and sends an admin bell, and never recreates the folder silently. Only creating a brand-new space makes its folder.

To do

  • Decide the user-visible text and behaviour. This needs a mockup.
  • Stop the silent recreation.
  • Test it on posix and s3.
Found in the #931 research (2026-10-18). ## What happens When a space's backend folder is missing, opening the space recreates the folder empty (`internal/storage/scope/scope.go` around lines 287-307). A folder can go missing in three ways: a rename that has not finished converging, a delete outside Cairn, or a lost mount. The user sees an empty space with no explanation. Afterwards, the recreated empty folder can block or confuse convergence and recovery. The #931 research describes how it interacts with a half-finished rename. ## Expected A space whose folder is missing shows a clear state instead of an empty folder ("This space's storage folder is missing; an administrator has been notified"). Cairn logs a WARN and sends an admin bell, and never recreates the folder silently. Only creating a brand-new space makes its folder. ## To do - Decide the user-visible text and behaviour. This needs a mockup. - Stop the silent recreation. - Test it on posix and s3.
Author
Owner

Mockup approved by Nikola (2026-10-19), as drawn (batch3-mockups.html, scenes 8a-9b).

  • Members (and owners who are not admins): a notice replaces the file list, worded as a title plus one line. Upload and New are greyed out.
  • Admins: they see the same notice with "Open Administration › Spaces".
  • Admin row: the row in Administration › Spaces reuses the #931 badge as "Folder missing" with a "Check again" action.
  • Bell: admins get a clickable bell item that lands on that row.

It will be built in batch 3 (v0.6.350) together with #935 and #931.

**Mockup approved by Nikola (2026-10-19), as drawn** (batch3-mockups.html, scenes 8a-9b). - **Members (and owners who are not admins):** a notice replaces the file list, worded as a title plus one line. Upload and New are greyed out. - **Admins:** they see the same notice with "Open Administration › Spaces". - **Admin row:** the row in Administration › Spaces reuses the #931 badge as "Folder missing" with a "Check again" action. - **Bell:** admins get a clickable bell item that lands on that row. It will be built in batch 3 (v0.6.350) together with #935 and #931.
Author
Owner

Shipped in v0.6.350 (PR #970). Both dogfoods run it.

What changed:

  • A space folder is now made only when a space is created, when one is restored, when a rename converges, or once on first open if it never existed. The registry records when the folder was first made or seen (folderMade).
  • A recorded folder that is missing answers 503 space-folder-missing with Retry-After, on REST, WebDAV and TUS. Members see a notice in place of an empty list, with Upload and New disabled.
  • Admins get a bell item, a "Folder missing" row and Check again.
  • During a move, members get space-folder-moving instead.

Live, 2026-10-19:

  • Start pass on upgrade: it recorded the existing folders, 5 on files and 13 on files-bao (spaces: recorded the folders of existing spaces).
  • No false alarms: no space shows "Folder missing" on either instance.
  • Spaces still created and opened normally: files-bao's test spaces and files' "test" space, read and write.

Not exercised live: the missing-folder state itself. It needs a space folder removed on the backend, and I don't touch backend storage. It is covered by tests, including an upgrade with unmounted storage and a second instance with a stale cache.

**Shipped in v0.6.350 (PR #970). Both dogfoods run it.** **What changed:** - A space folder is now made only when a space is created, when one is restored, when a rename converges, or once on first open if it never existed. The registry records when the folder was first made or seen (`folderMade`). - A recorded folder that is missing answers **503 `space-folder-missing`** with Retry-After, on REST, WebDAV and TUS. Members see a notice in place of an empty list, with Upload and New disabled. - Admins get a bell item, a "Folder missing" row and **Check again**. - During a move, members get `space-folder-moving` instead. **Live, 2026-10-19:** - **Start pass on upgrade:** it recorded the existing folders, 5 on files and 13 on files-bao (`spaces: recorded the folders of existing spaces`). - **No false alarms:** no space shows "Folder missing" on either instance. - **Spaces still created and opened normally:** files-bao's test spaces and files' "test" space, read and write. **Not exercised live:** the missing-folder state itself. It needs a space folder removed on the backend, and I don't touch backend storage. It is covered by tests, including an upgrade with unmounted storage and a second instance with a stale cache.
Cordy closed this issue 2026-10-19 20:13:05 +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#961
No description provided.