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

Fix undefined method 'version_id' during multipart upload #146

Closed
wants to merge 1 commit into from
Closed

Fix undefined method 'version_id' during multipart upload #146

wants to merge 1 commit into from

Conversation

menno
Copy link

@menno menno commented Jan 30, 2013

I got the following error when a large file got automatically uploaded via multipart-upload to S3:

NoMethodError: undefined method `version_id' for #<Hash:0x00000006b94b40>
    from //shared/bundle/ruby/1.9.1/gems/aws-sdk-1.8.1.1/lib/aws/core/data.rb:101:in `method_missing'
    from //bundle/ruby/1.9.1/gems/aws-sdk-1.8.1.1/lib/aws/core/data.rb:121:in `method_missing'
    from //bundle/ruby/1.9.1/gems/aws-sdk-1.8.1.1/lib/aws/core/response.rb:193:in `method_missing'
    from //bundle/ruby/1.9.1/gems/aws-sdk-1.8.1.1/lib/aws/s3/multipart_upload.rb:245:in `complete'
    from //bundle/ruby/1.9.1/gems/aws-sdk-1.8.1.1/lib/aws/s3/multipart_upload.rb:267:in `close'
    from //bundle/ruby/1.9.1/gems/aws-sdk-1.8.1.1/lib/aws/s3/s3_object.rb:707:in `multipart_upload'
    from //bundle/ruby/1.9.1/gems/aws-sdk-1.8.1.1/lib/aws/s3/s3_object.rb:1619:in `write_with_multipart'
    from //bundle/ruby/1.9.1/gems/aws-sdk-1.8.1.1/lib/aws/s3/s3_object.rb:598:in `write'

Comparing how a single-part upload was handled I made a change in how the version_id is handled from the response. This patch solved the issue for me.

The related spec does not fail without the patch, this could be due the response being a stub. But I'm not sure of this. Also I could not find any specs for a multipart-upload to a versioned bucket.

@trevorrowe
Copy link
Member

Thanks for the PR. I'll take a look at the cause to this and check whats up with the test.

@trevorrowe
Copy link
Member

I merged this locally and pushed your commit (542f075). I was able to isolate the issue with the specs not failing (https://github.com/aws/aws-sdk-ruby/commit/793aa0d4f38e866db0d0bbe952bce791f46615ad#spec/aws/s3/multipart_upload_spec.rb#diff-1). Thanks for the fix!

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

Successfully merging this pull request may close these issues.

None yet

2 participants