{"action":"created","issue":{"url":"https://api.github.com/repos/fog/fog/issues/1883","labels_url":"https://api.github.com/repos/fog/fog/issues/1883/labels{/name}","comments_url":"https://api.github.com/repos/fog/fog/issues/1883/comments","events_url":"https://api.github.com/repos/fog/fog/issues/1883/events","html_url":"https://github.com/fog/fog/issues/1883","id":15490973,"number":1883,"title":"Excon::Errors::BadRequest when uploading big file to AWS","user":{"login":"perlun","id":630613,"avatar_url":"https://avatars.githubusercontent.com/u/630613?v=3","gravatar_id":"","url":"https://api.github.com/users/perlun","html_url":"https://github.com/perlun","followers_url":"https://api.github.com/users/perlun/followers","following_url":"https://api.github.com/users/perlun/following{/other_user}","gists_url":"https://api.github.com/users/perlun/gists{/gist_id}","starred_url":"https://api.github.com/users/perlun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/perlun/subscriptions","organizations_url":"https://api.github.com/users/perlun/orgs","repos_url":"https://api.github.com/users/perlun/repos","events_url":"https://api.github.com/users/perlun/events{/privacy}","received_events_url":"https://api.github.com/users/perlun/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2013-06-13T06:54:51Z","updated_at":"2015-01-05T21:28:05Z","closed_at":"2014-11-14T15:48:51Z","body":"Hi,\r\n\r\nTrying to upload a big file (> 1 MiB) to AWS, which seems rather hard. I did look at #1731 and got some inspiration from there, however the suggested fix (to explicitly specify region was not enough for me).\r\n\r\nSmall files work great, no worries. It's only with bigger (= chunked) files that we run into problems.\r\n\r\nWithout specifying multipart_chunk_size, I get a boring \"Connection reset by peer\" in excon/connection.rb. When specifying a multipart_chunk_size which is low enough (in this case, 128 KiB seems to be the \"magic number\" - 256 KiB throws exceptions, 128 KiB works better), the upload progresses fine *until* it should be \"ready\" and mark the multipart as complete. Then it fails like this:\r\n\r\n```\r\nExcon::Errors::BadRequest: Expected(200) <=> Actual(400 Bad Request)\r\n              response_call at /Users/plundberg/.rvm/gems/jruby-1.7.2/gems/excon-0.24.0/lib/excon/middlewares/expects.rb:6\r\n                   response at /Users/plundberg/.rvm/gems/jruby-1.7.2/gems/excon-0.24.0/lib/excon/connection.rb:353\r\n                    request at /Users/plundberg/.rvm/gems/jruby-1.7.2/gems/excon-0.24.0/lib/excon/connection.rb:247\r\n                    request at /Users/plundberg/.rvm/gems/jruby-1.7.2/gems/fog-1.11.1/lib/fog/core/connection.rb:21\r\n                    request at /Users/plundberg/.rvm/gems/jruby-1.7.2/gems/fog-1.11.1/lib/fog/aws/storage.rb:506\r\n  complete_multipart_upload at /Users/plundberg/.rvm/gems/jruby-1.7.2/gems/fog-1.11.1/lib/fog/aws/requests/storage/complete_multipart_upload.rb:33\r\n             multipart_save at /Users/plundberg/.rvm/gems/jruby-1.7.2/gems/fog-1.11.1/lib/fog/aws/models/storage/file.rb:278\r\n                       save at /Users/plundberg/.rvm/gems/jruby-1.7.2/gems/fog-1.11.1/lib/fog/aws/models/storage/file.rb:208\r\n                     create at /Users/plundberg/.rvm/gems/jruby-1.7.2/gems/fog-1.11.1/lib/fog/core/collection.rb:52\r\n                     (root) at spam.rb:19\r\n```\r\n\r\nI added some debugging code in expects.rb and got this (removed potentially sensitive info):\r\n\r\n``` xml\r\n<Error>\r\n<Code>EntityTooSmall</Code>\r\n<Message>Your proposed upload is smaller than the minimum allowed size</Message>\r\n<ETag>...</ETag>\r\n<MinSizeAllowed>5242880</MinSizeAllowed>\r\n<ProposedSize>131072</ProposedSize>\r\n<RequestId>...</RequestId><HostId>...</HostId>\r\n<PartNumber>1</PartNumber>\r\n</Error>\r\n```\r\n\r\nSo... does this mean that I cannot chunk the data in smaller chunk than 5 megs? :) Awkward, since that was my only way to get the file up at all...\r\n\r\nAny ideas? I'm 100% sure that the region is correct (eu-west-1), I verified that with 3Hub."},"comment":{"url":"https://api.github.com/repos/fog/fog/issues/comments/68784793","html_url":"https://github.com/fog/fog/issues/1883#issuecomment-68784793","issue_url":"https://api.github.com/repos/fog/fog/issues/1883","id":68784793,"user":{"login":"geemus","id":4138,"avatar_url":"https://avatars.githubusercontent.com/u/4138?v=3","gravatar_id":"","url":"https://api.github.com/users/geemus","html_url":"https://github.com/geemus","followers_url":"https://api.github.com/users/geemus/followers","following_url":"https://api.github.com/users/geemus/following{/other_user}","gists_url":"https://api.github.com/users/geemus/gists{/gist_id}","starred_url":"https://api.github.com/users/geemus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geemus/subscriptions","organizations_url":"https://api.github.com/users/geemus/orgs","repos_url":"https://api.github.com/users/geemus/repos","events_url":"https://api.github.com/users/geemus/events{/privacy}","received_events_url":"https://api.github.com/users/geemus/received_events","type":"User","site_admin":false},"created_at":"2015-01-05T21:28:05Z","updated_at":"2015-01-05T21:28:05Z","body":"fair enough"}}