Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crc32 checksum error when uploading a file #191

Open
marcorichetta opened this issue Feb 17, 2025 · 3 comments
Open

crc32 checksum error when uploading a file #191

marcorichetta opened this issue Feb 17, 2025 · 3 comments

Comments

@marcorichetta
Copy link

Hi! I was trying this library because I thought it was a very good abstraction for uploading files to S3 :mindblown:
I followed the setup steps and when I tried to upload a file I got this error.

<Error>
	<Code>InvalidRequest</Code>
	<Message>
		The upload was created using a crc32 checksum. The complete request must include the
		checksum for each part. It was missing for part 1 in the request.
	</Message>
	<RequestId>XXW9QFD18YFBP7P3</RequestId>
	<HostId>Z9OS15MhlDZu8GKp9tQI8PCRjuzSuMR33fyp6TlQE8drPbmLOyVxgF7uccB9W4Byad0Ge/RhMBI=</HostId>
</Error>

I did some research and found this announcement from AWS aws/aws-sdk-js-v3#6810 (comment) ⚠️ It could be the cause of errors with Cloudflare R2.


Inspecting the requests that are sent in my example, I see that both have the required headers.

x-amz-checksum-crc32: tycIGw==
x-amz-sdk-checksum-algorithm: CRC32

x-amz-checksum-crc32: PIUedw==
x-amz-sdk-checksum-algorithm: CRC32

The only one that do not includes them is the first request, the one that starts the MultiPartUpload

I'm putting it here in case someone else is in the same situation. 🙌

@iescude
Copy link

iescude commented Feb 22, 2025

Same error here. Do you know how to solve it?

@marcorichetta
Copy link
Author

@iescude Not really. I ended using presigned urls generated from the backend and uploading directly to S3 from the client with axios.

In the linked issue to the AWS sdk it seems they found a workaround but not for Nextjs

@calebporto
Copy link

I got the same error. Some files are working, but some other files not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants