geemus/excon — Issue #108: Excon::Errors::SocketError: SSL_write 
Author: MarcinRKL
Created: 2012-02-15 05:27:08+00:00
State: open

Hey,

So, all this worked with REE 1.8.7, but it fails with MRI 1.9.3 and excon 0.9.5

So I installed Ruby 1.9.3-p0 with RVM on both my MBP and Ubuntu 11.04 Ec2 and I'm getting a SSL error, I believe. Both systems get the same errors.

Not sure if this is a problem with 1.9.3 and Excon or maybe it's just something I did wrong.

In any case I'm using fog with s3 and I'm unable to set or change ACL.

This command with x-amz-acl will fail
024 > Storage.put_object("wrynku", "rails4.png", File.open(Rails.root.join('public', 'images', 'rails.png')), {'x-amz-acl' => 'public_read'})
Excon::Errors::BadRequest: Expected(200) <=> Actual(400 Bad Request)
request => {:connect_timeout=>60, :headers=>{"Content-Length"=>6646, "Content-Type"=>"image/png", "x-amz-acl"=>"public_read", "Date"=>"Wed, 15 Feb 2012 03:42:52 +0000", "Authorization"=>"AWS blabh:blabh=", "Host"=>"wrynku.s3.amazonaws.com:443"}, :host=>"wrynku.s3.amazonaws.com", :instrumentor_name=>"excon", :mock=>nil, :path=>"/rails4.png", :port=>"443", :query=>nil, :read_timeout=>60, :retry_limit=>4, :scheme=>"https", :write_timeout=>60, :body=>#, :expects=>200, :idempotent=>true, :method=>"PUT"}
response => #\nInvalidArgumentpublic_readx-amz-aclblahblabhblahblahblah", @headers={"x-amz-request-id"=>"blabblabblah", "x-amz-id-2"=>"blahblah", "Content-Type"=>"application/xml", "Transfer-Encoding"=>"chunked", "Date"=>"Wed, 15 Feb 2012 03:42:53 GMT", "Connection"=>"close", "Server"=>"AmazonS3"}, @status=400>
from /home/ubuntu/.rvm/gems/ruby-1.9.3-p0/gems/excon-0.9.5/lib/excon/connection.rb:232:in `request_kernel'
from /home/ubuntu/.rvm/gems/ruby-1.9.3-p0/gems/excon-0.9.5/lib/excon/connection.rb:89:in `request'
from /home/ubuntu/.rvm/gems/ruby-1.9.3-p0/gems/fog-1.1.2/lib/fog/core/connection.rb:20:in `request'
from /home/ubuntu/.rvm/gems/ruby-1.9.3-p0/gems/fog-1.1.2/lib/fog/aws/storage.rb:381:in `request'
from /home/ubuntu/.rvm/gems/ruby-1.9.3-p0/gems/fog-1.1.2/lib/fog/aws/requests/storage/put_object.rb:43:in `put_object'
from (irb):24
from /home/ubuntu/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.0.10/lib/rails/commands/console.rb:44:in `start'
from /home/ubuntu/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.0.10/lib/rails/commands/console.rb:8:in `start'
from /home/ubuntu/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.0.10/lib/rails/commands.rb:23:in `'
from script/rails:6:in `require'
from script/rails:6:in `

'

but without acl it's fine
Storage.put_object("wrynku", "rails4.png", File.open(Rails.root.join('public', 'images', 'rails.png')))

Also, this command fails too

1.9.3-p0 :027 > Storage.put_object_acl("wrynku", "rails4.png", "public-read")
Excon::Errors::SocketError: SSL_write:
from /home/ubuntu/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/openssl/buffering.rb:374:in `syswrite_nonblock'
from /home/ubuntu/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/openssl/buffering.rb:374:in `write_nonblock'
from /home/ubuntu/.rvm/gems/ruby-1.9.3-p0/gems/excon-0.9.5/lib/excon/socket.rb:113:in `write'
from /home/ubuntu/.rvm/gems/ruby-1.9.3-p0/gems/excon-0.9.5/lib/excon/connection.rb:206:in `request_kernel'
from /home/ubuntu/.rvm/gems/ruby-1.9.3-p0/gems/excon-0.9.5/lib/excon/connection.rb:89:in `request'
from /home/ubuntu/.rvm/gems/ruby-1.9.3-p0/gems/fog-1.1.2/lib/fog/core/connection.rb:20:in `request'
from /home/ubuntu/.rvm/gems/ruby-1.9.3-p0/gems/fog-1.1.2/lib/fog/aws/storage.rb:381:in `request'
from /home/ubuntu/.rvm/gems/ruby-1.9.3-p0/gems/fog-1.1.2/lib/fog/aws/requests/storage/put_object_acl.rb:63:in `put_object_acl'
from (irb):27
from /home/ubuntu/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.0.10/lib/rails/commands/console.rb:44:in `start'
from /home/ubuntu/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.0.10/lib/rails/commands/console.rb:8:in `start'
from /home/ubuntu/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.0.10/lib/rails/commands.rb:23:in `'
from script/rails:6:in `require'
from script/rails:6:in `

'

Ruby MRI 1.9.3-p0
Rails 3.0.10
Excon 0.9.5
Phusion Passenger version 3.0.11
nginx version: nginx/1.0.10
rvm 1.10.2