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

Error when providing checksum_algorithm to object.stream_upload #2769

Closed
normelton opened this issue Oct 24, 2022 · 3 comments · Fixed by #2773
Closed

Error when providing checksum_algorithm to object.stream_upload #2769

normelton opened this issue Oct 24, 2022 · 3 comments · Fixed by #2773
Assignees
Labels
bug This issue is a bug. investigating Issue is being investigated

Comments

@normelton
Copy link

Describe the bug

The AWS S3 documentation implies that I can specify a ChecksumAlgorithm when starting a streaming upload, and that the SDK will automagically calculate the checksum of uploaded data, and provide it to S3 at the completion of the upload:

https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#trailing-checksums

And in fact I see references to this in the gems/aws-sdk-s3/CHANGELOG.md file, but am having trouble getting it to work. I tried:

object.upload_stream({checksum_algorithm: "CRC32"}) do |s3_stream|

But I get back: Aws::S3::Errors::InvalidRequest 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.

Expected Behavior

Streaming uploads should support a trailing checksum as per AWS documentation.

Current Behavior

Aws::S3::Errors::InvalidRequest 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.

Reproduction Steps

object = bucket.object("my-bucket-name")
object.upload_stream(:checksum_algorithm => "CRC32") do |s3_stream|
s3_stream.upload "a bunch of data"
end

Possible Solution

No response

Additional Information/Context

No response

Gem name ('aws-sdk', 'aws-sdk-resources' or service gems like 'aws-sdk-s3') and its version

aws-sdk-s3

Environment details (Version of Ruby, OS environment)

ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux-gnu]

@normelton normelton added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 24, 2022
@alextwoods alextwoods added investigating Issue is being investigated and removed needs-triage This issue or PR still needs to be triaged. labels Oct 24, 2022
@alextwoods alextwoods self-assigned this Oct 24, 2022
@alextwoods
Copy link
Contributor

Thanks for opening this - I'm investigating now.

My initial guess is that we need to apply the same changes from #2668 to the MultipartStreamUploader

@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@normelton
Copy link
Author

Thanks @alextwoods, that seems to work!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. investigating Issue is being investigated
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants