{"record":{"id":"a992d34a187a2b70","repo":"transloadit/uppy","slug":"s3mini-failed-to-create-multipart-upload-json","errorCode":null,"errorMessage":"[s3mini] Failed to create multipart upload: ${JSON.stringify(\n          parsed,\n        )}","messagePattern":"\\[s3mini\\] Failed to create multipart upload: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/@uppy/aws-s3/src/s3-client/S3mini.ts","lineNumber":239,"sourceCode":"    const parsed = U.parseXml(xhr.responseText) as Record<string, unknown>\n\n    if (parsed && typeof parsed === 'object') {\n      // Check for both cases of InitiateMultipartUploadResult\n      const uploadResult =\n        (parsed.initiateMultipartUploadResult as Record<string, unknown>) ||\n        (parsed.InitiateMultipartUploadResult as Record<string, unknown>)\n\n      if (uploadResult && typeof uploadResult === 'object') {\n        // Check for both cases of uploadId\n        const uploadId = uploadResult.uploadId || uploadResult.UploadId\n\n        if (uploadId && typeof uploadId === 'string') {\n          return { uploadId, key }\n        }\n      }\n    }\n\n    throw new Error(\n      `${C.ERROR_PREFIX}Failed to create multipart upload: ${JSON.stringify(\n        parsed,\n      )}`,\n    )\n  }\n\n  public override async uploadPart({\n    key,\n    uploadId,\n    data,\n    partNumber,\n    onProgress,\n    signal,\n  }: IT.UploadPartParams) {\n    this._validateUploadPartParams(key, uploadId, partNumber)\n\n    const { xhr } = await this.request({\n      request: {","sourceCodeStart":221,"sourceCodeEnd":257,"githubUrl":"https://github.com/transloadit/uppy/blob/5d4dedd02a1ac0ae022c75c54aca76558f88e256/packages/@uppy/aws-s3/src/s3-client/S3mini.ts#L221-L257","documentation":"After POSTing CreateMultipartUpload, s3mini parses the XML response and expects an `<UploadId>` string. If the response parses but contains no valid uploadId (e.g. S3/proxy returned an error document, empty body, or HTML page), this generic Error is thrown with the parsed payload serialized for debugging. It means the request completed but the multipart session was not created.","triggerScenarios":"S3 returns a 200-ish or error XML without UploadId: wrong bucket permissions (AccessDenied), nonexistent bucket (NoSuchBucket), a signature mismatch returned as XML, a proxy/gateway returning HTML, or the endpoint pointing at a non-S3 service.","commonSituations":"Misconfigured credentials or wrong region causing S3 error XML; endpoint pointing to a CDN/gateway that strips the request; bucket name typos; CORS/proxy interference altering responses; S3-compatible backends (MinIO versions) with different XML shapes.","solutions":["Inspect the JSON.stringify'd payload in the error message — it usually contains the S3 error code (AccessDenied, NoSuchBucket, InvalidAccessKeyId) that identifies the root cause.","Verify bucket permissions and that the IAM user has s3:PutObject / s3:PutObjectMultipart actions.","Confirm the endpoint/region pair is correct and the bucket exists.","If a proxy sits in front of S3, test the same request with curl/awscurl to see the raw XML response."],"exampleFix":"// before\nconst { uploadId } = await s3.createMultipartUpload({ key }) // throws generic error\n// after\ntry {\n  const { uploadId } = await s3.createMultipartUpload({ key })\n} catch (err) {\n  console.error('S3 createMultipartUpload failed:', err.message) // inspect parsed XML error code\n  throw err\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const { uploadId } = await s3.createMultipartUpload({ key })\n} catch (err) {\n  const msg = String(err?.message ?? '')\n  if (/AccessDenied/.test(msg)) throw new Error('Insufficient S3 permissions for multipart upload')\n  if (/NoSuchBucket/.test(msg)) throw new Error('Target bucket does not exist')\n  throw err\n}","preventionTips":["Log the full parsed payload from the error message — it contains the S3 error code.","Test bucket policy/IAM for s3:PutObject and multipart actions before shipping.","Verify endpoint+region+bucket triple in staging before production."],"tags":["aws-s3","multipart-upload","xml-parsing","s3-error"],"backgroundTag":"s3-access-denied","analyzedSha":"5d4dedd02a1ac0ae022c75c54aca76558f88e256","analyzedAt":"2026-08-28T12:18:41.267Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}