Repository navigation
Description
Summary
The proxy forwards per-object DELETE /{bucket}/{key} but does not
implement S3's multi-object delete (POST /{bucket}?delete, the DeleteObjects
verb). Requests to it 404 with NoSuchBucket: <account_id> because the proxy
routes by object key and has no bucket-root handler.
This forces clients that need to delete many objects (e.g. an entire prefix) to
issue one DELETE per key. For large stores — a Zarr dataset can have thousands
to millions of chunks — that is thousands of round-trips and a lot of proxy load.
Context: source.coop PR source-cooperative/source.coop#403 added a file-explorer
"delete prefix" button; it currently lists the prefix and deletes each key
individually (concurrency 8) as a workaround. Correct, but slow at scale.
What we'd like
A way to delete many objects in one request. Two shapes, in preference order:
- Scoped recursive prefix-delete (preferred for our use case): a single
request "delete everything under prefixP". The proxy authorizes the prefix
once against the caller's scope, then lists + deletes server-side.- Pros: one authz check; works uniformly across S3/GCS/Azure backends;
collapses N requests → 1 for the client.
- Pros: one authz check; works uniformly across S3/GCS/Azure backends;
- Standard S3
DeleteObjectspassthrough: implement the bucket-root
?deleteendpoint so standard S3 tooling (rclone, boto3, aws-cli bulk delete)
works against the proxy.- Pros: S3-tool compatibility — a reason that stands on its own, independent
of our delete button.
- Pros: S3-tool compatibility — a reason that stands on its own, independent
Known complexity (why this isn't a trivial passthrough)
- Per-key authorization. The proxy is the per-object authz enforcement
point.DeleteObjectsbundles up to 1000 arbitrary keys in the request
body (not the URL path). To be safe the proxy must parse the body and
authorize every key against the caller's scope, returning per-key errors —
otherwise one request could mix keys across products/accounts. This is the main
cost and likely why no handler exists today. (A scoped prefix-delete avoids
this: one prefix check.) - Backend heterogeneity. Only S3 has a native ~1000-key batch delete. GCS and
Azure Blob have different/limited batch primitives, so for those backends the
proxy would fan out to per-object deletes server-side anyway — the batch
speedup is fully realized only for S3-backed connections. - Response semantics.
DeleteObjectsreturns 200 with a per-key result body
(including partial failures) and honorsQuietmode; the proxy must construct
that correctly. - Read-only / unowned connections must continue to be rejected (we don't own
that data).
Suggested scope
If the goal is just to speed up our own prefix deletes, option (1) is simpler and
safer. Implement option (2) only if S3-tool compatibility is independently
wanted. Either way, per-key/per-prefix authorization is non-negotiable.
Workaround in place
source.coop deletes prefixes per-object client-side today (PR
source-cooperative/source.coop#403, S3UploadService.deletePrefix). No action is
blocked; this issue is about performance at scale.
Activity
nlebovits commentedon Nov 27, 2026
A reprex for the
DeleteObjectspart of this issue, plus two findings that #173 does not record.Findings
DeleteObjectsworks when the repository is the bucket and the account is in the endpoint path (https://data.source.coop/{account}, bucket{repo}). It fails only when the account is the bucket. Every other verb that we tried works with the account as the bucket.404 NoSuchBucket. S3 clients read a 404 on a delete as "the object is already gone". obstore / Rustobject_storesends every delete asDeleteObjects, also a delete of one key. So with the account as the bucket, an obstore delete raisesFileNotFoundErrorand the object stays. A client that ignores a not-found error on delete (a common pattern) then reports a successful delete.We found this in Portolan (portolan-sdi/portolan-cli#1205). A catalog writer "deleted" a collection that stayed in the bucket.
portolan pushalso leaves backup objects behind that it cannot delete.Reprex
boto3 1.42.84, profile with
credential_process = source-coop creds:Output on 2026-11-27:
Step 4 is the failure.
b.jsonis still there after a delete that some clients treat as a success.Requests
POST /{account}?deleteand route each key by its first segment, the same wayDeleteObjectis routed. Steps 3 and 5 suggest the routing already exists.POST /{account}?deletewith501 NotImplemented, not404 NoSuchBucket. A 501 makes the delete fail loudly in obstore, boto3, and rclone. A 404 lets it look like a success.