invalid_input. In Python that is passing both or neither of paths and prefix=; any other iterable, a dict included, is read as a list of paths. Go has a method per shape, so there is no target to get wrong. A path with a . or .. segment is rejected before any request is sent; see Paths.
The upload handler also deletes on its own: a throw out of the completion callback, or a cancel from the browser, removes the object that upload wrote. See Recording the upload.
One path
DELETE request. A 404 counts as success, so a delete is safe to run from a retried job or an at-least-once queue consumer. Any other failure throws; see Errors.
A delete never says whether anything was there. To find out, call exists first.
A list of paths
partial_delete with them as its failed paths. Everything not in that list was deleted. To recover, retry with those paths.
A prefix
list at 1000 objects per page and batch-deletes each page as it goes. A prefix with 100,000 objects is 100 list requests and 100 batch deletes, run one after another. It is not atomic; objects written under the prefix while it runs may or may not be caught.
Failures work as for a list. Survivors from every page are collected and thrown as partial_delete.
move leaves a copy on failure
move is a copy followed by a delete, because storage has no rename. If the copy fails, nothing changed and you get the copy’s error. If the copy succeeds and the delete fails, move throws move_left_a_copy and keeps the destination, so you have two objects rather than none. The original error is on the error’s cause.
Incomplete multipart uploads
A multipart upload becomes an object only when it is completed. Until then its parts are billed storage thatlist cannot see, and the bucket cannot be deleted while one exists. A browser tab closed mid-upload leaves exactly this behind.
put and a browser cancel abort their own uploads on failure. Anything else needs a sweep. The cron that runs it is on Abandoned uploads; the calls it uses are below. Signatures: TypeScript, Python, Go.
Listing incomplete uploads
Aborting one upload
invalid_input.
The completion callback receives the multipart upload id for exactly this pair. Store it with your row and you can abort a specific upload later without listing the bucket. It is not set for a single PUT.
Aborting stale uploads
time.Duration, and zero aborts every incomplete upload under the prefix. Only uploads started longer ago than that are touched, so a window longer than your slowest upload never aborts one still running. A day is a reasonable default.
An abandoned upload under the multipart threshold is not a multipart upload. It is an ordinary stored object that
list can see, and none of the calls above can find it. See Abandoned uploads.Error codes
A delete never raises
not_found. Statuses and extra fields are on Errors.