S3 "InvalidPart: One or More of the Specified Parts Could Not Be Found": Fix CompleteMultipartUpload From ListParts, the Null ETag in Browser Uploads, InvalidPartOrder, EntityTooSmall and Checksums

Logeshwaran
—

S3 "InvalidPart: One or more of the specified parts could not be found" comes from the last step of a multipart upload, CompleteMultipartUpload, and the full message names its two causes: "The part might not have been uploaded, or the specified entity tag might not have matched the part's entity tag." In practice the second cause wins almost every time. Your parts are usually already in S3; what is wrong is the list you send back. Each part's ETag (the receipt S3 returned when the part arrived) is missing, empty, stale or mangled, or the list names a part number that never finished. The reliable fix is to stop trusting your own bookkeeping and complete the upload from S3's own record of the parts: ListParts returns every stored part with its exact ETag, and building the completion list from it fixes the error in one step. This page covers that fix in the CLI, Python and JavaScript, then each cause in turn: browser uploads that cannot read the ETag, retried parts, lost parts in parallel uploads, hand-computed MD5s on encrypted buckets, checksums, and the neighboring errors InvalidPartOrder and EntityTooSmall.

Jake's repair shop lets customers upload a video of their broken phone before they come in, straight from the browser to S3, in 10 MB parts. The progress bar reached 100% every time, and then the page said "Upload failed". Ethan, his developer friend, opened the browser console and found the completion request carrying a list of parts whose ETags were all null. "S3 has every byte," Ethan said. "We just never kept the receipts." This page is how he proved it, fixed it, and made the uploader stop depending on receipts it could lose.

Update November 29, 2026: read parts while the upload is still running

Amazon S3 now makes each part of a multipart upload readable as soon as it arrives. The new GetPart API reads a whole part or a byte range within it, during or after the upload, and a new s3:MultipartUpload:PartUploaded event tells your code when each part is ready, so media, analytics and transcription pipelines can start processing before the object completes. It works for general purpose buckets in all Regions with the latest CLI and SDKs (announcement).

⚡ Quick Answer

• What it means: a part in your completion list does not match a stored part: wrong or empty ETag, or a part number that never uploaded. Plain English.

• The fix: build the list from aws s3api list-parts (or list_parts in code) and complete again; the upload ID is still valid. CLI, Python, JavaScript.

• Browser uploads: null ETags mean your bucket's CORS rule lacks "ExposeHeaders": ["ETag"]. The browser cause.

• Neighbors: InvalidPartOrder = sort by part number; EntityTooSmall = a non-final part under 5 MB; NoSuchUpload = the upload ID is gone. All four.

Every cause · Checksums · Prevent it · Troubleshooting.

New to Amazon S3? A multipart upload sends a big file in pieces, then asks S3 to stitch them together. You need the bucket name, the object key and the upload ID from your failing upload; the AWS CLI or an SDK with permission to list and complete multipart uploads does the rest.

🧭 NEW HERE? READ THESE FIRST

New to S3 uploads, presigned URLs or boto3? These five pages give you the basics this guide builds on:

💡 Keep the upload ID from the failed request; with it, the fix below takes two commands.

What InvalidPart means: the receipts, not the parts

A multipart upload has three steps. CreateMultipartUpload gives you an upload ID. UploadPart sends each piece with a part number (1 to 10,000), and S3 answers each one with an ETag, a quoted string such as "79b281060d337b9b2b84ccf390adcf74" that identifies that part's data. CompleteMultipartUpload then sends S3 the list of part numbers and their ETags, and S3 joins the parts in part-number order into one object.

S3 checks that list against what it stored. If any entry names a part number S3 does not have, or gives an ETag that does not match the stored part, the whole completion fails with HTTP 400 and this exact message:

An error occurred (InvalidPart) when calling the CompleteMultipartUpload operation: One or more of the
specified parts could not be found. The part might not have been uploaded, or the specified entity tag
might not have matched the part's entity tag.

