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
uploading file to s3 results in error 104 (connection reset) #2207
Comments
Just wanted to say "me too". I use boto through duplicity to access S3. On another machine, I have boto 2.2.2 and it works there. After downgrading boto from 2.27 to 2.2.2, the error persists, so I suspect the problem to lie either in ssl.py or the OS (Ubuntu Linux 14.04) |
Found a solution (at least for duplicity): instead of "s3+http://bucketname" use "s3:///s3.amazonaws.com/bucketname" |
From the CLI issue:
This will require adding some support for currently unsupported HTTP headers. |
I think the fix for awscli addresses this as it was merged in botocore. @jamesls - is that correct? |
The fix for Botocore was in boto/botocore@9e59c4e and seems to have solved the issue. We need to backport it to Boto. I'll see about trying to get it into the next release. |
I'm seeing a lot of these errors, please backport the fix asap. |
@danielgtaylor any update on getting it ported back into boto? |
+1 |
This issue hit us too. The workaround that worked for us was explicitly connecting to the bucket's region. Because we can't guarantee which region buckets are in we use this code:
|
+1 |
4 similar comments
+1 |
+1 |
👍 |
+1 |
This doesn't quite work as regions and locations have different names, however the concept does help (connecting to the correct region) |
+1 |
2 similar comments
+1 |
+1 |
Come on ppl, commenting +1 isn't helping anyone. |
@antonagestam, my intent was to help provide a sense of the number of people affected by this bug, which should hopefully lend it some priority. If there's something more I can do to help, please let me know. This is a sponsored project now, and this issue has been around for at least 9 months already, affecting quite a few users. I'm just trying not to let it languish. |
+1 |
1 similar comment
+1 |
I am hitting this bug. Just as someone referenced above, I am also on Ubuntu Linux 14.04. |
Hello guys! The solution for me was first, to change S3 Location from Frankfurt to London. Then additionally i've added |
@ilmesi solution from 2 years ago still working on latest boto version... so next time I found this issue on Google I know what to do. |
This fixes an issue with the S3 hook when uploading local files to a S3 bucket that does not reside in the standard US location (e.g. eu-west-1). According to boto/boto#2207 this is an issue in the boto library and does not seem to get fixed anytime soon. A work around is proposed in the boto issue and is implemented here.
This fixes an issue with the S3 hook when uploading local files to a S3 bucket that does not reside in the standard US location (e.g. eu-west-1). According to boto/boto#2207 this is an issue in the boto library and does not seem to get fixed anytime soon. A work around is proposed in the boto issue and is implemented here. test
:) 2017 and this still needed to be used as a workaround. |
@jcampbell05 I see the same error error: [Errno 104] Connection reset by peer i'm trying to upload files from my local machine to s3 using boto. did you use upload_file from boto3. What workaround did you use.? |
Rolling back my entire server to an older OS and version of boto. Not really a long term viable solution. |
If you want to transfer files > 5gb you need to use multipart uploading (unfortunately boto2 doesn't abstract this away from us). I've done an implementation for this using the example from: http://boto.cloudhackers.com/en/latest/s3_tut.html#storing-large-data in the bakthat project (a project similar to duplicity) see my pull request tsileo/bakthat#84 |
@jcampbell05 @shanx : Thank you for your responses. I migrated from boto2.x to boto3(which has in-built support for mutlipart file upload with upload_file feature. ). I followed this. |
We might be running into boto/boto#2207 when building releases, so let's see if this solves the problem.
So is this resolved ? I still cannot push a 1.9GB file to s3 from an ec2 . Gets a |
@tambakoo short answer is this isn't supported in boto2 upgrade to boto3 to get a method which supports large files :) |
On ubuntu 18 https://linuxhint.com/install_aws_cli_ubuntu/ |
@tambakoo How did you resolve it? |
@StanSilas |
Amazing to find out the solution (setting the region name) in a 9-year old thread! |
this is on boto 2.27.0. uploading a 14 byte file works, but 512k file causes this error.
using aws cli to upload works on the 512k file
File "/usr/local/lib/python2.7/dist-packages/boto-2.27.0-py2.7.egg/boto/s3/key.py", line 1315, in set_contents_from_filename
encrypt_key=encrypt_key)
File "/usr/local/lib/python2.7/dist-packages/boto-2.27.0-py2.7.egg/boto/s3/key.py", line 1246, in set_contents_from_file
chunked_transfer=chunked_transfer, size=size)
File "/usr/local/lib/python2.7/dist-packages/boto-2.27.0-py2.7.egg/boto/s3/key.py", line 725, in send_file
chunked_transfer=chunked_transfer, size=size)
File "/usr/local/lib/python2.7/dist-packages/boto-2.27.0-py2.7.egg/boto/s3/key.py", line 914, in _send_file_internal
query_args=query_args
File "/usr/local/lib/python2.7/dist-packages/boto-2.27.0-py2.7.egg/boto/s3/connection.py", line 633, in make_request
retry_handler=retry_handler
File "/usr/local/lib/python2.7/dist-packages/boto-2.27.0-py2.7.egg/boto/connection.py", line 1046, in make_request
retry_handler=retry_handler)
File "/usr/local/lib/python2.7/dist-packages/boto-2.27.0-py2.7.egg/boto/connection.py", line 919, in _mexe
request.body, request.headers)
File "/usr/local/lib/python2.7/dist-packages/boto-2.27.0-py2.7.egg/boto/s3/key.py", line 815, in sender
http_conn.send(chunk)
File "/usr/lib/python2.7/httplib.py", line 794, in send
self.sock.sendall(data)
File "/usr/lib/python2.7/ssl.py", line 229, in sendall
v = self.send(data[count:])
File "/usr/lib/python2.7/ssl.py", line 198, in send
v = self._sslobj.write(data)
error: [Errno 104] Connection reset by peer
The text was updated successfully, but these errors were encountered: