- Newest
- Most votes
- Most comments
I was wrong, actually we need to keep those returned checksums for each part and send it back in the complete multipart command: As I have explained it here. You can find a working example written in NodeJS/NestJS here: https://dev.to/kasir-barati/nestjs-aws-s3-multipart-file-upload-grpc-e2e-testing-550e
answered 2 years ago
Based on your description and the code you've shared, it appears that you're encountering an issue with the checksum validation during a multipart upload to Amazon S3. Let's break down the problem and provide some insights:
-
Checksum for each part: It's normal for the
UploadPartCommandto return a checksum for each part. This is part of S3's data integrity mechanism for multipart uploads. Each part is individually checksummed to ensure its integrity during transmission. -
FULL_OBJECT checksum: You're correctly specifying the
FULL_OBJECTchecksum type in theCreateMultipartUploadCommand. This is used for the final validation of the entire object after all parts have been uploaded. -
Checksum mismatch error: The error you're seeing suggests that the calculated CRC32 checksum for the entire object doesn't match the one you're providing in the
CompleteMultipartUploadCommand.
Here are some potential issues and solutions:
-
Ensure that you're calculating the full object checksum correctly before starting the upload. This should be done on the entire file, not just the individual parts.
-
Make sure you're passing the correct checksum to the
CompleteMultipartUploadCommand. The checksum should be base64 encoded. -
Verify that all parts are being uploaded correctly and in the right order. Any missing or corrupted part could cause a checksum mismatch.
-
Double-check that you're using the same checksum algorithm (CRC32 in this case) consistently throughout the process.
-
If you're pre-computing the checksum, ensure it's done on the exact same data that's being uploaded. Any discrepancy in the data will result in a different checksum.
-
Consider using a different checksum algorithm like CRC32C or SHA256 to see if the issue persists.
-
Make sure you're using the latest version of the AWS SDK, as there have been improvements to checksum handling in recent versions.
If the simplified version works but the NestJS app doesn't, there might be some subtle differences in how the data is being handled or how the SDK is being configured in the NestJS environment. You may want to add more detailed logging in your NestJS app to compare the exact values being used at each step with those in your simplified version.
Remember, when using FULL_OBJECT checksum type, you need to provide the checksum for the entire object in the CompleteMultipartUploadCommand, not the individual part checksums. If you're unsure about the checksum calculation, you could try removing the checksum parameter from the CompleteMultipartUploadCommand as a test to see if the upload completes successfully without it.
Sources
UploadPart - Amazon Simple Storage Service
Introducing default data integrity protections for new objects in Amazon S3 | AWS News Blog
UploadPartResponse (AWS SDK for Java - 2.21.29)
answered 2 years ago
But the main point is that the
UploadPartCommnadshould not return a checksum when you say you needFULL_OBJECTchecksum check. You AI needs a lot of work, it lacks what we call it common sense.
Relevant content
asked 2 years ago
asked 4 years ago
- AWS OFFICIALUpdated 4 months ago

So here is what should happen:
CreateMultipartUploadCommand).COMPOSITEorFULL_OBJECTchecksum check.FULL_OBJECTwe can only use CRC base algorithms).UploadPartCommand).FULL_OBJECTchecksum check.CompleteMultipartUploadCommand).And this is what is happening right now:
AWS S3 is generating a checksum for each part (
COMPOSITE) and it is ignoring my setup I've sent it inCreateMultipartUploadCommand.Ref.