transloadit/uppy · error · Error
${C.ERROR_PREFIX}Failed to delete object. HTTP status: ${xhr
Error message
${C.ERROR_PREFIX}Failed to delete object. HTTP status: ${xhr.status} What it means
deleteObject expects HTTP 200 or 204 from a DELETE object request; any other status throws with the raw status code, indicating S3 rejected the deletion.
Source
Thrown at packages/@uppy/aws-s3/src/s3-client/S3mini.ts:526
parts: Array<IT.UploadPart>,
): string {
let xml = '<CompleteMultipartUpload>'
for (const part of parts) {
xml += `<Part><PartNumber>${part.partNumber}</PartNumber><ETag>${part.etag}</ETag></Part>`
}
xml += '</CompleteMultipartUpload>'
return xml
}
/** Deletes an object from the bucket. Returns true on success. */
public override async deleteObject({ key, signal }: IT.DeleteObjectParams) {
const { xhr } = await this.request({
request: { method: 'DELETE', key },
signal,
})
if (xhr.status !== 200 && xhr.status !== 204) {
throw new Error(
`${C.ERROR_PREFIX}Failed to delete object. HTTP status: ${xhr.status}`,
)
}
}
/**
* Clears cached credentials.
* Call this method when you need to force a credential refresh on the next request.
*/
public clearCachedCredentials(): void {
this.cachedCredentials = undefined
this.cachedCredentialsPromise = undefined
}
private _parseErrorXml(
getHeader: (name: string) => string | null,
body: string,
): { svcCode?: string; errorMessage?: string } {View on GitHub (pinned to 5d4dedd02a)
Solutions
- Check xhr/status embedded in the message to identify 403 (permissions) vs 404 (bucket/endpoint)
- Verify the bucket policy grants s3:DeleteObject to the credentials
- Confirm the endpoint and key are correct (no leading-slash or encoding issues)
Defensive patterns
Strategy: try-catch
Validate before calling
null
Type guard
null
Try / catch
try { await deleteObject({ key }) } catch (e) { const status = Number(/HTTP status: (\d+)/.exec(String(e?.message))?.[1]); if (status === 404 || status === 204) return; throw e } Prevention
- Grant s3:DeleteObject in bucket policy
- Use exact keys returned at creation time
- Treat already-deleted objects as success
When it happens
Trigger: Calling s3Mini.deleteObject on a key with invalid credentials (403), a non-existent bucket (404), or a key that fails validation (400).
Common situations: Cleanup of aborted uploads, removing partially uploaded objects, bucket policy denying DeleteObject.
Related errors
- S3 returned ${xhr.status}${serviceCode ? ` – ${serviceCode}`
- ERROR_UPLOAD_ID_REQUIRED
- ${C.ERROR_PREFIX}CompleteMultipartUpload response missing Lo
- ${C.ERROR_PREFIX}Failed to complete multipart upload: ${JSON
- ${C.ERROR_PREFIX}Failed to abort multipart upload: ${String(
AI-assisted analysis of transloadit/uppy@5d4dedd02a (2026-08-28).
Data as JSON: /api/errors/999944fcb0f90e1a.
Report an issue: GitHub.