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
aws-sdk+jruby: uploading 5mb+ files to minio (server/gateway) doesn't work #7120
Comments
@shamil Also, can you try any other tool like |
hi @kannappanr, Tried
|
@shamil I quickly did a search and found this link, can you try the suggestion provided in this link https://stackoverflow.com/questions/17673174/aws-s3-gem-is-not-compatible-with-jruby |
@kannappanr yes, tried that already, same problem. Btw, problem doesn't persist if I upload to S3 directly (not via |
@shamil Thanks for the info. We will try to reproduce this issue. Can you please provide the version of |
@kannappanr any version, in prod we run |
@kannappanr one important thing. That sometimes its just work. So there is no 100% that it reproduce-able. I was able to reproduce that very often in our K8S cluster. So that might be related. In any-case, do not invest your time on it too much, Ill try to narrow down the problem and maybe find the root, be it in Thanks for your time |
@kannappanr @shamil I can see that go's standard http package behaves weirdly in our scenario with ruby sdk, The problem persists when the object's size is more than 7mb, The copy routine ( from the reader to the object temp file ) does not read more than 7mb ( 7 * 1024 * 1024 ) here in https://github.com/minio/minio/blob/8c1b649b2d70fd1ccbeaa14ada165d74d5d11da1/cmd/fs-v1-helpers.go#L346t (8mb objects are not chunked/uploaded in parts by aws s3 ruby sdk). Looks like the
This will wait indefinitely if N is more than 7 * 1024 * 1024. In Python, this seems to work well,
The ruby script
Let me see if there is a fix/work-around for this in golang. |
100-Continue was buggy in boto upstream for which we submitted an upstream fix boto/botocore#1328 |
@harshavardhana not sure the problem relates to this case. We are talking about |
@shamil the point is both are written by AWS devs and in the past we have seen common issues across SDKs. We have discovered and fixed multiple issues upstream ranging from HTTP RFC compliance issues to incorrect signature SPEC implementation. Go may not be a culprit here AFAICS, perhaps HTTP rfc implementation requirements misinterpreted by the client and here that is aws-sdk-ruby. |
i got the same when tested in go1.10+ versions. I will raise an issue in the upstream library for this. As @harshavardhana mentioned. i'd better open the issue in both the upstreams. |
Yet another work-around i could think of is uploading in parts with each part < 7mb. As per https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/S3/MultipartUploadPart.html#multipart_upload-instance_method I can see
which can upload in chunks. with chunk size < 6~7mb. @shamil Shall we try this by manually chunking the object in parts of < 7mb each? |
I am able to run it successfully
Ruby version is
|
Tested with minio server as well
|
I am also running the ruby script in a |
@Praveenrajmani , @harshavardhana to put you guys in context.
@Praveenrajmani your suggestion about multi-part upload works flawlessly! This is how my test code looks like now: #!/usr/bin/env ruby
require 'aws-sdk-s3'
Aws.config.update(
endpoint: 'http://localhost:9000',
access_key_id: admin,
secret_access_key: password,
region: 'us-east-1',
force_path_style: true,
http_wire_trace: true
)
s3 = Aws::S3::Resource.new
obj = s3.bucket('mytestbucket').object('testobject_big')
obj.upload_file('/tmp/test.bin', multipart_threshold: 4626070) For now I will probably patch the Thanks guys for your help |
@shamil Closing this issue here. Please feel free to reach out to us if you have any other question. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Expected Behavior
Uploading files over 5MB should work.
Current Behavior
minio
, also works!Steps to Reproduce (for bugs)
jruby
(I used one from docker imagesjruby:9.2
andjruby:9.1
)Your Environment
minio server /mnt/minio
,minio gateway nas /mnt/minio
andminio gateway s3
. Same problem!uname -a
):4.4.0-1057-aws
Logs files:
aws-sdk
HTTP trace logs)The text was updated successfully, but these errors were encountered: