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

Getting timeout from Faraday when requesting access_token, email_addrees or profile info #52

Open
Hossam-Mahmoud opened this issue Mar 28, 2019 · 3 comments

Comments

@Hossam-Mahmoud
Copy link

Hossam-Mahmoud commented Mar 28, 2019

Suddenly requests for getting access token or email address or profile info started to raise timeout error 504 from Faraday gem, here is a stacktrace

Faraday::ConnectionFailed: execution expired
/home/api/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/net/http.rb:880:in `initialize'
/home/api/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/net/http.rb:880:in `open'
/home/api/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/net/http.rb:880:in `block in connect'
/home/api/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/timeout.rb:101:in `timeout'
/home/api/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/net/http.rb:878:in `connect'
/home/api/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/net/http.rb:863:in `do_start'
/home/api/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/net/http.rb:852:in `start'
/home/api/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/net/http.rb:1398:in `request'
/home/api/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/net/http.rb:1156:in `get'
/opt/api/shared/bundle/ruby/2.3.0/gems/faraday-0.12.2/lib/faraday/adapter/net_http.rb:78:in `perform_request'
/opt/api/shared/bundle/ruby/2.3.0/gems/faraday-0.12.2/lib/faraday/adapter/net_http.rb:38:in `block in call'
/opt/api/shared/bundle/ruby/2.3.0/gems/faraday-0.12.2/lib/faraday/adapter/net_http.rb:85:in `with_net_http_connection'
/opt/api/shared/bundle/ruby/2.3.0/gems/faraday-0.12.2/lib/faraday/adapter/net_http.rb:33:in `call'
/opt/api/shared/bundle/ruby/2.3.0/gems/faraday-0.12.2/lib/faraday/request/url_encoded.rb:15:in `call'
/opt/api/shared/bundle/ruby/2.3.0/gems/faraday-0.12.2/lib/faraday/rack_builder.rb:141:in `build_response'
/opt/api/shared/bundle/ruby/2.3.0/gems/faraday-0.12.2/lib/faraday/connection.rb:386:in `run_request'
/opt/api/shared/bundle/ruby/2.3.0/gems/oauth2-1.4.0/lib/oauth2/client.rb:99:in `request'
/opt/api/shared/bundle/ruby/2.3.0/gems/oauth2-1.4.0/lib/oauth2/access_token.rb:107:in `request'
/opt/api/shared/bundle/ruby/2.3.0/gems/oauth2-1.4.0/lib/oauth2/access_token.rb:114:in `get'
/opt/api/shared/bundle/ruby/2.3.0/gems/omniauth-linkedin-oauth2-1.0.0/lib/omniauth/strategies/linkedin.rb:63:in `fetch_email_address'
/opt/api/shared/bundle/ruby/2.3.0/gems/omniauth-linkedin-oauth2-1.0.0/lib/omniauth/strategies/linkedin.rb:57:in `email_address'
/opt/api/shared/bundle/ruby/2.3.0/gems/omniauth-linkedin-oauth2-1.0.0/lib/omniauth/strategies/linkedin.rb:23:in `block in <class:LinkedIn>'
/opt/api/shared/bundle/ruby/2.3.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:109:in `instance_eval'
/opt/api/shared/bundle/ruby/2.3.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:109:in `block in compile_stack'
/opt/api/shared/bundle/ruby/2.3.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:108:in `each'
/opt/api/shared/bundle/ruby/2.3.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:108:in `inject'
/opt/api/shared/bundle/ruby/2.3.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:108:in `compile_stack'
/opt/api/shared/bundle/ruby/2.3.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:102:in `info_stack'
/opt/api/shared/bundle/ruby/2.3.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:336:in `info'
/opt/api/shared/bundle/ruby/2.3.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:349:in `auth_hash'
/opt/api/shared/bundle/ruby/2.3.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:372:in `callback_phase'
/opt/api/shared/bundle/ruby/2.3.0/gems/omniauth-oauth2-1.5.0/lib/omniauth/strategies/oauth2.rb:75:in `callback_phase'
/opt/api/shared/bundle/ruby/2.3.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:238:in `callback_call'
/opt/api/shared/bundle/ruby/2.3.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:189:in `call!'
/opt/api/shared/bundle/ruby/2.3.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:169:in `call'
/opt/api/shared/bundle/ruby/2.3.0/gems/omniauth-1.9.0/lib/omniauth/builder.rb:64:in `call'
@Hossam-Mahmoud Hossam-Mahmoud changed the title Getting timeout from Faraday in when requesting access_token or email_addrees or profile info Getting timeout from Faraday when requesting access_token or email_addrees or profile info Mar 28, 2019
@Hossam-Mahmoud Hossam-Mahmoud changed the title Getting timeout from Faraday when requesting access_token or email_addrees or profile info Getting timeout from Faraday when requesting access_token, email_addrees or profile info Mar 28, 2019
@Hossam-Mahmoud
Copy link
Author

