Question

I am having an issue were I keep getting this timeout for Faraday. I don't know what the issue is. I could really use some help here. This failing on a redirect. I am not sure what is causing the issue. I have been trying to fix this for 4 whole days and nothing seems to work. There is very little documentation on Faraday so I am hoping that someone has seen this before.

Is anyone able to help with this error? Is more information needed?

Faraday::Error::TimeoutError (Timeout::Error):
/usr/lib/ruby/1.9.1/net/protocol.rb:146:in `rescue in rbuf_fill'
/usr/lib/ruby/1.9.1/net/protocol.rb:140:in `rbuf_fill'
/usr/lib/ruby/1.9.1/net/protocol.rb:122:in `readuntil'
/usr/lib/ruby/1.9.1/net/protocol.rb:132:in `readline'
/usr/lib/ruby/1.9.1/net/http.rb:2562:in `read_status_line'
/usr/lib/ruby/1.9.1/net/http.rb:2551:in `read_new'
/usr/lib/ruby/1.9.1/net/http.rb:1319:in `block in transport_request'
/usr/lib/ruby/1.9.1/net/http.rb:1316:in `catch'
/usr/lib/ruby/1.9.1/net/http.rb:1316:in `transport_request'
/usr/lib/ruby/1.9.1/net/http.rb:1293:in `request'
rest-client (1.6.7) lib/restclient/net_http_ext.rb:51:in `request'
/usr/lib/ruby/1.9.1/net/http.rb:1286:in `block in request'
/usr/lib/ruby/1.9.1/net/http.rb:745:in `start'
/usr/lib/ruby/1.9.1/net/http.rb:1284:in `request'
rest-client (1.6.7) lib/restclient/net_http_ext.rb:51:in `request'
faraday (0.8.4) lib/faraday/adapter/net_http.rb:74:in `perform_request'
faraday (0.8.4) lib/faraday/adapter/net_http.rb:37:in `call'
faraday (0.8.4) lib/faraday/request/url_encoded.rb:14:in `call'
faraday (0.8.4) lib/faraday/connection.rb:226:in `run_request'
oauth2 (0.8.0) lib/oauth2/client.rb:88:in `request'
oauth2 (0.8.0) lib/oauth2/client.rb:131:in `get_token'
oauth2 (0.8.0) lib/oauth2/strategy/auth_code.rb:29:in `get_token'
omniauth-oauth2 (1.1.0) lib/omniauth/strategies/oauth2.rb:100:in `build_access_token'
omniauth-oauth2 (1.1.0) lib/omniauth/strategies/oauth2.rb:75:in `callback_phase'
omniauth (1.1.1) lib/omniauth/strategy.rb:219:in `callback_call'
omniauth (1.1.1) lib/omniauth/strategy.rb:175:in `call!'
omniauth (1.1.1) lib/omniauth/strategy.rb:157:in `call'
omniauth (1.1.1) lib/omniauth/strategy.rb:177:in `call!'
omniauth (1.1.1) lib/omniauth/strategy.rb:157:in `call'
airbrake (3.1.7) lib/airbrake/rails/middleware.rb:15:in `call'
exception_notification (2.6.1) lib/exception_notifier.rb:34:in `call'
warden (1.2.1) lib/warden/manager.rb:35:in `block in call'
warden (1.2.1) lib/warden/manager.rb:34:in `catch'
warden (1.2.1) lib/warden/manager.rb:34:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.4.5) lib/rack/etag.rb:23:in `call'
rack (1.4.5) lib/rack/conditionalget.rb:25:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/head.rb:14:in `call'
remotipart (1.0.5) lib/remotipart/middleware.rb:30:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/flash.rb:242:in `call'
rack (1.4.5) lib/rack/session/abstract/id.rb:210:in `context'
rack (1.4.5) lib/rack/session/abstract/id.rb:205:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/cookies.rb:341:in `call'
activerecord (3.2.11) lib/active_record/query_cache.rb:64:in `call'
activerecord (3.2.11) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (3.2.11) lib/active_support/callbacks.rb:405:in `_run__2705598145907853404__call__3655850838898635033__callbacks'
activesupport (3.2.11) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.11) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
activesupport (3.2.11) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.11) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.11) lib/rails/rack/logger.rb:32:in `call_app'
railties (3.2.11) lib/rails/rack/logger.rb:16:in `block in call'
activesupport (3.2.11) lib/active_support/tagged_logging.rb:22:in `tagged'
railties (3.2.11) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.5) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.5) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.11) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.5) lib/rack/lock.rb:15:in `call'
rack-cache (1.2) lib/rack/cache/context.rb:136:in `forward'
rack-cache (1.2) lib/rack/cache/context.rb:245:in `fetch'
rack-cache (1.2) lib/rack/cache/context.rb:185:in `lookup'
rack-cache (1.2) lib/rack/cache/context.rb:66:in `call!'
rack-cache (1.2) lib/rack/cache/context.rb:51:in `call'
airbrake (3.1.7) lib/airbrake/user_informer.rb:16:in `_call'
airbrake (3.1.7) lib/airbrake/user_informer.rb:12:in `call'
railties (3.2.11) lib/rails/engine.rb:479:in `call'
railties (3.2.11) lib/rails/application.rb:223:in `call'
railties (3.2.11) lib/rails/railtie/configurable.rb:30:in `method_missing'
/usr/lib/ruby/1.9.1/phusion_passenger/rack/request_handler.rb:96:in `process_request'
/usr/lib/ruby/1.9.1/phusion_passenger/abstract_request_handler.rb:516:in `accept_and_process_next_request'
/usr/lib/ruby/1.9.1/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
/usr/lib/ruby/1.9.1/phusion_passenger/rack/application_spawner.rb:206:in `start_request_handler'
/usr/lib/ruby/1.9.1/phusion_passenger/rack/application_spawner.rb:171:in `block in handle_spawn_application'
/usr/lib/ruby/1.9.1/phusion_passenger/utils.rb:470:in `safe_fork'
/usr/lib/ruby/1.9.1/phusion_passenger/rack/application_spawner.rb:166:in `handle_spawn_application'
/usr/lib/ruby/1.9.1/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
/usr/lib/ruby/1.9.1/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
/usr/lib/ruby/1.9.1/phusion_passenger/abstract_server.rb:180:in `start'
/usr/lib/ruby/1.9.1/phusion_passenger/rack/application_spawner.rb:129:in `start'
/usr/lib/ruby/1.9.1/phusion_passenger/spawn_manager.rb:253:in `block (2 levels) in spawn_rack_application'
/usr/lib/ruby/1.9.1/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
/usr/lib/ruby/1.9.1/phusion_passenger/spawn_manager.rb:246:in `block in spawn_rack_application'
/usr/lib/ruby/1.9.1/phusion_passenger/abstract_server_collection.rb:82:in `block in synchronize'
<internal:prelude>:10:in `synchronize'
/usr/lib/ruby/1.9.1/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
/usr/lib/ruby/1.9.1/phusion_passenger/spawn_manager.rb:244:in `spawn_rack_application'
/usr/lib/ruby/1.9.1/phusion_passenger/spawn_manager.rb:137:in `spawn_application'
/usr/lib/ruby/1.9.1/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
/usr/lib/ruby/1.9.1/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
/usr/lib/ruby/1.9.1/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
/usr/share/phusion-passenger/helper-scripts/passenger-spawn-server:99:in `<main>'
Was it helpful?

Solution

If you need more information on what's happening, you can make faraday log to stdout, which means you can see what's happening and what http calls are being made. The error is happening with OAuth2, so you need to look into why it's timing out.

I'd recommend you run this on your repo:

bundle install --path vendor/bundle

Then, go into the vendor/bundle folder, into the oauth2 folder, and add the line

connection.response :logger if ENV['DEBUG']

to client.rb, within the def request(verb, url, opts={}) method.

Then, whatever command you are using to run phusion-passenger add DEBUG=true to the start of it.

Long answer I know, but should help diagnose what the faraday issue is!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top