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

NameError: uninitialized constant ActiveJob::QueueAdapters::ShoryukenConcurrentSendAdapter #641

Closed
mbykovskyy opened this issue Dec 23, 2020 · 5 comments · Fixed by #642
Closed
Assignees
Labels

Comments

@mbykovskyy
Copy link

mbykovskyy commented Dec 23, 2020

bundle exec shoryuken -R fails to start when:

# config/application.rb
config.active_job.queue_adapter = :shoryuken_concurrent_send

Stacktrace:

NameError: uninitialized constant ActiveJob::QueueAdapters::ShoryukenConcurrentSendAdapter                                                                                              
/usr/local/bundle/gems/activejob-6.0.3.3/lib/active_job/queue_adapters.rb:133:in `const_get'                                                                                          
/usr/local/bundle/gems/activejob-6.0.3.3/lib/active_job/queue_adapters.rb:133 :in `lookup'                                                                                             
/usr/local/bundle/gems/activejob-6.0.3.3/lib/active_job/queue_adapter.rb:37:in `queue_adapter='                                                                                       
/usr/local/bundle/gems/activejob-6.0.3.3/lib/active_job/railtie.rb:30:in `block (3 levels) in <class:Railtie>'                                                                        
/usr/local/bundle/gems/activejob-6.0.3.3/lib/active_job/railtie.rb:28:in `each'                                                                                                       
/usr/local/bundle/gems/activejob-6.0.3.3/lib/active_job/railtie.rb:28:in `block (2 levels) in <class:Railtie>'                                                                        
/usr/local/bundle/gems/activesupport-6.0.3.3/lib/active_support/lazy_load_hooks.rb:71:in `class_eval'                                                                                 
/usr/local/bundle/gems/activesupport-6.0.3.3/lib/active_support/lazy_load_hooks.rb:71:in `block in execute_hook'                                                                      
/usr/local/bundle/gems/activesupport-6.0.3.3/lib/active_support/lazy_load_hooks.rb:61:in `with_execution_control'
/usr/local/bundle/gems/activesupport-6.0.3.3/lib/active_support/lazy_load_hooks.rb:66:in `execute_hook' 
/usr/local/bundle/gems/activesupport-6.0.3.3/lib/active_support/lazy_load_hooks.rb:52:in `block in run_load_hooks'
/usr/local/bundle/gems/activesupport-6.0.3.3/lib/active_support/lazy_load_hooks.rb:51:in `each'
/usr/local/bundle/gems/activesupport-6.0.3.3/lib/active_support/lazy_load_hooks.rb:51:in `run_load_hooks'
/usr/local/bundle/gems/activejob-6.0.3.3/lib/active_job/base.rb:74:in `<class:Base>'
/usr/local/bundle/gems/activejob-6.0.3.3/lib/active_job/base.rb:61:in `<module:ActiveJob>'
/usr/local/bundle/gems/activejob-6.0.3.3/lib/active_job/base.rb:15:in `<top (required)>'
/usr/local/bundle/gems/zeitwerk-2.4.0/lib/zeitwerk/kernel.rb:34:in `require'
/usr/local/bundle/gems/zeitwerk-2.4.0/lib/zeitwerk/kernel.rb:34:in `require'
/app/demo/app/jobs/application_job.rb:4:in `<top (required)>
/app/demo/config/initializers/resque.rb:8:in `<top (required)>'
/usr/local/bundle/gems/railties-6.0.3.3/lib/rails/engine.rb:666:in `block in load_config_initializer'
/usr/local/bundle/gems/activesupport-6.0.3.3/lib/active_support/notifications.rb:182:in `instrument'
/usr/local/bundle/gems/railties-6.0.3.3/lib/rails/engine.rb:665:in `load_config_initializer'
/usr/local/bundle/gems/railties-6.0.3.3/lib/rails/engine.rb:625:in `block (2 levels) in <class:Engine>'
/usr/local/bundle/gems/railties-6.0.3.3/lib/rails/engine.rb:624:in `each'
/usr/local/bundle/gems/railties-6.0.3.3/lib/rails/engine.rb:624:in `block in <class:Engine>'
/usr/local/bundle/gems/railties-6.0.3.3/lib/rails/initializable.rb:32:in `instance_exec'
/usr/local/bundle/gems/railties-6.0.3.3/lib/rails/initializable.rb:32:in `run'
/usr/local/bundle/gems/railties-6.0.3.3/lib/rails/initializable.rb:61:in `block in run_initializers'                                                                                  
/usr/local/lib/ruby/2.7.0/tsort.rb:228:in `block in tsort_each'
/usr/local/lib/ruby/2.7.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
/usr/local/lib/ruby/2.7.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
/usr/local/lib/ruby/2.7.0/tsort.rb:431:in `each_strongly_connected_component_from'
/usr/local/lib/ruby/2.7.0/tsort.rb:421:in `block in each_strongly_connected_component_from'
/usr/local/bundle/gems/railties-6.0.3.3/lib/rails/initializable.rb:50:in `each'
/usr/local/bundle/gems/railties-6.0.3.3/lib/rails/initializable.rb:50:in `tsort_each_child'
/usr/local/lib/ruby/2.7.0/tsort.rb:415:in `call'
/usr/local/lib/ruby/2.7.0/tsort.rb:415:in `each_strongly_connected_component_from'
/usr/local/lib/ruby/2.7.0/tsort.rb:349:in `block in each_strongly_connected_component'
/usr/local/lib/ruby/2.7.0/tsort.rb:347:in `each'
/usr/local/lib/ruby/2.7.0/tsort.rb:347:in `call'
/usr/local/lib/ruby/2.7.0/tsort.rb:347:in `each_strongly_connected_component'
/usr/local/lib/ruby/2.7.0/tsort.rb:226:in `tsort_each'
/usr/local/lib/ruby/2.7.0/tsort.rb:205:in `tsort_each'
/usr/local/bundle/gems/railties-6.0.3.3/lib/rails/initializable.rb:60:in `run_initializers'
/usr/local/bundle/gems/railties-6.0.3.3/lib/rails/application.rb:363:in `initialize!'
/app/demo/config/environment.rb:7:in `<top (required)>'
/usr/local/bundle/gems/zeitwerk-2.4.0/lib/zeitwerk/kernel.rb:34:in `require'
/usr/local/bundle/gems/zeitwerk-2.4.0/lib/zeitwerk/kernel.rb:34:in `require'
/usr/local/bundle/gems/shoryuken-5.0.5/lib/shoryuken/environment_loader.rb:74:in `load_rails'
/usr/local/bundle/gems/shoryuken-5.0.5/lib/shoryuken/environment_loader.rb:26:in `load'
/usr/local/bundle/gems/shoryuken-5.0.5/lib/shoryuken/runner.rb:39:in `run'
/usr/local/bundle/gems/shoryuken-5.0.5/bin/shoryuken:42:in `start'
/usr/local/bundle/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
/usr/local/bundle/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
/usr/local/bundle/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
/usr/local/bundle/gems/thor-1.0.1/lib/thor/base.rb:485:in `start'
/usr/local/bundle/gems/shoryuken-5.0.5/bin/shoryuken:53:in `<top (required)>'
/usr/local/bundle/bin/shoryuken:23:in `load'
/usr/local/bundle/bin/shoryuken:23:in `<top (required)>'

Same behaviour when:

# config/application.rb
config.active_job.queue_adapter = ActiveJob::QueueAdapters::ShoryukenConcurrentSendAdapter.new

📌 #642

@cjlarose cjlarose self-assigned this Dec 24, 2020
@cjlarose
Copy link
Contributor

I'm not able to reproduce this problem using a new Rails app generated with rails _6.0.3.3_ new active_job_shoryuken_test --skip-javascript. I added shoryuken and aws-sdk-sqs to my Gemfile and added this to my config/application.rb

    config.active_job.queue_adapter = :shoryuken_concurrent_send

I'm able to start shoryuken with bundle exec shoryuken -R.

@mbykovskyy if you are able to make a minimally reproducible example repo, that would help us debug whatever's going on. Thanks!

@mbykovskyy
Copy link
Author

mbykovskyy commented Dec 24, 2020

I managed to reproduce the issue with a fresh Rails app. You can find it at https://github.com/mbykovskyy/shoryuken-641-demo. Please see the readme for prerequisites and run command.

The command and the error stacktrace are different than the original issue description, but I think the root cause would be the same.

@cjlarose
Copy link
Contributor

@mbykovskyy Thanks for putting together that repository! I'm able to reproduce the problem locally and I'm looking into a fix.

@cjlarose
Copy link
Contributor

Opened #642 to address this issue. @phstc whenever you cut the next release, we can kindly ask @mbykovskyy to make sure it works for his apps.

@phstc
Copy link
Collaborator

phstc commented Dec 30, 2020

@mbykovskyy 5.0.6 is out with @cjlarose's fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants