Errno::EPIPE: Broken pipe
Closed this issue · 2 comments
irb(main):001:0> require 'aws/s3'
=> true
irb(main):004:0> AWS::S3::Base.establish_connection!(:access_key_id => 'my_access_key',
irb(main):005:1* :secret_access_key => 'my_secret_key')
=> #<AWS::S3::Connection:0x002b194d33d9e8 @options={:server=>"s3.amazonaws.com", :port=>80, :access_key_id=>"my_access_key", :secret_access_key=>"my_secret_key"}, @access_key_id="my_access_key", @secret_access_key="my_secret_key", @http=#<Net::HTTP s3.amazonaws.com:80 open=false>>
irb(main):006:0> file_path = "/home/www/odds_comparison_service/www/releases/20131210023317/tmp/woo_2013-12-10_14-15-20_pgdump.sql.gz"
=> "/home/www/odds_comparison_service/www/releases/20131210023317/tmp/woo_2013-12-10_14-15-20_pgdump.sql.gz"
irb(main):007:0> AWS::S3::S3Object.store(file_name,File.open("#{file_path}"),bucket)
Errno::EPIPE: Broken pipe
from /home/www/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/net/protocol.rb:211:in write' from /home/www/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/net/protocol.rb:211:in
write0'
from /home/www/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/net/protocol.rb:185:in block in write' from /home/www/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/net/protocol.rb:202:in
writing'
from /home/www/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/net/protocol.rb:184:in write' from /home/www/odds_comparison_service/www/shared/bundle/ruby/2.0.0/gems/aws-s3-0.6.3/lib/aws/s3/extensions.rb:330:in
send_request_with_body_stream'
from /home/www/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/net/http/generic_request.rb:132:in exec' from /home/www/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/net/http.rb:1403:in
block in transport_request'
from /home/www/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/net/http.rb:1402:in catch' from /home/www/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/net/http.rb:1402:in
transport_request'
from /home/www/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/net/http.rb:1375:in request' from /home/www/odds_comparison_service/www/shared/bundle/ruby/2.0.0/gems/aws-s3-0.6.3/lib/aws/s3/connection.rb:45:in
block in request'
from /home/www/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/net/http.rb:851:in start' from /home/www/odds_comparison_service/www/shared/bundle/ruby/2.0.0/gems/aws-s3-0.6.3/lib/aws/s3/connection.rb:52:in
request'
from /home/www/odds_comparison_service/www/shared/bundle/ruby/2.0.0/gems/aws-s3-0.6.3/lib/aws/s3/base.rb:69:in request' from /home/www/odds_comparison_service/www/shared/bundle/ruby/2.0.0/gems/aws-s3-0.6.3/lib/aws/s3/base.rb:88:in
put'
from /home/www/odds_comparison_service/www/shared/bundle/ruby/2.0.0/gems/aws-s3-0.6.3/lib/aws/s3/object.rb:241:in store' from (irb):7 from /home/www/.rbenv/versions/2.0.0-p0/bin/irb:12:in
After switching to the current region, the issue is resolved.
AWS::S3::DEFAULT_HOST.replace "s3-ap-southeast-2.amazonaws.com"
I got a 'broken pipe' because I did not specify the correct bucket. I hope this will help someone who runs into it.