@decioferreira We have implemented the whole authentication flow on our own, I think you need to check your flow after LinkedIn new changes

@richardsondx
Copy link

+1

@ksevelyar
Copy link

+1

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :linkedin, ENV['OAUTH_LINKEDIN_KEY'], ENV['OAUTH_LINKEDIN_SECRET'],
    callback_path: "/users/auth/linkedin/callback"

  provider :google_oauth2, ENV['OAUTH_GOOGLE_KEY'], ENV['OAUTH_GOOGLE_SECRET'],
    callback_path: "/users/auth/google/callback"
end

Google works, LinkedIn hangs with the error:

Faraday::ConnectionFailed (execution expired):

/nix/store/yl0r0b0c8ka48rrcjv447ch2q6gy1k4g-ruby-2.7.2/lib/ruby/2.7.0/net/http.rb:960:in `initialize'
/nix/store/yl0r0b0c8ka48rrcjv447ch2q6gy1k4g-ruby-2.7.2/lib/ruby/2.7.0/net/http.rb:960:in `open'
/nix/store/yl0r0b0c8ka48rrcjv447ch2q6gy1k4g-ruby-2.7.2/lib/ruby/2.7.0/net/http.rb:960:in `block in connect'
/nix/store/yl0r0b0c8ka48rrcjv447ch2q6gy1k4g-ruby-2.7.2/lib/ruby/2.7.0/timeout.rb:105:in `timeout'
/nix/store/yl0r0b0c8ka48rrcjv447ch2q6gy1k4g-ruby-2.7.2/lib/ruby/2.7.0/net/http.rb:958:in `connect'
/nix/store/yl0r0b0c8ka48rrcjv447ch2q6gy1k4g-ruby-2.7.2/lib/ruby/2.7.0/net/http.rb:943:in `do_start'
/nix/store/yl0r0b0c8ka48rrcjv447ch2q6gy1k4g-ruby-2.7.2/lib/ruby/2.7.0/net/http.rb:932:in `start'
/nix/store/5m50ndm4dvvqydx4m0bq5fvmczj9b574-ruby2.7.2-faraday-1.1.0/lib/ruby/gems/2.7.0/gems/faraday-1.1.0/lib/faraday/adapter/net_http.rb:152:in `request_via_request_method'
/nix/store/5m50ndm4dvvqydx4m0bq5fvmczj9b574-ruby2.7.2-faraday-1.1.0/lib/ruby/gems/2.7.0/gems/faraday-1.1.0/lib/faraday/adapter/net_http.rb:137:in `request_with_wrapped_block'
/nix/store/5m50ndm4dvvqydx4m0bq5fvmczj9b574-ruby2.7.2-faraday-1.1.0/lib/ruby/gems/2.7.0/gems/faraday-1.1.0/lib/faraday/adapter/net_http.rb:128:in `perform_request'
/nix/store/5m50ndm4dvvqydx4m0bq5fvmczj9b574-ruby2.7.2-faraday-1.1.0/lib/ruby/gems/2.7.0/gems/faraday-1.1.0/lib/faraday/adapter/net_http.rb:70:in `block in call'
/nix/store/5m50ndm4dvvqydx4m0bq5fvmczj9b574-ruby2.7.2-faraday-1.1.0/lib/ruby/gems/2.7.0/gems/faraday-1.1.0/lib/faraday/adapter.rb:61:in `connection'
/nix/store/5m50ndm4dvvqydx4m0bq5fvmczj9b574-ruby2.7.2-faraday-1.1.0/lib/ruby/gems/2.7.0/gems/faraday-1.1.0/lib/faraday/adapter/net_http.rb:68:in `call'
/nix/store/5m50ndm4dvvqydx4m0bq5fvmczj9b574-ruby2.7.2-faraday-1.1.0/lib/ruby/gems/2.7.0/gems/faraday-1.1.0/lib/faraday/request/url_encoded.rb:25:in `call'
/nix/store/5m50ndm4dvvqydx4m0bq5fvmczj9b574-ruby2.7.2-faraday-1.1.0/lib/ruby/gems/2.7.0/gems/faraday-1.1.0/lib/faraday/rack_builder.rb:154:in `build_response'
/nix/store/5m50ndm4dvvqydx4m0bq5fvmczj9b574-ruby2.7.2-faraday-1.1.0/lib/ruby/gems/2.7.0/gems/faraday-1.1.0/lib/faraday/connection.rb:492:in `run_request'
/nix/store/gx1ija8lpzpf71zdk1bmwv600k3w20ym-ruby2.7.2-oauth2-1.4.4/lib/ruby/gems/2.7.0/gems/oauth2-1.4.4/lib/oauth2/client.rb:99:in `request'
/nix/store/gx1ija8lpzpf71zdk1bmwv600k3w20ym-ruby2.7.2-oauth2-1.4.4/lib/ruby/gems/2.7.0/gems/oauth2-1.4.4/lib/oauth2/client.rb:147:in `get_token'
/nix/store/gx1ija8lpzpf71zdk1bmwv600k3w20ym-ruby2.7.2-oauth2-1.4.4/lib/ruby/gems/2.7.0/gems/oauth2-1.4.4/lib/oauth2/strategy/auth_code.rb:30:in `get_token'
/nix/store/4nvysm50dq2i0cphy994naxz8386lsw5-ruby2.7.2-omniauth-oauth2-1.7.0/lib/ruby/gems/2.7.0/gems/omniauth-oauth2-1.7.0/lib/omniauth/strategies/oauth2.rb:126:in `build_access_token'
/nix/store/4nvysm50dq2i0cphy994naxz8386lsw5-ruby2.7.2-omniauth-oauth2-1.7.0/lib/ruby/gems/2.7.0/gems/omniauth-oauth2-1.7.0/lib/omniauth/strategies/oauth2.rb:91:in `callback_phase'
/nix/store/wyxy9mm7vgsfqwm2lk7fdcma924m045l-ruby2.7.2-omniauth-1.9.1/lib/ruby/gems/2.7.0/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:238:in `callback_call'
/nix/store/wyxy9mm7vgsfqwm2lk7fdcma924m045l-ruby2.7.2-omniauth-1.9.1/lib/ruby/gems/2.7.0/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:189:in `call!'
/nix/store/wyxy9mm7vgsfqwm2lk7fdcma924m045l-ruby2.7.2-omniauth-1.9.1/lib/ruby/gems/2.7.0/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:169:in `call'
/nix/store/wyxy9mm7vgsfqwm2lk7fdcma924m045l-ruby2.7.2-omniauth-1.9.1/lib/ruby/gems/2.7.0/gems/omniauth-1.9.1/lib/omniauth/builder.rb:45:in `call'
/nix/store/k71gsfr2lajs92nxqw1892d6s1ka9fgf-ruby2.7.2-rack-2.2.3/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/session/abstract/id.rb:266:in `context'
/nix/store/k71gsfr2lajs92nxqw1892d6s1ka9fgf-ruby2.7.2-rack-2.2.3/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/session/abstract/id.rb:260:in `call'
/nix/store/ghbm8fs2p756kvycy2yriq1fjcrpvc0s-ruby2.7.2-actionpack-6.0.3.2/lib/ruby/gems/2.7.0/gems/actionpack-6.0.3.2/lib/action_dispatch/middleware/cookies.rb:648:in `call'
/nix/store/k71gsfr2lajs92nxqw1892d6s1ka9fgf-ruby2.7.2-rack-2.2.3/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/etag.rb:27:in `call'
/nix/store/k71gsfr2lajs92nxqw1892d6s1ka9fgf-ruby2.7.2-rack-2.2.3/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/conditional_get.rb:27:in `call'
/nix/store/k71gsfr2lajs92nxqw1892d6s1ka9fgf-ruby2.7.2-rack-2.2.3/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/head.rb:12:in `call'
/nix/store/3qwd2dymfyl0f60s1rvpw6ngc1c2wm4v-ruby2.7.2-activerecord-6.0.3.2/lib/ruby/gems/2.7.0/gems/activerecord-6.0.3.2/lib/active_record/migration.rb:567:in `call'
/nix/store/ghbm8fs2p756kvycy2yriq1fjcrpvc0s-ruby2.7.2-actionpack-6.0.3.2/lib/ruby/gems/2.7.0/gems/actionpack-6.0.3.2/lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
/nix/store/xfz3swbwyd11xixh7rxgj401a79lf69s-ruby2.7.2-activesupport-6.0.3.2/lib/ruby/gems/2.7.0/gems/activesupport-6.0.3.2/lib/active_support/callbacks.rb:101:in `run_callbacks'
/nix/store/ghbm8fs2p756kvycy2yriq1fjcrpvc0s-ruby2.7.2-actionpack-6.0.3.2/lib/ruby/gems/2.7.0/gems/actionpack-6.0.3.2/lib/action_dispatch/middleware/callbacks.rb:26:in `call'
/nix/store/ghbm8fs2p756kvycy2yriq1fjcrpvc0s-ruby2.7.2-actionpack-6.0.3.2/lib/ruby/gems/2.7.0/gems/actionpack-6.0.3.2/lib/action_dispatch/middleware/executor.rb:14:in `call'
/nix/store/ghbm8fs2p756kvycy2yriq1fjcrpvc0s-ruby2.7.2-actionpack-6.0.3.2/lib/ruby/gems/2.7.0/gems/actionpack-6.0.3.2/lib/action_dispatch/middleware/actionable_exceptions.rb:17:in `call'
/nix/store/ghbm8fs2p756kvycy2yriq1fjcrpvc0s-ruby2.7.2-actionpack-6.0.3.2/lib/ruby/gems/2.7.0/gems/actionpack-6.0.3.2/lib/action_dispatch/middleware/debug_exceptions.rb:32:in `call'
/nix/store/ghbm8fs2p756kvycy2yriq1fjcrpvc0s-ruby2.7.2-actionpack-6.0.3.2/lib/ruby/gems/2.7.0/gems/actionpack-6.0.3.2/lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
/nix/store/3xarx51d2dbxhmap87w1mfjfilplzgvj-ruby2.7.2-railties-6.0.3.2/lib/ruby/gems/2.7.0/gems/railties-6.0.3.2/lib/rails/rack/logger.rb:37:in `call_app'
/nix/store/3xarx51d2dbxhmap87w1mfjfilplzgvj-ruby2.7.2-railties-6.0.3.2/lib/ruby/gems/2.7.0/gems/railties-6.0.3.2/lib/rails/rack/logger.rb:26:in `block in call'
/nix/store/xfz3swbwyd11xixh7rxgj401a79lf69s-ruby2.7.2-activesupport-6.0.3.2/lib/ruby/gems/2.7.0/gems/activesupport-6.0.3.2/lib/active_support/tagged_logging.rb:80:in `block in tagged'
/nix/store/xfz3swbwyd11xixh7rxgj401a79lf69s-ruby2.7.2-activesupport-6.0.3.2/lib/ruby/gems/2.7.0/gems/activesupport-6.0.3.2/lib/active_support/tagged_logging.rb:28:in `tagged'
/nix/store/xfz3swbwyd11xixh7rxgj401a79lf69s-ruby2.7.2-activesupport-6.0.3.2/lib/ruby/gems/2.7.0/gems/activesupport-6.0.3.2/lib/active_support/tagged_logging.rb:80:in `tagged'
/nix/store/3xarx51d2dbxhmap87w1mfjfilplzgvj-ruby2.7.2-railties-6.0.3.2/lib/ruby/gems/2.7.0/gems/railties-6.0.3.2/lib/rails/rack/logger.rb:26:in `call'
/nix/store/ghbm8fs2p756kvycy2yriq1fjcrpvc0s-ruby2.7.2-actionpack-6.0.3.2/lib/ruby/gems/2.7.0/gems/actionpack-6.0.3.2/lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
/nix/store/ghbm8fs2p756kvycy2yriq1fjcrpvc0s-ruby2.7.2-actionpack-6.0.3.2/lib/ruby/gems/2.7.0/gems/actionpack-6.0.3.2/lib/action_dispatch/middleware/request_id.rb:27:in `call'
/nix/store/k71gsfr2lajs92nxqw1892d6s1ka9fgf-ruby2.7.2-rack-2.2.3/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/runtime.rb:22:in `call'
/nix/store/xfz3swbwyd11xixh7rxgj401a79lf69s-ruby2.7.2-activesupport-6.0.3.2/lib/ruby/gems/2.7.0/gems/activesupport-6.0.3.2/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
/nix/store/ghbm8fs2p756kvycy2yriq1fjcrpvc0s-ruby2.7.2-actionpack-6.0.3.2/lib/ruby/gems/2.7.0/gems/actionpack-6.0.3.2/lib/action_dispatch/middleware/executor.rb:14:in `call'
/nix/store/ghbm8fs2p756kvycy2yriq1fjcrpvc0s-ruby2.7.2-actionpack-6.0.3.2/lib/ruby/gems/2.7.0/gems/actionpack-6.0.3.2/lib/action_dispatch/middleware/static.rb:126:in `call'
/nix/store/k71gsfr2lajs92nxqw1892d6s1ka9fgf-ruby2.7.2-rack-2.2.3/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/sendfile.rb:110:in `call'
/nix/store/ghbm8fs2p756kvycy2yriq1fjcrpvc0s-ruby2.7.2-actionpack-6.0.3.2/lib/ruby/gems/2.7.0/gems/actionpack-6.0.3.2/lib/action_dispatch/middleware/host_authorization.rb:82:in `call'
/nix/store/2yrsa7abg8hkbv2jv53hy58m72ng7dwx-ruby2.7.2-rack-cors-1.1.1/lib/ruby/gems/2.7.0/gems/rack-cors-1.1.1/lib/rack/cors.rb:100:in `call'
/nix/store/3xarx51d2dbxhmap87w1mfjfilplzgvj-ruby2.7.2-railties-6.0.3.2/lib/ruby/gems/2.7.0/gems/railties-6.0.3.2/lib/rails/engine.rb:527:in `call'
/nix/store/2kbz7k59d25k7lddj6dlfhiw3iycp8fs-ruby2.7.2-puma-4.3.5/lib/ruby/gems/2.7.0/gems/puma-4.3.5/lib/puma/configuration.rb:228:in `call'
/nix/store/2kbz7k59d25k7lddj6dlfhiw3iycp8fs-ruby2.7.2-puma-4.3.5/lib/ruby/gems/2.7.0/gems/puma-4.3.5/lib/puma/server.rb:713:in `handle_request'
/nix/store/2kbz7k59d25k7lddj6dlfhiw3iycp8fs-ruby2.7.2-puma-4.3.5/lib/ruby/gems/2.7.0/gems/puma-4.3.5/lib/puma/server.rb:472:in `process_client'
/nix/store/2kbz7k59d25k7lddj6dlfhiw3iycp8fs-ruby2.7.2-puma-4.3.5/lib/ruby/gems/2.7.0/gems/puma-4.3.5/lib/puma/server.rb:328:in `block in run'
/nix/store/2kbz7k59d25k7lddj6dlfhiw3iycp8fs-ruby2.7.2-puma-4.3.5/lib/ruby/gems/2.7.0/gems/puma-4.3.5/lib/puma/thread_pool.rb:134:in `block in spawn_thread'

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

3 participants