heartcombo / devise

Flexible authentication solution for Rails with Warden.
http://blog.plataformatec.com.br/tag/devise/
MIT License
24.01k stars 5.55k forks source link

Rails app does not boot on the Rails main branch (8 alpha) #5707

Closed jeromedalbert closed 3 months ago

jeromedalbert commented 3 months ago

May be fixed by https://github.com/heartcombo/devise/pull/5706. Issue introduced by commit https://github.com/rails/rails/commit/f4b581b67504f7fb2e2acb043ca7f11b41b13ad6 via https://github.com/rails/rails/pull/52605 (found by bisecting).

Environment

Steps to reproduce

Current behavior

I get the following error:

$ RAILS_ENV=production rails server
=> Booting Puma
=> Rails 8.0.0.alpha application starting in production
=> Run `bin/rails server --help` for more startup options
Exiting
/Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/actionpack/lib/action_dispatch/routing/mapper.rb:313:in `block (2 levels) in check_controller_and_action': '{:only=>[:new, :create, :edit, :update, :destroy], :path=>"", :path_names=>{:new=>"sign_up", :edit=>"edit", :cancel=>"cancel"}, :controller=>"devise/registrations"}s' is not a supported controller name. This can lead to potential routing problems. See https://guides.rubyonrails.org/routing.html#specifying-a-controller-to-use (ArgumentError)

                raise ArgumentError, message
                      ^^^^^^^^^^^^^^^^^^^^^^
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/actionpack/lib/action_dispatch/routing/mapper.rb:350:in `translate_controller'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/actionpack/lib/action_dispatch/routing/mapper.rb:309:in `block in check_controller_and_action'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/actionpack/lib/action_dispatch/routing/mapper.rb:324:in `check_part'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/actionpack/lib/action_dispatch/routing/mapper.rb:308:in `check_controller_and_action'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/actionpack/lib/action_dispatch/routing/mapper.rb:249:in `normalize_options!'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/actionpack/lib/action_dispatch/routing/mapper.rb:146:in `initialize'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/actionpack/lib/action_dispatch/routing/mapper.rb:99:in `new'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/actionpack/lib/action_dispatch/routing/mapper.rb:99:in `build'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/actionpack/lib/action_dispatch/routing/mapper.rb:2047:in `add_route'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/actionpack/lib/action_dispatch/routing/mapper.rb:2024:in `decomposed_match'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/actionpack/lib/action_dispatch/routing/mapper.rb:2022:in `block in decomposed_match'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/actionpack/lib/action_dispatch/routing/mapper.rb:1960:in `path_scope'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/actionpack/lib/action_dispatch/routing/mapper.rb:1588:in `block in member'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/actionpack/lib/action_dispatch/routing/mapper.rb:1839:in `with_scope_level'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/actionpack/lib/action_dispatch/routing/mapper.rb:1582:in `member'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/actionpack/lib/action_dispatch/routing/mapper.rb:2022:in `decomposed_match'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/actionpack/lib/action_dispatch/routing/mapper.rb:1993:in `map_match'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/actionpack/lib/action_dispatch/routing/mapper.rb:1736:in `block in match'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/actionpack/lib/action_dispatch/routing/mapper.rb:1732:in `each'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/actionpack/lib/action_dispatch/routing/mapper.rb:1732:in `match'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/actionpack/lib/action_dispatch/routing/mapper.rb:741:in `get'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/devise-4.9.4/lib/devise/rails/routes.rb:417:in `block in devise_registration'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/actionpack/lib/action_dispatch/routing/mapper.rb:1357:in `block (2 levels) in resource'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/actionpack/lib/action_dispatch/routing/mapper.rb:945:in `controller'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/actionpack/lib/action_dispatch/routing/mapper.rb:1847:in `resource_scope'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/actionpack/lib/action_dispatch/routing/mapper.rb:1356:in `block in resource'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/actionpack/lib/action_dispatch/routing/mapper.rb:1839:in `with_scope_level'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/actionpack/lib/action_dispatch/routing/mapper.rb:1354:in `resource'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/actionpack/lib/action_dispatch/routing/mapper.rb:1781:in `public_send'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/actionpack/lib/action_dispatch/routing/mapper.rb:1781:in `block in apply_common_behavior_for'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/actionpack/lib/action_dispatch/routing/mapper.rb:1781:in `each'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/actionpack/lib/action_dispatch/routing/mapper.rb:1781:in `apply_common_behavior_for'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/actionpack/lib/action_dispatch/routing/mapper.rb:1350:in `resource'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/devise-4.9.4/lib/devise/rails/routes.rb:416:in `devise_registration'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/devise-4.9.4/lib/devise/rails/routes.rb:268:in `block (4 levels) in devise_for'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/devise-4.9.4/lib/devise/rails/routes.rb:268:in `each'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/devise-4.9.4/lib/devise/rails/routes.rb:268:in `block (3 levels) in devise_for'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/devise-4.9.4/lib/devise/rails/routes.rb:472:in `with_devise_exclusive_scope'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/devise-4.9.4/lib/devise/rails/routes.rb:267:in `block (2 levels) in devise_for'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/devise-4.9.4/lib/devise/rails/routes.rb:370:in `block in devise_scope'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/actionpack/lib/action_dispatch/routing/mapper.rb:930:in `scope'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/actionpack/lib/action_dispatch/routing/mapper.rb:1060:in `constraints'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/devise-4.9.4/lib/devise/rails/routes.rb:369:in `devise_scope'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/devise-4.9.4/lib/devise/rails/routes.rb:266:in `block in devise_for'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/devise-4.9.4/lib/devise/rails/routes.rb:242:in `each'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/devise-4.9.4/lib/devise/rails/routes.rb:242:in `devise_for'
        from /Users/jerome/c/tmp/myapp/config/routes.rb:2:in `block in <main>'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/actionpack/lib/action_dispatch/routing/route_set.rb:479:in `instance_exec'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/actionpack/lib/action_dispatch/routing/route_set.rb:479:in `eval_block'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/actionpack/lib/action_dispatch/routing/route_set.rb:461:in `draw'
        from /Users/jerome/c/tmp/myapp/config/routes.rb:1:in `<main>'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/railties/lib/rails/application/routes_reloader.rb:60:in `load'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/railties/lib/rails/application/routes_reloader.rb:60:in `block in load_paths'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/railties/lib/rails/application/routes_reloader.rb:60:in `each'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/railties/lib/rails/application/routes_reloader.rb:60:in `load_paths'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/railties/lib/rails/application/routes_reloader.rb:26:in `reload!'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/railties/lib/rails/application.rb:161:in `reload_routes!'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/devise-4.9.4/lib/devise/rails.rb:17:in `block in <class:Engine>'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/activesupport/lib/active_support/lazy_load_hooks.rb:94:in `block in execute_hook'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/activesupport/lib/active_support/lazy_load_hooks.rb:87:in `with_execution_control'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/activesupport/lib/active_support/lazy_load_hooks.rb:92:in `execute_hook'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/activesupport/lib/active_support/lazy_load_hooks.rb:78:in `block in run_load_hooks'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/activesupport/lib/active_support/lazy_load_hooks.rb:77:in `each'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/activesupport/lib/active_support/lazy_load_hooks.rb:77:in `run_load_hooks'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/railties/lib/rails/application/finisher.rb:79:in `block in <module:Finisher>'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/railties/lib/rails/initializable.rb:32:in `instance_exec'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/railties/lib/rails/initializable.rb:32:in `run'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/railties/lib/rails/initializable.rb:61:in `block in run_initializers'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/3.3.0/tsort.rb:231:in `block in tsort_each'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/3.3.0/tsort.rb:353:in `block (2 levels) in each_strongly_connected_component'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/3.3.0/tsort.rb:434:in `each_strongly_connected_component_from'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/3.3.0/tsort.rb:352:in `block in each_strongly_connected_component'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/3.3.0/tsort.rb:350:in `each'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/3.3.0/tsort.rb:350:in `call'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/3.3.0/tsort.rb:350:in `each_strongly_connected_component'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/3.3.0/tsort.rb:229:in `tsort_each'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/3.3.0/tsort.rb:208:in `tsort_each'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/railties/lib/rails/initializable.rb:60:in `run_initializers'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/railties/lib/rails/application.rb:440:in `initialize!'
        from /Users/jerome/c/tmp/myapp/config/environment.rb:5:in `<main>'
        from config.ru:3:in `require_relative'
        from config.ru:3:in `block (2 levels) in <main>'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/rack-3.1.7/lib/rack/builder.rb:108:in `eval'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/rack-3.1.7/lib/rack/builder.rb:108:in `new_from_string'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/rack-3.1.7/lib/rack/builder.rb:97:in `load_file'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/rack-3.1.7/lib/rack/builder.rb:67:in `parse_file'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/rackup-2.1.0/lib/rackup/server.rb:354:in `build_app_and_options_from_config'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/rackup-2.1.0/lib/rackup/server.rb:263:in `app'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/rackup-2.1.0/lib/rackup/server.rb:424:in `wrapped_app'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/rackup-2.1.0/lib/rackup/server.rb:326:in `block in start'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/rackup-2.1.0/lib/rackup/server.rb:382:in `handle_profiling'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/rackup-2.1.0/lib/rackup/server.rb:325:in `start'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/railties/lib/rails/commands/server/server_command.rb:38:in `start'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/railties/lib/rails/commands/server/server_command.rb:145:in `block in perform'
        from <internal:kernel>:90:in `tap'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/railties/lib/rails/commands/server/server_command.rb:136:in `perform'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/thor-1.3.1/lib/thor/command.rb:28:in `run'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/thor-1.3.1/lib/thor/invocation.rb:127:in `invoke_command'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/railties/lib/rails/command/base.rb:178:in `invoke_command'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/thor-1.3.1/lib/thor.rb:527:in `dispatch'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/railties/lib/rails/command/base.rb:73:in `perform'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/railties/lib/rails/command.rb:71:in `block in invoke'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/railties/lib/rails/command.rb:149:in `with_argv'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/railties/lib/rails/command.rb:69:in `invoke'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-b26a9fd2551a/railties/lib/rails/commands.rb:18:in `<main>'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
        from /Users/jerome/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/bootsnap-1.18.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        from bin/rails:4:in `<main>'

Expected behavior

Rails server should boot successfully:

$ RAILS_ENV=production rails server
=> Booting Puma
=> Rails 8.0.0.alpha application starting in production
=> Run `bin/rails server --help` for more startup options
Puma starting in single mode...
* Puma version: 6.4.2 (ruby 3.3.2-p78) ("The Eagle of Durango")
*  Min threads: 3
*  Max threads: 3
*  Environment: production
*          PID: 98281
* Listening on http://0.0.0.0:3000
Use Ctrl-C to stop
jeromedalbert commented 3 months ago

Fixed by https://github.com/heartcombo/devise/pull/5706.