Two facts make this error less scary than it looks. Nothing is lost: a failed completion leaves the upload open and every uploaded part in place, so you can simply complete it again with a correct list. And nothing is half-written: until a completion succeeds, no object exists under that key (or the old one stays untouched).

The fix that works for every cause: complete from ListParts

S3 keeps its own record of every part it accepted for an open upload. Ask for it, and send exactly that back. In the AWS CLI:

💻 Where to run these commands

Easiest: AWS CloudShell, nothing to install. Sign in to the AWS Management Console, choose your Region at the top right, then click the CloudShell icon (a small >_ terminal symbol) in the top bar, or type CloudShell in the search box and open it. When the $ prompt appears, paste a command and press Enter. CloudShell already has the AWS CLI, uses your console permissions and costs nothing extra.

On your own computer: install AWS CLI version 2 (installers for Windows, macOS and Linux are on the AWS CLI page), run aws configure once (or aws configure sso if your company signs in through single sign-on), and check it works with aws sts get-caller-identity. Then paste commands into Terminal on Mac or Linux, or PowerShell or Command Prompt on Windows.

Windows tip: a line ending in a backslash ( \ ) continues on the next line in CloudShell, Mac and Linux. In PowerShell use a backtick ( ` ) instead, in Command Prompt a caret ( ^ ), or simply join the lines into one. JSON inside single quotes works as shown in CloudShell; on Windows, save the JSON in a file and pass it as file://name.json.

Python examples: save the code in a file such as script.py, install the AWS SDK with pip install boto3, and run python script.py (python3 on Mac and Linux). It uses the same credentials as the AWS CLI; CloudShell has Python and boto3 ready.

Replace example values such as my-bucket, my-function, 111122223333 (an account ID) and us-east-1 with your own.

B=my-bucket; K=uploads/video.mp4; U=your-upload-id

# 1. What S3 actually has (check the part numbers and sizes look right)
aws s3api list-parts --bucket "$B" --key "$K" --upload-id "$U" \
  --query 'Parts[].[PartNumber,Size,ETag]' --output table

# 2. Turn it into a completion list and complete
aws s3api list-parts --bucket "$B" --key "$K" --upload-id "$U" \
  --query '{Parts: Parts[].{PartNumber: PartNumber, ETag: ETag}}' > parts.json
aws s3api complete-multipart-upload --bucket "$B" --key "$K" --upload-id "$U" \
  --multipart-upload file://parts.json
What list-parts showsWhat it meansWhat to do
Every part number, sizes adding up to your fileAll data arrived; your list was wrongComplete from the listing (step 2)
A gap in the numbers (1, 2, 4, 5)That part never finishedUpload the missing number again, then complete
A part smaller than 5 MB that is not the lastThe completion will fail with EntityTooSmall nextRe-upload that part at full size
No parts at allNothing was stored under this upload IDCheck the bucket, key and ID; upload again
NoSuchUpload instead of a listThe upload is finished or abortedCheck whether the object already exists

Before step 2, read the table from step 1. If a part number is missing from the middle (1, 2, 4, 5), that part really never arrived: upload it again with aws s3api upload-part and the same part number, then rerun step 2. If the sizes add up to your file, completing from the listing gives you the right object. Don't know the upload ID? aws s3api list-multipart-uploads --bucket "$B" --prefix "$K" lists the open uploads for that key with their IDs and start times.

The same fix in Python with boto3, which also handles uploads of more than 1,000 parts (list_parts returns at most 1,000 per call, so it pages):

import boto3
s3 = boto3.client("s3")

def complete_from_s3(bucket, key, upload_id):
    parts = []
    for page in s3.get_paginator("list_parts").paginate(Bucket=bucket, Key=key, UploadId=upload_id):
        parts += [{"PartNumber": p["PartNumber"], "ETag": p["ETag"]} for p in page.get("Parts", [])]
    parts.sort(key=lambda p: p["PartNumber"])
    return s3.complete_multipart_upload(Bucket=bucket, Key=key, UploadId=upload_id,
                                        MultipartUpload={"Parts": parts})

And in JavaScript (AWS SDK v3), for a server that completes uploads started by a browser:

import { S3Client, ListPartsCommand, CompleteMultipartUploadCommand } from "@aws-sdk/client-s3";
const s3 = new S3Client({});

export async function completeFromS3(Bucket, Key, UploadId) {
  const Parts = [];
  let PartNumberMarker;
  do {
    const page = await s3.send(new ListPartsCommand({ Bucket, Key, UploadId, PartNumberMarker }));
    for (const p of page.Parts ?? []) Parts.push({ PartNumber: p.PartNumber, ETag: p.ETag });
    PartNumberMarker = page.IsTruncated ? page.NextPartNumberMarker : undefined;
  } while (PartNumberMarker);
  Parts.sort((a, b) => a.PartNumber - b.PartNumber);
  return s3.send(new CompleteMultipartUploadCommand({ Bucket, Key, UploadId, MultipartUpload: { Parts } }));
}

One caution: completing from the listing trusts that every stored part is the right data. If your code re-uploaded a part number with different content, the listing shows the latest upload of that number, which is what S3 would use anyway. If you suspect a wrong part, check its size in the listing against what you expected before completing.

Ethan ran the two CLI commands against one of the failed customer uploads that afternoon. The listing showed 14 parts, 10 MB each except a 3.2 MB last one, exactly the video's size, and the completion returned an ETag ending in -14. "There it is," he told Jake, "the whole cracked screen, in fourteen pieces and one file."

Browser uploads: why every ETag comes back null

This is the cause behind most InvalidPart reports from web apps. A page uploads parts with presigned URLs, reads each response's ETag header, and sends the list for completion. But browsers only let JavaScript read response headers that the server explicitly exposes, and S3 exposes only what your bucket's CORS rule lists in ExposeHeaders. Without it, every upload succeeds (HTTP 200), the header is simply invisible to your code, and the list goes out with null or empty ETags.

The fix is one line in the bucket's CORS configuration (S3 console, the bucket, Permissions, Cross-origin resource sharing):

[
  {
    "AllowedOrigins": ["https://shop.example.com"],
    "AllowedMethods": ["PUT"],
    "AllowedHeaders": ["*"],
    "ExposeHeaders": ["ETag"],
    "MaxAgeSeconds": 3000
  }
]

To confirm this is your cause:

  1. Open the page, then your browser's developer tools (F12), and choose the Network tab.
  2. Start an upload and click one of the part requests (a PUT with partNumber= in its URL).
  3. Under Response Headers, look for ETag. You can see it here even when your script cannot.
  4. Look for Access-Control-Expose-Headers. If it is missing or does not list ETag, the CORS rule is your cause; after the fix it reads Access-Control-Expose-Headers: ETag.

Once the rule is in place, your script reads the same value it was missing. Our S3 CORS guide covers rule order, which matters if you have several rules. A sturdier design avoids the question entirely: let the browser upload the parts, and let your server complete the upload from ListParts (the JavaScript function above), so the browser never has to report ETags at all. That is what Ethan did for Jake's uploader.

Parallel uploads: the part that never finished

Parallel uploaders send several parts at once. If one part's request fails or times out and the code does not notice (a rejected promise that was never awaited, an exception swallowed in a thread), the completion list still includes that part number, and S3 has nothing stored for it. The listing from list-parts shows the gap. Upload the missing part again, then complete. In code, make the completion step wait for every part to succeed, and fail loudly if any did not.

Four more causes: retried parts, home-made ETags, mangled strings and mixed uploads

A stale ETag from a retried part

Uploading the same part number twice is allowed; the later upload replaces the earlier one. If a retry sent slightly different bytes (a buffer reused for the next chunk, a file still being written), the new part has a new ETag, and code that recorded the first one sends a receipt S3 no longer recognizes. Completing from ListParts fixes it, and reading each part's bytes freshly for every attempt prevents it.

An ETag you calculated yourself

Some code skips reading the ETag header and computes an MD5 of each chunk instead, because S3's ETag often is the MD5. It is not always: an S3 ETag "may or may not be an MD5 digest of the object data." With SSE-KMS encryption (the default for many buckets set up by security teams), the ETag of each part is not the MD5 of its bytes, so self-computed receipts fail every time. Use the ETag S3 returns, or ListParts.

The ETag got mangled on the way

The ETag includes double quotes as part of the value S3 returns ("79b28106..."). Code that passes it through JSON or a database can end up sending extra escaping (\"79b28106...\"), stray whitespace, or a truncated value. Log the exact strings your completion sends next to the list-parts output; a character-by-character difference shows up immediately.

Parts from a different upload

Each upload ID has its own parts. If a resumed upload started a new CreateMultipartUpload but kept part ETags from the earlier session, or two uploads of the same key ran at once, the list mixes receipts from two uploads and S3 rejects the ones that are not in this upload. Keep the upload ID together with its parts in one record, and when resuming, read the parts with ListParts for that exact ID.

Python does not catch this error by name; there is no InvalidPart exception class in boto3. Catch botocore.exceptions.ClientError and read e.response["Error"]["Code"], which is the string "InvalidPart".

InvalidPart, InvalidPartOrder, EntityTooSmall and NoSuchUpload: the completion errors side by side

Error codeHTTPWhat S3 is telling youFix
InvalidPart400A listed part was not found or its ETag does not matchComplete from ListParts; re-upload any missing part
InvalidPartOrder400"The list of parts was not in ascending order"Sort by PartNumber before completing (parallel uploads finish out of order)
EntityTooSmall400A part other than the last is under the 5 MB minimumUse parts of at least 5 MB (only the last may be smaller)
NoSuchUpload404The upload ID is invalid, aborted or already completedCheck whether the object already exists; see our NoSuchUpload guide
BadDigest400The checksum type sent at completion differs from the one chosen at the startUse the same checksum algorithm and type throughout
MalformedXML400An empty parts list, or a broken request bodySend at least one part; see our MalformedXML guide

Part sizes and the 10,000-part limit together set the largest file a given chunk size can upload (10,000 parts of 5 MB is about 50 GB; larger files need bigger parts). Our EntityTooLarge guide has the chunk-size math.

Checksums: the newer way to get a completion rejected

Multipart uploads can carry extra integrity checksums (CRC32, CRC32C, CRC64NVME, SHA-1, SHA-256 and others). If you chose a checksum algorithm when you created the upload, each part was stored with its checksum, and the completion request must include each part's checksum value alongside its ETag. Leave them out and S3 rejects the completion even though every ETag is right. Changing the checksum type between the start and the end of the upload gives BadDigest.

Two practical points. Recent AWS SDKs calculate checksums on uploads by default, so code that used to work can start failing when a hand-written completion step drops fields the SDK now sends. And ListParts returns each part's checksum fields too, so the complete-from-ListParts approach carries them over: include the checksum keys from the listing in each part entry if your upload used them. The SDKs' own high-level upload helpers handle all of this for you.

Preventing InvalidPart: let a helper do the bookkeeping

Nearly every InvalidPart is hand-written multipart code losing track of its receipts. The simplest prevention is not to write that code:

  • Python: s3.upload_file() or upload_fileobj() split, upload in parallel, retry and complete for you. Our upload_file vs put_object guide explains when each applies.
  • AWS CLI: aws s3 cp and aws s3 sync use multipart automatically above 8 MB.
  • JavaScript: the Upload class in @aws-sdk/lib-storage does the same in Node.js and the browser.

If you do need your own uploader (resumable browser uploads are the usual reason), build it in this order:

  1. Keep the upload ID and its parts in one record, so a resumed session never mixes uploads.
  2. Fail the whole upload if any part failed, then retry that part with freshly read bytes.
  3. Complete from ListParts on the server rather than trusting the client's list.
  4. Sort parts by number before completing, if you ever build the list yourself.

Then add a lifecycle rule with AbortIncompleteMultipartUpload (for example, after 7 days), because parts of uploads that never complete are stored, and billed, until something aborts them.

S3 InvalidPart still failing? Troubleshooting by symptom

Every ETag in the completion list is null or empty

A browser upload whose bucket CORS rule does not expose the ETag header. Add "ExposeHeaders": ["ETag"] to the rule, or complete the upload on the server from ListParts.

InvalidPart only on large files

More parts, more chances for one to fail silently or be retried with different bytes. Check the listing for a missing part number, and make the uploader wait for every part's success before completing.

InvalidPart after resuming an interrupted upload

The resumed session is using receipts from another upload ID, or started a new upload. Read the parts with ListParts for the upload ID you are completing, and keep the ID with its parts.

InvalidPart on an SSE-KMS encrypted bucket

Your code computes MD5 hashes and sends them as ETags. With SSE-KMS the part ETag is not the MD5 of the data; use the ETag S3 returned, or ListParts.

"The list of parts was not in ascending order"

That is InvalidPartOrder: parallel uploads finished out of order and the list was sent as they finished. Sort by PartNumber first.

"Your proposed upload is smaller than the minimum allowed object size"

That is EntityTooSmall: a part other than the last is under 5 MB. Raise the chunk size to at least 5 MB; only the final part may be smaller.

"The specified upload does not exist"

NoSuchUpload: the upload was completed already (check whether the object exists), aborted by a lifecycle rule or your code, or the ID is wrong.

list-parts returns AccessDenied

Listing and completing need s3:ListMultipartUploadParts and s3:PutObject on the object, and kms:Decrypt for KMS-encrypted uploads using checksums. Add them to the role that completes uploads.

Completion succeeded but the file is corrupt

A part number was uploaded twice with different data and the wrong version won, or chunks were cut at the wrong offsets. Compare part sizes in the listing with your chunk plan, and enable checksums on future uploads.

Incomplete uploads keep costing money

Parts of uploads that never complete are stored and billed until aborted. Add a lifecycle rule with AbortIncompleteMultipartUpload, and list open uploads with aws s3api list-multipart-uploads.

S3 InvalidPart: frequently asked questions

What does InvalidPart mean in S3?

CompleteMultipartUpload found a part in your list that does not match a stored part: the part number was never uploaded, or its ETag does not match the uploaded part's ETag. The upload stays open, so you can complete it again with a correct list.

How do I fix "One or more of the specified parts could not be found"?

List the stored parts with aws s3api list-parts (or list_parts in code), build the completion list from that output, re-upload any part number that is missing, and call complete-multipart-upload again with the same upload ID.

Why are my ETags null in a browser multipart upload?

Browsers hide response headers that are not exposed by CORS. Add "ExposeHeaders": ["ETag"] to the bucket's CORS rule so JavaScript can read each part's ETag, or complete the upload on your server from ListParts.

Do I include the quotes in the ETag for CompleteMultipartUpload?

Send the ETag exactly as S3 returned it, quotes included. Values copied from list-parts are already in the right form; extra escaping such as \" around the value is a common cause of mismatches.

Is the S3 ETag the MD5 of the part?

Often, but not always. S3 says the ETag may or may not be an MD5 digest; with SSE-KMS encryption it is not. Never compute ETags yourself; use the value S3 returns.

What is the difference between InvalidPart and InvalidPartOrder?

InvalidPart means a listed part does not match a stored part. InvalidPartOrder means the parts are not listed in ascending part-number order. Sort the list by PartNumber to fix the second.

What is the minimum part size for S3 multipart upload?

5 MB for every part except the last, which can be any size. A smaller non-final part makes CompleteMultipartUpload fail with EntityTooSmall. Part numbers run from 1 to 10,000.

Can I retry CompleteMultipartUpload after InvalidPart?

Yes. A failed completion leaves the upload and all its parts in place. Fix the parts list and call it again with the same upload ID, as long as the upload has not been aborted.

How do I find the upload ID of a failed multipart upload?

Run aws s3api list-multipart-uploads --bucket BUCKET --prefix KEY. It lists every open upload for that key with its UploadId and the time it started.

How do I catch InvalidPart in boto3?

There is no InvalidPart exception class. Catch botocore.exceptions.ClientError and check e.response["Error"]["Code"] == "InvalidPart", then complete from list_parts.

Does a failed multipart upload cost money?

Yes. Uploaded parts are stored and billed until the upload is completed or aborted. A lifecycle rule with AbortIncompleteMultipartUpload cleans them up automatically after the days you choose.

Why does CompleteMultipartUpload fail when I use checksums?

If the upload was created with a checksum algorithm, each part's checksum must be included in the completion request, and the checksum type must not change. ListParts returns the checksums to copy across.

Does aws s3 cp ever give InvalidPart?

Rarely, because the CLI's high-level commands track parts themselves. InvalidPart almost always comes from custom multipart code, browser uploaders and third-party tools that complete uploads by hand.

Can I complete a multipart upload from the S3 console?

No. The console can upload large files (it uses multipart itself) but cannot complete an open upload started elsewhere. Use the CLI's list-parts and complete-multipart-upload commands.

How many parts can ListParts return?

Up to 1,000 per call. For larger uploads, page with PartNumberMarker or use the SDK paginator, as in the Python and JavaScript functions on this page.

What happens to my existing file if the completion fails?

Nothing. An object appears or changes only when a completion succeeds, so a failed completion leaves any existing object under that key untouched.

For readers preparing for an AWS certification

We have been covering AWS certifications alongside our fixes, so here is a short extra for readers studying for one. If you only came for the fix, you already have it; feel free to skip this part.

Exams that test this topic: Developer – Associate (DVA-C03 from December 1, 2026) • CloudOps Engineer – Associate (SOA-C03) • Solutions Architect – Associate (SAA-C03).

Here are the exam-style questions this topic tends to raise, with the reasoning you need to answer them:

1. CompleteMultipartUpload fails with InvalidPart. What does S3 report is wrong?

A listed part was not uploaded, or its ETag does not match the ETag S3 stored for that part number.

2. How can an application complete a multipart upload without trusting its own record of the parts?

Call ListParts for the upload ID and send the returned part numbers and ETags to CompleteMultipartUpload.

3. A browser uploads parts with presigned URLs, but the completion list contains null ETags. What fixes it?

Add ETag to ExposeHeaders in the bucket CORS configuration so JavaScript can read the response header.

4. What is the minimum part size for a multipart upload?

5 MB for every part except the last; a smaller non-final part makes the completion fail with EntityTooSmall.

5. Incomplete multipart uploads keep adding to the S3 bill. How do you clean them up automatically?

A lifecycle rule with the AbortIncompleteMultipartUpload action after a chosen number of days.

6. CompleteMultipartUpload returns InvalidPartOrder. What must change?

List the parts in ascending part-number order.

Exam codes and dates change often. Our AWS certification changes page keeps track of what is current.

πŸ“š ALSO READ

Where to go next, from the other upload errors to the CORS rules behind browser uploads:

📌 Bookmark this; the two list-parts commands are the part you will come back for.

Jake's uploader now has one job in the browser, sending the pieces, and the shop's small server finishes each upload by asking S3 what arrived. Customer videos have been landing ever since, the longest one 41 parts. "So the browser does not keep receipts any more?" Jake asked. "The browser loses things," Ethan said. "S3 does not."

📌 If you keep one line from this page

InvalidPart means your parts list does not match what S3 stored; complete from list-parts instead of your own records, expose the ETag header for browser uploads, sort by part number, and keep every part but the last at 5 MB or more.

list-parts → parts.json → complete-multipart-upload · the upload stays open after a failure · abort leftovers with a lifecycle rule.

Revision note. Written October 22, 2026. "Keep your receipts," every shopkeeper says; for multipart uploads, let S3 keep them for you.

Related