{"action":"created","issue":{"url":"https://api.github.com/repos/boto/boto/issues/2204","repository_url":"https://api.github.com/repos/boto/boto","labels_url":"https://api.github.com/repos/boto/boto/issues/2204/labels{/name}","comments_url":"https://api.github.com/repos/boto/boto/issues/2204/comments","events_url":"https://api.github.com/repos/boto/boto/issues/2204/events","html_url":"https://github.com/boto/boto/issues/2204","id":30865370,"number":2204,"title":"httplib.IncompleteRead on call to get_contents_to_filename()","user":{"login":"jlefman","id":2496602,"avatar_url":"https://avatars1.githubusercontent.com/u/2496602?v=3","gravatar_id":"","url":"https://api.github.com/users/jlefman","html_url":"https://github.com/jlefman","followers_url":"https://api.github.com/users/jlefman/followers","following_url":"https://api.github.com/users/jlefman/following{/other_user}","gists_url":"https://api.github.com/users/jlefman/gists{/gist_id}","starred_url":"https://api.github.com/users/jlefman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlefman/subscriptions","organizations_url":"https://api.github.com/users/jlefman/orgs","repos_url":"https://api.github.com/users/jlefman/repos","events_url":"https://api.github.com/users/jlefman/events{/privacy}","received_events_url":"https://api.github.com/users/jlefman/received_events","type":"User","site_admin":false},"labels":[{"id":47962772,"url":"https://api.github.com/repos/boto/boto/labels/accepted","name":"accepted","color":"d4c5f9","default":false},{"id":129336,"url":"https://api.github.com/repos/boto/boto/labels/bug","name":"bug","color":"e10c02","default":true},{"id":129329,"url":"https://api.github.com/repos/boto/boto/labels/s3","name":"s3","color":"0052cc","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2014-04-04T14:34:22Z","updated_at":"2017-03-08T07:37:39Z","closed_at":null,"body":"Hi. This issue may not be directly tied to boto, but httplib. I have not been able to find a good solution to this issue. Here's what is happening:\n### My code snippet\n\n```\n# using boto==2.24.0, but have same issue with 2.27.0\ns3 = boto.connect_s3(aws_access_key_id, aws_secret_access_key)\nbucket = s3.get_bucket(bucket_name)\nkey = bucket.get_key(key_name)\nkey.get_contents_to_filename(filename)\n```\n\nI am running this same call from numerous machines in parallel. \n### Error from httplib via boto\n\n```\n File \"/srv/venv/local/lib/python2.7/site-packages/boto/s3/key.py\", line 1665, in get_contents_to_filename\n    response_headers=response_headers)\n  File \"/srv/venv/local/lib/python2.7/site-packages/boto/s3/key.py\", line 1603, in get_contents_to_file\n    response_headers=response_headers)\n  File \"/srv/venv/local/lib/python2.7/site-packages/boto/s3/key.py\", line 1435, in get_file\n    query_args=None)\n  File \"/srv/venv/local/lib/python2.7/site-packages/boto/s3/key.py\", line 1488, in _get_file_internal\n    for bytes in self:\n  File \"/srv/venv/local/lib/python2.7/site-packages/boto/s3/key.py\", line 370, in next\n    self.close()\n  File \"/srv/venv/local/lib/python2.7/site-packages/boto/s3/key.py\", line 352, in close\n    self.resp.read()\n  File \"/srv/venv/local/lib/python2.7/site-packages/boto/connection.py\", line 412, in read\n    self._cached_response = httplib.HTTPResponse.read(self)\n  File \"/usr/lib/python2.7/httplib.py\", line 548, in read\n    s = self._safe_read(self.length)\n  File \"/usr/lib/python2.7/httplib.py\", line 649, in _safe_read\n    raise IncompleteRead(''.join(s), amt)\nIncompleteRead: IncompleteRead(0 bytes read, 487705020 more expected)\n```\n\nI have set up a try/except loop with up to 10 minute delays to continue trying the read, but I continue getting this error about 1.5% of the time. I would like to find a way to get around this so I don't need to have my calling application worry about retrying the task later or issuing an error. I have previously asked about this on the [google group](https://groups.google.com/forum/?fromgroups#!topic/boto-users/YiPAOvxIrUY).\n\nThanks. \n"},"comment":{"url":"https://api.github.com/repos/boto/boto/issues/comments/284969170","html_url":"https://github.com/boto/boto/issues/2204#issuecomment-284969170","issue_url":"https://api.github.com/repos/boto/boto/issues/2204","id":284969170,"user":{"login":"joshma","id":64739,"avatar_url":"https://avatars0.githubusercontent.com/u/64739?v=3","gravatar_id":"","url":"https://api.github.com/users/joshma","html_url":"https://github.com/joshma","followers_url":"https://api.github.com/users/joshma/followers","following_url":"https://api.github.com/users/joshma/following{/other_user}","gists_url":"https://api.github.com/users/joshma/gists{/gist_id}","starred_url":"https://api.github.com/users/joshma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshma/subscriptions","organizations_url":"https://api.github.com/users/joshma/orgs","repos_url":"https://api.github.com/users/joshma/repos","events_url":"https://api.github.com/users/joshma/events{/privacy}","received_events_url":"https://api.github.com/users/joshma/received_events","type":"User","site_admin":false},"created_at":"2017-03-08T07:37:39Z","updated_at":"2017-03-08T07:37:39Z","body":"Years later, we're also hitting this. Currently on `boto==2.41.0`"}}
{"actor":{"display_login":"joshma"}}