为什么google_oauth2会在回调期间通过omniauth挂起/停止?

时间:2013-05-03 19:01:22

标签: ruby-on-rails timeout omniauth google-oauth

我刚刚实施了omniauth并使用谷歌和Facebook提供商。它们都在工作但是定期(经常是这样)google身份验证回调只是一动不动。过了一会儿,我收到超时错误。发生了什么,我该如何解决?

这是我得到的错误

Started GET "/auth/google_oauth2" for 127.0.0.1 at 2013-05-03 11:55:33 -0700
(google_oauth2) Callback phase initiated.
(google_oauth2) Authentication failure! timeout: Errno::ETIMEDOUT, Operation timed out - connect(2)


Started GET "/auth/google_oauth2/callback?state=e8ba5ae3e3cedf43646b822e08990845caeb7e9697ab07cf&code=4/9J4e17eRhO9qw_nL0FW7BhiNo1hO.UrrcXL6YAC8WEnp6UAPFm0EWMoPXfAI" for 127.0.0.1 at 2013-05-03 11:55:35 -0700

Errno::ETIMEDOUT (Operation timed out - connect(2)):
  /Users/my_user/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/net/http.rb:644:in `initialize'
  /Users/my_user/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/net/http.rb:644:in `open'
  /Users/my_user/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/net/http.rb:644:in `block in connect'
  /Users/my_user/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/timeout.rb:44:in `timeout'
  /Users/my_user/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/timeout.rb:89:in `timeout'
  /Users/my_user/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/net/http.rb:644:in `connect'
  /Users/my_user/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/net/http.rb:637:in `do_start'
  /Users/my_user/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/net/http.rb:626:in `start'
  /Users/my_user/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/net/http.rb:1168:in `request'
  faraday (0.8.7) lib/faraday/adapter/net_http.rb:75:in `perform_request'
  faraday (0.8.7) lib/faraday/adapter/net_http.rb:38:in `call'
  faraday (0.8.7) lib/faraday/request/url_encoded.rb:14:in `call'
  faraday (0.8.7) lib/faraday/connection.rb:247:in `run_request'
  oauth2 (0.8.1) lib/oauth2/client.rb:88:in `request'
  oauth2 (0.8.1) lib/oauth2/client.rb:131:in `get_token'
  oauth2 (0.8.1) lib/oauth2/strategy/auth_code.rb:29:in `get_token'
  omniauth-oauth2 (1.1.1) lib/omniauth/strategies/oauth2.rb:99:in `build_access_token'
  omniauth-google-oauth2 (0.1.17) lib/omniauth/strategies/google_oauth2.rb:69:in `build_access_token_with_access_token'
  omniauth-oauth2 (1.1.1) lib/omniauth/strategies/oauth2.rb:74:in `callback_phase'
  omniauth (1.1.4) lib/omniauth/strategy.rb:226:in `callback_call'
  omniauth (1.1.4) lib/omniauth/strategy.rb:182:in `call!'
  omniauth (1.1.4) lib/omniauth/strategy.rb:164:in `call'
  omniauth (1.1.4) lib/omniauth/strategy.rb:184:in `call!'
  omniauth (1.1.4) lib/omniauth/strategy.rb:164:in `call'
  omniauth (1.1.4) lib/omniauth/builder.rb:49: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.13) 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.13) lib/action_dispatch/middleware/head.rb:14:in `call'
  actionpack (3.2.13) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
  actionpack (3.2.13) 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.13) lib/action_dispatch/middleware/cookies.rb:341:in `call'
  activerecord (3.2.13) lib/active_record/query_cache.rb:64:in `call'
  activerecord (3.2.13) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
  actionpack (3.2.13) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
  activesupport (3.2.13) lib/active_support/callbacks.rb:405:in `_run__632978683309941380__call__2313693741058127018__callbacks'
  activesupport (3.2.13) lib/active_support/callbacks.rb:405:in `__run_callback'
  activesupport (3.2.13) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
  activesupport (3.2.13) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (3.2.13) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  actionpack (3.2.13) lib/action_dispatch/middleware/reloader.rb:65:in `call'
  actionpack (3.2.13) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
  actionpack (3.2.13) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
  actionpack (3.2.13) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
  railties (3.2.13) lib/rails/rack/logger.rb:32:in `call_app'
  railties (3.2.13) lib/rails/rack/logger.rb:16:in `block in call'
  activesupport (3.2.13) lib/active_support/tagged_logging.rb:22:in `tagged'
  railties (3.2.13) lib/rails/rack/logger.rb:16:in `call'
  actionpack (3.2.13) 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.13) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
  rack (1.4.5) lib/rack/lock.rb:15:in `call'
  actionpack (3.2.13) lib/action_dispatch/middleware/static.rb:63:in `call'
  railties (3.2.13) lib/rails/engine.rb:479:in `call'
  railties (3.2.13) lib/rails/application.rb:223:in `call'
  rack (1.4.5) lib/rack/content_length.rb:14:in `call'
  railties (3.2.13) lib/rails/rack/log_tailer.rb:17:in `call'
  rack (1.4.5) lib/rack/handler/webrick.rb:59:in `service'
  /Users/my_user/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
  /Users/my_user/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
  /Users/my_user/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'


  Rendered /Users/my_user/.rvm/gems/ruby-1.9.2-p320@barter/gems/actionpack-3.2.13/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.4ms)
  Rendered /Users/my_user/.rvm/gems/ruby-1.9.2-p320@barter/gems/actionpack-3.2.13/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.2ms)
  Rendered /Users/my_user/.rvm/gems/ruby-1.9.2-p320@barter/gems/actionpack-3.2.13/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (19.1ms)
[2013-05-03 11:56:50] ERROR Errno::ECONNRESET: Connection reset by peer
    /Users/my_user/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/httpserver.rb:56:in `eof?'
    /Users/my_user/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/httpserver.rb:56:in `run'
    /Users/my_user/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'

0 个答案:

没有答案