Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading from remote files with https:// addresses causes crash #22

Open
nbegley23 opened this issue Dec 8, 2014 · 0 comments
Open

Reading from remote files with https:// addresses causes crash #22

nbegley23 opened this issue Dec 8, 2014 · 0 comments

Comments

@nbegley23
Copy link

Full disclosure, I'm not even close to an expert with this, so I can only tell you what I'm experiencing and how I managed to fix it.

I noticed that after updating my carrierwave initialization file from using S3 to connect to my Amazon AWS server to use fog that my calls to Yomu were not longer working. I figured out after awhile that the problem was this line in particlar:

@data = Net::HTTP.get @uri

which was causing the following crash:

Errno::ECONNRESET: Connection reset by peer
    from /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/net/protocol.rb:141:in `read_nonblock'
    from /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/net/protocol.rb:141:in `rbuf_fill'
    from /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/net/protocol.rb:122:in `readuntil'
    from /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/net/protocol.rb:132:in `readline'
    from /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/net/http.rb:2563:in `read_status_line'
    from /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/net/http.rb:2552:in `read_new'
    from /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/net/http.rb:1320:in `block in transport_request'
    from /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/net/http.rb:1317:in `catch'
    from /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/net/http.rb:1317:in `transport_request'
    from /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/net/http.rb:1294:in `request'
    from /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/net/http.rb:1196:in `request_get'
    from /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/net/http.rb:455:in `block in get_response'
    from /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/net/http.rb:746:in `start'
    from /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/net/http.rb:454:in `get_response'
    from /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/net/http.rb:431:in `get'
    from (irb):41

Whenever I switched my connection to AWS from S3 to Fog, carrier wave started uploading the files that would eventually be read by Yomu to SSL server addresses. From what I've read online, requests out to Net::HTTP need to be specifically told that SSL is being used, hence the sudden crashes from Yomu.

Instead of explicitly setting up the connection, someone suggested the following change to that same line (yomu.rb line 177):

@data = @uri.read

Alternatively - what I did as a temporary solution until I see how this pans out is to set my carrierwave config to disable SSL:

config.fog_use_ssl_for_aws = false

Which seems to work for me. Just in case, this on Rails 4.1.6, ruby 1.9.3p547 and Yomu 0.2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant