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

Request starts timing out after a while #62

Open
satyapatidar opened this issue Jan 29, 2018 · 3 comments
Open

Request starts timing out after a while #62

satyapatidar opened this issue Jan 29, 2018 · 3 comments

Comments

@satyapatidar
Copy link

Dear Repo Maintainer - @waterlink ,

Thanks for developing this gem, it helped us lot!

I have been using this gem for a while on my site - https://www.activityhero.com to server blog under https://www.activityhero.com/blog it worked great for couple of days but now request to any url for blog just times out :(

Please help me solve this issue (Gem.lock).

I am using this version of gem:

rack-reverse-proxy (0.12.0)
   rack (>= 1.0.0)
   rack-proxy (~> 0.6, >= 0.6.1)

Here is my config (application.rb)

config.middleware.insert(0, Rack::Deflater)
config.middleware.use Rack::Attack
  config.middleware.insert(0, Rack::ReverseProxy) do
    reverse_proxy_options preserve_host: true
    reverse_proxy %r{^\/blog(\/?.*)$}, 'https://activityheroblog.com$1'
 end

Logs I seeing on my heroku server are as follows:

29 Jan 2018 21:32:18.846188 <190>1 2018-01-29T16:02:18.546116+00:00 app web.1 - - E, [2018-01-29T16:02:18.546003 #26] ERROR -- : app error: execution expired (Net::OpenTimeout)
29 Jan 2018 21:32:18.847210 <190>1 2018-01-29T16:02:18.546143+00:00 app web.1 - - E, [2018-01-29T16:02:18.546087 #26] ERROR -- : /app/vendor/ruby-2.3.4/lib/ruby/2.3.0/net/http.rb:880:in `initialize'
29 Jan 2018 21:32:18.847204 <190>1 2018-01-29T16:02:18.546146+00:00 app web.1 - - E, [2018-01-29T16:02:18.546110 #26] ERROR -- : /app/vendor/ruby-2.3.4/lib/ruby/2.3.0/net/http.rb:880:in `open'
29 Jan 2018 21:32:18.847216 <190>1 2018-01-29T16:02:18.546150+00:00 app web.1 - - E, [2018-01-29T16:02:18.546129 #26] ERROR -- : /app/vendor/ruby-2.3.4/lib/ruby/2.3.0/net/http.rb:880:in `block in connect'
29 Jan 2018 21:32:18.847206 <190>1 2018-01-29T16:02:18.546178+00:00 app web.1 - - E, [2018-01-29T16:02:18.546146 #26] ERROR -- : /app/vendor/ruby-2.3.4/lib/ruby/2.3.0/timeout.rb:101:in `timeout'
29 Jan 2018 21:32:18.847207 <190>1 2018-01-29T16:02:18.546193+00:00 app web.1 - - E, [2018-01-29T16:02:18.546170 #26] ERROR -- : /app/vendor/ruby-2.3.4/lib/ruby/2.3.0/net/http.rb:878:in `connect'
29 Jan 2018 21:32:18.847208 <190>1 2018-01-29T16:02:18.546220+00:00 app web.1 - - E, [2018-01-29T16:02:18.546191 #26] ERROR -- : /app/vendor/ruby-2.3.4/lib/ruby/2.3.0/net/http.rb:863:in `do_start'
29 Jan 2018 21:32:18.847205 <190>1 2018-01-29T16:02:18.546244+00:00 app web.1 - - E, [2018-01-29T16:02:18.546213 #26] ERROR -- : /app/vendor/ruby-2.3.4/lib/ruby/2.3.0/net/http.rb:858:in `start'
29 Jan 2018 21:32:18.847244 <190>1 2018-01-29T16:02:18.546268+00:00 app web.1 - - E, [2018-01-29T16:02:18.546237 #26] ERROR -- : /app/vendor/bundle/ruby/2.3.0/gems/rack-proxy-0.6.3/lib/rack/http_streaming_response.rb:71:in `session'
29 Jan 2018 21:32:18.847245 <190>1 2018-01-29T16:02:18.546293+00:00 app web.1 - - E, [2018-01-29T16:02:18.546261 #26] ERROR -- : /app/vendor/bundle/ruby/2.3.0/gems/rack-proxy-0.6.3/lib/rack/http_streaming_response.rb:60:in `response'
29 Jan 2018 21:32:18.847244 <190>1 2018-01-29T16:02:18.546318+00:00 app web.1 - - E, [2018-01-29T16:02:18.546286 #26] ERROR -- : /app/vendor/bundle/ruby/2.3.0/gems/rack-proxy-0.6.3/lib/rack/http_streaming_response.rb:29:in `headers'
29 Jan 2018 21:32:18.847268 <190>1 2018-01-29T16:02:18.546343+00:00 app web.1 - - E, [2018-01-29T16:02:18.546311 #26] ERROR -- : /app/vendor/bundle/ruby/2.3.0/gems/rack-reverse-proxy-0.12.0/lib/rack_reverse_proxy/roundtrip.rb:166:in `rack_response_headers'
29 Jan 2018 21:32:18.847269 <190>1 2018-01-29T16:02:18.546367+00:00 app web.1 - - E, [2018-01-29T16:02:18.546336 #26] ERROR -- : /app/vendor/bundle/ruby/2.3.0/gems/rack-reverse-proxy-0.12.0/lib/rack_reverse_proxy/roundtrip.rb:157:in `build_response_headers'
29 Jan 2018 21:32:18.848263 <190>1 2018-01-29T16:02:18.546392+00:00 app web.1 - - E, [2018-01-29T16:02:18.546361 #26] ERROR -- : /app/vendor/bundle/ruby/2.3.0/gems/rack-reverse-proxy-0.12.0/lib/rack_reverse_proxy/roundtrip.rb:153:in `response_headers'
29 Jan 2018 21:32:18.848269 <190>1 2018-01-29T16:02:18.546417+00:00 app web.1 - - E, [2018-01-29T16:02:18.546385 #26] ERROR -- : /app/vendor/bundle/ruby/2.3.0/gems/rack-reverse-proxy-0.12.0/lib/rack_reverse_proxy/roundtrip.rb:182:in `need_replace_location?'
29 Jan 2018 21:32:18.848270 <190>1 2018-01-29T16:02:18.546442+00:00 app web.1 - - E, [2018-01-29T16:02:18.546410 #26] ERROR -- : /app/vendor/bundle/ruby/2.3.0/gems/rack-reverse-proxy-0.12.0/lib/rack_reverse_proxy/roundtrip.rb:172:in `replace_location_header'
29 Jan 2018 21:32:18.848269 <190>1 2018-01-29T16:02:18.546466+00:00 app web.1 - - E, [2018-01-29T16:02:18.546435 #26] ERROR -- : /app/vendor/bundle/ruby/2.3.0/gems/rack-reverse-proxy-0.12.0/lib/rack_reverse_proxy/roundtrip.rb:197:in `setup_response_headers'
29 Jan 2018 21:32:18.848252 <190>1 2018-01-29T16:02:18.546490+00:00 app web.1 - - E, [2018-01-29T16:02:18.546459 #26] ERROR -- : /app/vendor/bundle/ruby/2.3.0/gems/rack-reverse-proxy-0.12.0/lib/rack_reverse_proxy/roundtrip.rb:209:in `proxy'
29 Jan 2018 21:32:18.848250 <190>1 2018-01-29T16:02:18.546514+00:00 app web.1 - - E, [2018-01-29T16:02:18.546484 #26] ERROR -- : /app/vendor/bundle/ruby/2.3.0/gems/rack-reverse-proxy-0.12.0/lib/rack_reverse_proxy/roundtrip.rb:21:in `call'
29 Jan 2018 21:32:18.848251 <190>1 2018-01-29T16:02:18.546538+00:00 app web.1 - - E, [2018-01-29T16:02:18.546507 #26] ERROR -- : /app/vendor/bundle/ruby/2.3.0/gems/rack-reverse-proxy-0.12.0/lib/rack_reverse_proxy/middleware.rb:25:in `call'
29 Jan 2018 21:32:18.848269 <190>1 2018-01-29T16:02:18.546562+00:00 app web.1 - - E, [2018-01-29T16:02:18.546532 #26] ERROR -- : /app/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-4.3.0.335/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
29 Jan 2018 21:32:18.848224 <190>1 2018-01-29T16:02:18.546586+00:00 app web.1 - - E, [2018-01-29T16:02:18.546555 #26] ERROR -- : /app/vendor/bundle/ruby/2.3.0/gems/railties-4.2.9/lib/rails/engine.rb:518:in `call'
29 Jan 2018 21:32:18.848229 <190>1 2018-01-29T16:02:18.546611+00:00 app web.1 - - E, [2018-01-29T16:02:18.546579 #26] ERROR -- : /app/vendor/bundle/ruby/2.3.0/gems/railties-4.2.9/lib/rails/application.rb:165:in `call'
29 Jan 2018 21:32:18.848232 <190>1 2018-01-29T16:02:18.546635+00:00 app web.1 - - E, [2018-01-29T16:02:18.546603 #26] ERROR -- : /app/vendor/bundle/ruby/2.3.0/gems/railties-4.2.9/lib/rails/railtie.rb:194:in `public_send'
29 Jan 2018 21:32:18.849235 <190>1 2018-01-29T16:02:18.546659+00:00 app web.1 - - E, [2018-01-29T16:02:18.546628 #26] ERROR -- : /app/vendor/bundle/ruby/2.3.0/gems/railties-4.2.9/lib/rails/railtie.rb:194:in `method_missing'
29 Jan 2018 21:32:18.849269 <190>1 2018-01-29T16:02:18.546684+00:00 app web.1 - - E, [2018-01-29T16:02:18.546653 #26] ERROR -- : /app/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-4.3.0.335/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
29 Jan 2018 21:32:18.849240 <190>1 2018-01-29T16:02:18.546708+00:00 app web.1 - - E, [2018-01-29T16:02:18.546677 #26] ERROR -- : /app/vendor/bundle/ruby/2.3.0/gems/unicorn-5.3.0/lib/unicorn/http_server.rb:606:in `process_client'
29 Jan 2018 21:32:18.849237 <190>1 2018-01-29T16:02:18.546732+00:00 app web.1 - - E, [2018-01-29T16:02:18.546701 #26] ERROR -- : /app/vendor/bundle/ruby/2.3.0/gems/unicorn-5.3.0/lib/unicorn/http_server.rb:702:in `worker_loop'
29 Jan 2018 21:32:18.849247 <190>1 2018-01-29T16:02:18.546756+00:00 app web.1 - - E, [2018-01-29T16:02:18.546725 #26] ERROR -- : /app/vendor/bundle/ruby/2.3.0/gems/unicorn-5.3.0/lib/unicorn/http_server.rb:549:in `spawn_missing_workers'
29 Jan 2018 21:32:18.849231 <190>1 2018-01-29T16:02:18.546785+00:00 app web.1 - - E, [2018-01-29T16:02:18.546750 #26] ERROR -- : /app/vendor/bundle/ruby/2.3.0/gems/unicorn-5.3.0/lib/unicorn/http_server.rb:142:in `start'
29 Jan 2018 21:32:18.849227 <190>1 2018-01-29T16:02:18.546811+00:00 app web.1 - - E, [2018-01-29T16:02:18.546778 #26] ERROR -- : /app/vendor/bundle/ruby/2.3.0/gems/unicorn-5.3.0/bin/unicorn:126:in `<top (required)>'
29 Jan 2018 21:32:18.849195 <190>1 2018-01-29T16:02:18.546834+00:00 app web.1 - - E, [2018-01-29T16:02:18.546804 #26] ERROR -- : /app/vendor/bundle/ruby/2.3.0/bin/unicorn:22:in `load'
29 Jan 2018 21:32:18.849207 <190>1 2018-01-29T16:02:18.546858+00:00 app web.1 - - E, [2018-01-29T16:02:18.546828 #26] ERROR -- : /app/vendor/bundle/ruby/2.3.0/bin/unicorn:22:in `<top (required)>'
29 Jan 2018 21:32:18.849227 <190>1 2018-01-29T16:02:18.546882+00:00 app web.1 - - E, [2018-01-29T16:02:18.546851 #26] ERROR -- : /app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:74:in `load'
29 Jan 2018 21:32:18.849234 <190>1 2018-01-29T16:02:18.546906+00:00 app web.1 - - E, [2018-01-29T16:02:18.546876 #26] ERROR -- : /app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:74:in `kernel_load'
29 Jan 2018 21:32:18.849226 <190>1 2018-01-29T16:02:18.546931+00:00 app web.1 - - E, [2018-01-29T16:02:18.546900 #26] ERROR -- : /app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:27:in `run'
29 Jan 2018 21:32:18.849223 <190>1 2018-01-29T16:02:18.546955+00:00 app web.1 - - E, [2018-01-29T16:02:18.546924 #26] ERROR -- : /app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/cli.rb:360:in `exec'
29 Jan 2018 21:32:18.850246 <190>1 2018-01-29T16:02:18.546981+00:00 app web.1 - - E, [2018-01-29T16:02:18.546948 #26] ERROR -- : /app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
29 Jan 2018 21:32:18.850261 <190>1 2018-01-29T16:02:18.547005+00:00 app web.1 - - E, [2018-01-29T16:02:18.546973 #26] ERROR -- : /app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
29 Jan 2018 21:32:18.850244 <190>1 2018-01-29T16:02:18.547032+00:00 app web.1 - - E, [2018-01-29T16:02:18.546998 #26] ERROR -- : /app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor.rb:369:in `dispatch'
29 Jan 2018 21:32:18.850226 <190>1 2018-01-29T16:02:18.547057+00:00 app web.1 - - E, [2018-01-29T16:02:18.547026 #26] ERROR -- : /app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/cli.rb:20:in `dispatch'
29 Jan 2018 21:32:18.850246 <190>1 2018-01-29T16:02:18.547081+00:00 app web.1 - - E, [2018-01-29T16:02:18.547050 #26] ERROR -- : /app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/base.rb:444:in `start'
29 Jan 2018 21:32:18.850223 <190>1 2018-01-29T16:02:18.547106+00:00 app web.1 - - E, [2018-01-29T16:02:18.547075 #26] ERROR -- : /app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/cli.rb:10:in `start'
29 Jan 2018 21:32:18.872333 <158>1 2018-01-29T16:02:18.631439+00:00 heroku router - - at=info method=POST path="/provider_stats_events.json" host=www.activityhero.com request_id=372edaa0-3cea-4205-a1b0-dee6d722bad9 fwd="42.2.184.175,162.158.178.44" dyno=web.2 connect=1ms service=27ms status=200 bytes=1174 protocol=https
29 Jan 2018 21:32:18.925235 <190>1 2018-01-29T16:02:18.547130+00:00 app web.1 - - E, [2018-01-29T16:02:18.547099 #26] ERROR -- : /app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/exe/bundle:30:in `block in <top (required)>'
29 Jan 2018 21:32:18.925251 <190>1 2018-01-29T16:02:18.547223+00:00 app web.1 - - E, [2018-01-29T16:02:18.547123 #26] ERROR -- : /app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
29 Jan 2018 21:32:18.925226 <190>1 2018-01-29T16:02:18.547250+00:00 app web.1 - - E, [2018-01-29T16:02:18.547217 #26] ERROR -- : /app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/exe/bundle:22:in `<top (required)>'
29 Jan 2018 21:32:18.925194 <190>1 2018-01-29T16:02:18.547275+00:00 app web.1 - - E, [2018-01-29T16:02:18.547244 #26] ERROR -- : /app/vendor/bundle/ruby/2.3.0/bin/bundle:22:in `load'
29 Jan 2018 21:32:18.925196 <190>1 2018-01-29T16:02:18.547297+00:00 app web.1 - - E, [2018-01-29T16:02:18.547268 #26] ERROR -- : /app/vendor/bundle/ruby/2.3.0/bin/bundle:22:in `<main>'
@akshatpaul
Copy link

Hey is this issue resolved ?

@kaspergrubbe
Copy link

Could this be because of caching? Maybe Heroku is moving your IP of your domain.

If your process thinks www.activityhero.com resolves to a specific IP and that is cached either in the process (libc) it won't resolve a new IP before the application is restarted. I do not know much about Ruby DNS handling, maybe that is the case?

@sheehan1102
Copy link

@satyapatidar did you come up with a solution for this?

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

4 participants