当用户尝试使用facebook登录时,有时(大约2周)我的Rails应用程序在回调方法期间崩溃。
这是随机发生的,我找不到解决这个问题的方法。
错误下方和一段stacktrace:
Errno :: ENETUNREACH发生在#: 网络无法访问 - connect(2)
------------------------------- Backtrace:
/home/finetuning/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/net/http.rb:762:in `initialize' /home/finetuning/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/net/http.rb:762:in `open' /home/finetuning/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/net/http.rb:762:in `block in connect' /home/finetuning/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/timeout.rb:54:in `timeout' /home/finetuning/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/timeout.rb:99:in `timeout' /home/finetuning/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/net/http.rb:762:in `connect' /home/finetuning/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/net/http.rb:755:in `do_start' /home/finetuning/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/net/http.rb:744:in `start' /home/finetuning/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/net/http.rb:1284:in `request' faraday (0.7.6) lib/faraday/adapter/net_http.rb:61:in `call' faraday (0.7.6) lib/faraday/request/url_encoded.rb:14:in `call' faraday (0.7.6) lib/faraday/connection.rb:210:in `run_request' oauth2 (0.5.2) lib/oauth2/client.rb:88:in `request' oauth2 (0.5.2) lib/oauth2/client.rb:128:in `get_token' oauth2 (0.5.2) lib/oauth2/strategy/auth_code.rb:29:in `get_token' omniauth-oauth2 (1.0.0) lib/omniauth/strategies/oauth2.rb:77:in `build_access_token' omniauth-facebook (1.2.0) lib/omniauth/strategies/facebook.rb:63:in `block in build_access_token' omniauth-facebook (1.2.0) lib/omniauth/strategies/facebook.rb:110:in `with_authorization_code' omniauth-facebook (1.2.0) lib/omniauth/strategies/facebook.rb:63:in `build_access_token' omniauth-oauth2 (1.0.0) lib/omniauth/strategies/oauth2.rb:61:in `callback_phase'
答案 0 :(得分:0)
这听起来像是需要向我重新请求的访问令牌,但这是一个不可知的猜测。
在我开始工作之前,有很多事情阻止了回调为我工作:
随意仔细检查一下我的工作情况,看看是否有帮助:
http://www.ajostrow.me/thoughts/client-side-facebook-authentication-with-rails
答案 1 :(得分:0)