mmangino/facebooker2 — Issue #67: Errno::ETIMEDOUT: Connection timed out - connect(2)
Author: martinpesout
Created: 2011-11-15 12:02:30+00:00
State: open

Hi,

I have before_filter in my application_controller like this:

```ruby
before_filter :set_current_facebook_user

def set_current_facebook_user
@current_facebook_user = current_facebook_user
end
```

but sometimes I recieve this error "Errno::ETIMEDOUT: Connection timed out - connect(2)". Here is my backtrace:

```ruby
/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/http.rb:560:in `initialize'
/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/http.rb:560:in `open'
/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/http.rb:560:in `connect'
/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/timeout.rb:53:in `timeout'
/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/timeout.rb:101:in `timeout'
/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/http.rb:560:in `connect'
/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/http.rb:553:in `do_start'
/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/http.rb:542:in `start'
/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/http.rb:1035:in `request'
/home/cheetah/gems/ruby/1.8/gems/httparty-0.8.1/lib/httparty/request.rb:73:in `perform'
/home/cheetah/gems/ruby/1.8/gems/httparty-0.8.1/lib/httparty.rb:391:in `perform_request'
/home/cheetah/gems/ruby/1.8/gems/httparty-0.8.1/lib/httparty.rb:343:in `get'
/home/cheetah/gems/ruby/1.8/bundler/gems/mogli-2be6922b2403/lib/mogli/client.rb:50:in `create_from_code_and_authenticator'
/home/cheetah/gems/ruby/1.8/bundler/gems/facebooker2-172665891037/lib/facebooker2/rails/controller.rb:231:in `oauth2_fetch_client_and_user_from_cookie'
/home/cheetah/gems/ruby/1.8/bundler/gems/facebooker2-172665891037/lib/facebooker2/rails/controller.rb:221:in `oauth2_fetch_client_and_user'
/home/cheetah/gems/ruby/1.8/bundler/gems/facebooker2-172665891037/lib/facebooker2/rails/controller.rb:16:in `current_facebook_user'
/data/c/cheetah/planet_of_winners/releases/20111115100155/app/controllers/application_controller.rb:118:in `set_current_facebook_user'
```

Before I recieve this error, I have to wait about 45 seconds to finish my action and then I recieve this timeout error.

Does anybody know, how to solve this problem? Thanks a lot.
Martin