s3: a write into a missing folder creates the folder silently (posix answers 409 / not found) #980

Closed
opened 2026-10-20 06:00:23 +00:00 by Cordy · 0 comments
Owner

Found in the batch 4 Task F report (deviation 6, 2026-10-19). This predates batch 4.

What happens:

  • On s3, a PUT or upload to /a/b/c.txt where /a/b does not exist succeeds, and the folder appears implicitly as a prefix.
  • On posix the same request fails: REST answers 404 or 409, and WebDAV answers 409 Conflict, per RFC 4918 §9.7.1 ("missing intermediate collection").

So the two backends behave differently. Sync clients that rely on the 409 to create parents first never get it on s3. The OCM grant PUT test for a missing parent therefore runs on posix only.

Expected: s3 refuses a write whose parent folder does not exist, with the same error posix maps to. A whole-folder upload that creates its folders first is unaffected. Implicit prefixes created before this change keep working; decide whether a prefix that holds files counts as an existing folder, and document it.

To do:

  • Check the cost: one more HEAD or LIST per new file, or reuse the parent checks that #963 added.
  • Test on posix and s3 through REST, WebDAV, TUS, OCM and the public drop link.
Found in the batch 4 Task F report (deviation 6, 2026-10-19). This predates batch 4. **What happens:** - On s3, a PUT or upload to `/a/b/c.txt` where `/a/b` does not exist succeeds, and the folder appears implicitly as a prefix. - On posix the same request fails: REST answers 404 or 409, and WebDAV answers 409 Conflict, per RFC 4918 §9.7.1 ("missing intermediate collection"). So the two backends behave differently. Sync clients that rely on the 409 to create parents first never get it on s3. The OCM grant PUT test for a missing parent therefore runs on posix only. **Expected:** s3 refuses a write whose parent folder does not exist, with the same error posix maps to. A whole-folder upload that creates its folders first is unaffected. Implicit prefixes created before this change keep working; decide whether a prefix that holds files counts as an existing folder, and document it. **To do:** - Check the cost: one more HEAD or LIST per new file, or reuse the parent checks that #963 added. - Test on posix and s3 through REST, WebDAV, TUS, OCM and the public drop link.
Cordy closed this issue 2026-10-27 12:22:53 +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#980
No description provided.