Closed kris-at-tout closed 3 years ago
Hi @kris-at-tout, I'm getting the same error from a very similar snippet of code on the latest version of multipart-post
. Did you ever manage to resolve this issue? Is there a workaround or something?
I get this error after switching from HTTP to SSL.
Errno::EPIPE: Broken pipe
[4] pry(#<RSpec::ExampleGroups::PerformanceTest>)> e.class
=> Errno::EPIPE
[5] pry(#<RSpec::ExampleGroups::PerformanceTest>)> e.backtrace
=> ["/home/max/.rbenv/versions/2.4.0-dev/lib/ruby/2.4.0/net/http/generic_request.rb:206:in `write'",
"/home/max/.rbenv/versions/2.4.0-dev/lib/ruby/2.4.0/net/http/generic_request.rb:206:in `copy_stream'",
"/home/max/.rbenv/versions/2.4.0-dev/lib/ruby/2.4.0/net/http/generic_request.rb:206:in `send_request_with_body_stream'",
"/home/max/.rbenv/versions/2.4.0-dev/lib/ruby/2.4.0/net/http/generic_request.rb:123:in `exec'",
"/home/max/.rbenv/versions/2.4.0-dev/lib/ruby/gems/2.4.0/gems/aws-sdk-core-2.2.9/lib/seahorse/client/net_http/patches.rb:27:in `block in new_transport_request'",
"/home/max/.rbenv/versions/2.4.0-dev/lib/ruby/gems/2.4.0/gems/aws-sdk-core-2.2.9/lib/seahorse/client/net_http/patches.rb:26:in `catch'",
"/home/max/.rbenv/versions/2.4.0-dev/lib/ruby/gems/2.4.0/gems/aws-sdk-core-2.2.9/lib/seahorse/client/net_http/patches.rb:26:in `new_transport_request'",
"/home/max/.rbenv/versions/2.4.0-dev/lib/ruby/2.4.0/net/http.rb:1407:in `request'"
...................... ETCETERA
I figured out how to solve my issue, which I also commented at https://github.com/nicksieger/multipart-post/issues/18
For me this was a HTTPS issue.
I split up the Net::HTTP.start
method into two:
my_request = Net::HTTP.new
(which takes the same options as Net::HTTP.start
)my_request.use_ssl = true
option here (before starting the request)my_request.start { |http| ... etc }
Is this an issue with multipart-post
or a general issue wiht usage of NET::HTTP
? Can we close this?
gem version: 1.1.5
I have the following method (for reproducing)
require 'net/http/post/multipart'
When I run this in irb, I get the following exception:
Errno::EPIPE: Broken pipe from /Users/kris/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/net/protocol.rb:199:in
write' from /Users/kris/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/net/protocol.rb:199:in
write0' from /Users/kris/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/net/protocol.rb:173:inblock in write' from /Users/kris/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/net/protocol.rb:190:in
writing' from /Users/kris/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/net/protocol.rb:172:inwrite' from /Users/kris/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/net/http.rb:1955:in
send_request_with_body_stream' from /Users/kris/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/net/http.rb:1921:inexec' from /Users/kris/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/net/http.rb:1317:in
block in transport_request' from /Users/kris/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/net/http.rb:1316:incatch' from /Users/kris/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/net/http.rb:1316:in
transport_request' from /Users/kris/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/net/http.rb:1293:inrequest' from (irb):12:in
block (2 levels) in submit_file' from /Users/kris/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/net/http.rb:745:instart' from /Users/kris/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/net/http.rb:557:in
start' from (irb):11:inblock in submit_file' from (irb):7:in
open' from (irb):7:in `submit_file'With the correct token, I can upload the same file via a REST client.