cookpad / kuroko2

Kuroko2 is a web-based job scheduler / workflow engine.
MIT License
313 stars 72 forks source link

OAuth2::Error #133

Closed yukihirop closed 4 years ago

yukihirop commented 4 years ago

Environment

Summary

Thank you for making a nice gem.

When authenticating google_oauth2, the following error occurs.

スクリーンショット 2019-11-18 23 59 52

``` 23:47:54 rails.1 | OAuth2::Error ({"code"=>403, "message"=>"Legacy People API has not been used in project 1077742424242408 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/legacypeople.googleapis.com/overview?project=107772132452345873608 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.", "status"=>"PERMISSION_DENIED", "details"=>[{"@type"=>"type.googleapis.com/google.rpc.Help", "links"=>[{"description"=>"Google developers console API activation", "url"=>"https://console.developers.google.com/apis/api/legacypeople.googleapis.com/overview?project=10777242424241873608"}]}]}: 23:47:54 rails.1 | { 23:47:54 rails.1 | "error": { 23:47:54 rails.1 | "code": 403, 23:47:54 rails.1 | "message": "Legacy People API has not been used in project 10842828 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/legacypeople.googleapis.com/overview?project=107774242424608 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.", 23:47:54 rails.1 | "status": "PERMISSION_DENIED", 23:47:54 rails.1 | "details": [ 23:47:54 rails.1 | { 23:47:54 rails.1 | "@type": "type.googleapis.com/google.rpc.Help", 23:47:54 rails.1 | "links": [ 23:47:54 rails.1 | { 23:47:54 rails.1 | "description": "Google developers console API activation", 23:47:54 rails.1 | "url": "https://console.developers.google.com/apis/api/legacypeople.googleapis.com/overview?project=10777324224242408" 23:47:54 rails.1 | } 23:47:54 rails.1 | ] 23:47:54 rails.1 | } 23:47:54 rails.1 | ] 23:47:54 rails.1 | } 23:47:54 rails.1 | } 23:47:54 rails.1 | ): 23:47:54 rails.1 | 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/oauth2-1.4.2/lib/oauth2/client.rb:119:in `request' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/oauth2-1.4.2/lib/oauth2/access_token.rb:107:in `request' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/oauth2-1.4.2/lib/oauth2/access_token.rb:114:in `get' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/omniauth-google-oauth2-0.2.10/lib/omniauth/strategies/google_oauth2.rb:81:in `raw_info' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/omniauth-google-oauth2-0.2.10/lib/omniauth/strategies/google_oauth2.rb:42:in `block in ' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:109:in `instance_eval' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:109:in `block in compile_stack' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:108:in `each' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:108:in `inject' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:108:in `compile_stack' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:102:in `uid_stack' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:332:in `uid' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:348:in `auth_hash' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:372:in `callback_phase' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/omniauth-oauth2-1.3.1/lib/omniauth/strategies/oauth2.rb:79:in `callback_phase' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:238:in `callback_call' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:189:in `call!' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:169:in `call' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/omniauth-1.9.0/lib/omniauth/builder.rb:64:in `call' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/http_accept_language-2.1.1/lib/http_accept_language/middleware.rb:14:in `call' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/rack-2.0.7/lib/rack/tempfile_reaper.rb:15:in `call' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/rack-2.0.7/lib/rack/etag.rb:25:in `call' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/rack-2.0.7/lib/rack/conditional_get.rb:25:in `call' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/rack-2.0.7/lib/rack/head.rb:12:in `call' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.3/lib/action_dispatch/http/content_security_policy.rb:18:in `call' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/rack-2.0.7/lib/rack/session/abstract/id.rb:232:in `context' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/rack-2.0.7/lib/rack/session/abstract/id.rb:226:in `call' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/cookies.rb:670:in `call' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:559:in `call' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/callbacks.rb:98:in `run_callbacks' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/callbacks.rb:26:in `call' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/executor.rb:14:in `call' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/debug_exceptions.rb:61:in `call' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/web-console-3.7.0/lib/web_console/middleware.rb:135:in `call_app' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/web-console-3.7.0/lib/web_console/middleware.rb:30:in `block in call' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/web-console-3.7.0/lib/web_console/middleware.rb:20:in `catch' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/web-console-3.7.0/lib/web_console/middleware.rb:20:in `call' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/show_exceptions.rb:33:in `call' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/rack/logger.rb:38:in `call_app' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/rack/logger.rb:26:in `block in call' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/tagged_logging.rb:71:in `block in tagged' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/tagged_logging.rb:28:in `tagged' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/tagged_logging.rb:71:in `tagged' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/rack/logger.rb:26:in `call' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/quiet_assets.rb:13:in `call' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/remote_ip.rb:81:in `call' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/request_id.rb:27:in `call' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/rack-2.0.7/lib/rack/method_override.rb:22:in `call' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/rack-2.0.7/lib/rack/runtime.rb:22:in `call' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/executor.rb:14:in `call' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/static.rb:127:in `call' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/rack-2.0.7/lib/rack/sendfile.rb:111:in `call' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/engine.rb:524:in `call' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/puma-3.12.1/lib/puma/configuration.rb:227:in `call' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/puma-3.12.1/lib/puma/server.rb:660:in `handle_request' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/puma-3.12.1/lib/puma/server.rb:474:in `process_client' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/puma-3.12.1/lib/puma/server.rb:334:in `block in run' 23:47:54 rails.1 | vendor/bundle/ruby/2.5.0/gems/puma-3.12.1/lib/puma/thread_pool.rb:135:in `block in spawn_thread' ```

This is an error that the Legacy People API is disabled, but according to the official documentation there is no way to enable it.

https://developers.google.com/people/legacy

I think you should raise the version of omniauth-google-oauth2 to a version that uses substitutes such as Google People API.

Thank you.

j-omine commented 4 years ago

I can no longer log into the dashboard with the same error. The gem versions used are 0.4.3 and 0.5.0

eagletmt commented 4 years ago

Please update your kuroko2 gem to v0.5.1 or later. https://github.com/cookpad/kuroko2/blob/master/CHANGELOG.md That problem is already solved by #126 .

yukihirop commented 4 years ago

I forgot to look CHANGELOG.md 😅 thank you for your answer.

andreped commented 1 year ago

Hello! I'm having issues with the same thing as mentioned above using the Master branch. I'm using Ruby 2.5.1.

Which versions for Ruby, Rails, kuroko2 (and others of relevance) are expected to be used for this project?


EDIT: Any ideas, @eagletmt ?