-
Notifications
You must be signed in to change notification settings - Fork 140
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
Intermittant "uninitialized constant RunCaseJob" error when triggering job #474
Comments
Same happening with me, I have an OTPMailer that SolidQueue says method not found, and another Job that says uninitialized constant. |
It seems to happen when I directly use |
Hey @epugh, thanks for the link to the app and the PR. That's very strange! I wonder if, given that this branch hasn't been merged yet, is possible you're enqueuing that job and it's being picked up by a worker that doesn't have that branch's code? @Kaakati, could you provide more details about the errors you're getting? With backtraces if possible, and the lines of code that might be relevant. |
Hmm, I am seeing this too in a new Rails 8 app. This works in dev but gives a name error in staging/production. Similar to @epugh this works for The error in solid queue is: {
"exception_class": "NameError",
"message": "uninitialized constant MyJob",
"backtrace": [
"/usr/local/bundle/ruby/3.3.0/gems/activesupport-8.0.0/lib/active_support/inflector/methods.rb:290:in `constantize'",
"/usr/local/bundle/ruby/3.3.0/gems/activesupport-8.0.0/lib/active_support/core_ext/string/inflections.rb:74:in `constantize'",
"/usr/local/bundle/ruby/3.3.0/gems/activejob-8.0.0/lib/active_job/core.rb:63:in `deserialize'",
"/usr/local/bundle/ruby/3.3.0/gems/activejob-8.0.0/lib/active_job/execution.rb:28:in `block in execute'",
"/usr/local/bundle/ruby/3.3.0/gems/activesupport-8.0.0/lib/active_support/callbacks.rb:120:in `block in run_callbacks'",
"/usr/local/bundle/ruby/3.3.0/gems/activejob-8.0.0/lib/active_job/railtie.rb:95:in `block (4 levels) in <class:Railtie>'",
"/usr/local/bundle/ruby/3.3.0/gems/activesupport-8.0.0/lib/active_support/reloader.rb:77:in `block in wrap'",
"/usr/local/bundle/ruby/3.3.0/gems/activesupport-8.0.0/lib/active_support/execution_wrapper.rb:87:in `wrap'",
"/usr/local/bundle/ruby/3.3.0/gems/activesupport-8.0.0/lib/active_support/reloader.rb:74:in `wrap'",
"/usr/local/bundle/ruby/3.3.0/gems/activejob-8.0.0/lib/active_job/railtie.rb:94:in `block (3 levels) in <class:Railtie>'",
"/usr/local/bundle/ruby/3.3.0/gems/activesupport-8.0.0/lib/active_support/callbacks.rb:129:in `instance_exec'",
"/usr/local/bundle/ruby/3.3.0/gems/activesupport-8.0.0/lib/active_support/callbacks.rb:129:in `block in run_callbacks'",
"/usr/local/bundle/ruby/3.3.0/gems/activesupport-8.0.0/lib/active_support/callbacks.rb:140:in `run_callbacks'",
"/usr/local/bundle/ruby/3.3.0/gems/activejob-8.0.0/lib/active_job/execution.rb:27:in `execute'",
"/usr/local/bundle/ruby/3.3.0/gems/solid_queue-1.1.0/app/models/solid_queue/claimed_execution.rb:95:in `execute'",
"/usr/local/bundle/ruby/3.3.0/gems/solid_queue-1.1.0/app/models/solid_queue/claimed_execution.rb:61:in `perform'",
"/usr/local/bundle/ruby/3.3.0/gems/solid_queue-1.1.0/lib/solid_queue/pool.rb:23:in `block (2 levels) in post'",
"/usr/local/bundle/ruby/3.3.0/gems/activesupport-8.0.0/lib/active_support/execution_wrapper.rb:91:in `wrap'",
"/usr/local/bundle/ruby/3.3.0/gems/solid_queue-1.1.0/lib/solid_queue/app_executor.rb:7:in `wrap_in_app_executor'",
"/usr/local/bundle/ruby/3.3.0/gems/solid_queue-1.1.0/lib/solid_queue/pool.rb:22:in `block in post'",
"/usr/local/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.4/lib/concurrent-ruby/concurrent/executor/safe_task_executor.rb:24:in `block in execute'",
"/usr/local/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.4/lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:48:in `block in synchronize'",
"/usr/local/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.4/lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:48:in `synchronize'",
"/usr/local/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.4/lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:48:in `synchronize'",
"/usr/local/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.4/lib/concurrent-ruby/concurrent/executor/safe_task_executor.rb:22:in `execute'",
"/usr/local/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.4/lib/concurrent-ruby/concurrent/ivar.rb:170:in `safe_execute'",
"/usr/local/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.4/lib/concurrent-ruby/concurrent/future.rb:55:in `block in execute'",
"/usr/local/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.4/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:359:in `run_task'",
"/usr/local/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.4/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:350:in `block (3 levels) in create_worker'",
"<internal:kernel>:187:in `loop'",
"/usr/local/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.4/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:341:in `block (2 levels) in create_worker'",
"/usr/local/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.4/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:340:in `catch'",
"/usr/local/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.4/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:340:in `block in create_worker'"
]
} I am also sometimes getting an error from a recurring job: {
"exception_class": "NameError",
"message": "uninitialized constant SolidQueue::RecurringJob::Legacy",
"backtrace": [
"(eval at /usr/local/bundle/ruby/3.3.0/gems/solid_queue-1.1.0/app/jobs/solid_queue/recurring_job.rb:7):1:in `perform'",
"/usr/local/bundle/ruby/3.3.0/gems/solid_queue-1.1.0/app/jobs/solid_queue/recurring_job.rb:7:in `eval'",
"/usr/local/bundle/ruby/3.3.0/gems/solid_queue-1.1.0/app/jobs/solid_queue/recurring_job.rb:7:in `perform'",
"/usr/local/bundle/ruby/3.3.0/gems/activejob-8.0.0/lib/active_job/execution.rb:68:in `block in _perform_job'",
"/usr/local/bundle/ruby/3.3.0/gems/activesupport-8.0.0/lib/active_support/callbacks.rb:120:in `block in run_callbacks'",
"/usr/local/bundle/ruby/3.3.0/gems/i18n-1.14.6/lib/i18n.rb:353:in `with_locale'",
"/usr/local/bundle/ruby/3.3.0/gems/activejob-8.0.0/lib/active_job/translation.rb:9:in `block (2 levels) in <module:Translation>'",
"/usr/local/bundle/ruby/3.3.0/gems/activesupport-8.0.0/lib/active_support/callbacks.rb:129:in `instance_exec'",
"/usr/local/bundle/ruby/3.3.0/gems/activesupport-8.0.0/lib/active_support/callbacks.rb:129:in `block in run_callbacks'",
"/usr/local/bundle/ruby/3.3.0/gems/activesupport-8.0.0/lib/active_support/core_ext/time/zones.rb:65:in `use_zone'",
"/usr/local/bundle/ruby/3.3.0/gems/activejob-8.0.0/lib/active_job/timezones.rb:9:in `block (2 levels) in <module:Timezones>'",
"/usr/local/bundle/ruby/3.3.0/gems/activesupport-8.0.0/lib/active_support/callbacks.rb:129:in `instance_exec'",
"/usr/local/bundle/ruby/3.3.0/gems/activesupport-8.0.0/lib/active_support/callbacks.rb:129:in `block in run_callbacks'",
"/usr/local/bundle/ruby/3.3.0/gems/activesupport-8.0.0/lib/active_support/callbacks.rb:140:in `run_callbacks'",
"/usr/local/bundle/ruby/3.3.0/gems/activejob-8.0.0/lib/active_job/execution.rb:67:in `_perform_job'",
"/usr/local/bundle/ruby/3.3.0/gems/activejob-8.0.0/lib/active_job/instrumentation.rb:32:in `_perform_job'",
"/usr/local/bundle/ruby/3.3.0/gems/activejob-8.0.0/lib/active_job/execution.rb:51:in `perform_now'",
"/usr/local/bundle/ruby/3.3.0/gems/activejob-8.0.0/lib/active_job/instrumentation.rb:26:in `block in perform_now'",
"/usr/local/bundle/ruby/3.3.0/gems/activerecord-8.0.0/lib/active_record/railties/job_runtime.rb:13:in `block in instrument'",
"/usr/local/bundle/ruby/3.3.0/gems/activejob-8.0.0/lib/active_job/instrumentation.rb:40:in `block in instrument'",
"/usr/local/bundle/ruby/3.3.0/gems/activesupport-8.0.0/lib/active_support/notifications.rb:210:in `block in instrument'",
"/usr/local/bundle/ruby/3.3.0/gems/activesupport-8.0.0/lib/active_support/notifications/instrumenter.rb:58:in `instrument'",
"/usr/local/bundle/ruby/3.3.0/gems/activesupport-8.0.0/lib/active_support/notifications.rb:210:in `instrument'",
"/usr/local/bundle/ruby/3.3.0/gems/activejob-8.0.0/lib/active_job/instrumentation.rb:39:in `instrument'",
"/usr/local/bundle/ruby/3.3.0/gems/activerecord-8.0.0/lib/active_record/railties/job_runtime.rb:11:in `instrument'",
"/usr/local/bundle/ruby/3.3.0/gems/activejob-8.0.0/lib/active_job/instrumentation.rb:26:in `perform_now'",
"/usr/local/bundle/ruby/3.3.0/gems/activejob-8.0.0/lib/active_job/logging.rb:32:in `block in perform_now'",
"/usr/local/bundle/ruby/3.3.0/gems/activesupport-8.0.0/lib/active_support/tagged_logging.rb:143:in `block in tagged'",
"/usr/local/bundle/ruby/3.3.0/gems/activesupport-8.0.0/lib/active_support/tagged_logging.rb:38:in `tagged'",
"/usr/local/bundle/ruby/3.3.0/gems/activesupport-8.0.0/lib/active_support/tagged_logging.rb:143:in `tagged'",
"/usr/local/bundle/ruby/3.3.0/gems/activesupport-8.0.0/lib/active_support/broadcast_logger.rb:241:in `method_missing'",
"/usr/local/bundle/ruby/3.3.0/gems/activejob-8.0.0/lib/active_job/logging.rb:39:in `tag_logger'",
"/usr/local/bundle/ruby/3.3.0/gems/activejob-8.0.0/lib/active_job/logging.rb:32:in `perform_now'",
"/usr/local/bundle/ruby/3.3.0/gems/activejob-8.0.0/lib/active_job/execution.rb:29:in `block in execute'",
"/usr/local/bundle/ruby/3.3.0/gems/activesupport-8.0.0/lib/active_support/callbacks.rb:120:in `block in run_callbacks'",
"/usr/local/bundle/ruby/3.3.0/gems/activejob-8.0.0/lib/active_job/railtie.rb:95:in `block (4 levels) in <class:Railtie>'",
"/usr/local/bundle/ruby/3.3.0/gems/activesupport-8.0.0/lib/active_support/reloader.rb:77:in `block in wrap'",
"/usr/local/bundle/ruby/3.3.0/gems/activesupport-8.0.0/lib/active_support/execution_wrapper.rb:87:in `wrap'",
"/usr/local/bundle/ruby/3.3.0/gems/activesupport-8.0.0/lib/active_support/reloader.rb:74:in `wrap'",
"/usr/local/bundle/ruby/3.3.0/gems/activejob-8.0.0/lib/active_job/railtie.rb:94:in `block (3 levels) in <class:Railtie>'",
"/usr/local/bundle/ruby/3.3.0/gems/activesupport-8.0.0/lib/active_support/callbacks.rb:129:in `instance_exec'",
"/usr/local/bundle/ruby/3.3.0/gems/activesupport-8.0.0/lib/active_support/callbacks.rb:129:in `block in run_callbacks'",
"/usr/local/bundle/ruby/3.3.0/gems/activesupport-8.0.0/lib/active_support/callbacks.rb:140:in `run_callbacks'",
"/usr/local/bundle/ruby/3.3.0/gems/activejob-8.0.0/lib/active_job/execution.rb:27:in `execute'",
"/usr/local/bundle/ruby/3.3.0/gems/solid_queue-1.1.0/app/models/solid_queue/claimed_execution.rb:95:in `execute'",
"/usr/local/bundle/ruby/3.3.0/gems/solid_queue-1.1.0/app/models/solid_queue/claimed_execution.rb:61:in `perform'",
"/usr/local/bundle/ruby/3.3.0/gems/solid_queue-1.1.0/lib/solid_queue/pool.rb:23:in `block (2 levels) in post'",
"/usr/local/bundle/ruby/3.3.0/gems/activesupport-8.0.0/lib/active_support/execution_wrapper.rb:91:in `wrap'",
"/usr/local/bundle/ruby/3.3.0/gems/solid_queue-1.1.0/lib/solid_queue/app_executor.rb:7:in `wrap_in_app_executor'",
"/usr/local/bundle/ruby/3.3.0/gems/solid_queue-1.1.0/lib/solid_queue/pool.rb:22:in `block in post'",
"/usr/local/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.4/lib/concurrent-ruby/concurrent/executor/safe_task_executor.rb:24:in `block in execute'",
"/usr/local/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.4/lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:48:in `block in synchronize'",
"/usr/local/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.4/lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:48:in `synchronize'",
"/usr/local/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.4/lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:48:in `synchronize'",
"/usr/local/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.4/lib/concurrent-ruby/concurrent/executor/safe_task_executor.rb:22:in `execute'",
"/usr/local/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.4/lib/concurrent-ruby/concurrent/ivar.rb:170:in `safe_execute'",
"/usr/local/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.4/lib/concurrent-ruby/concurrent/future.rb:55:in `block in execute'",
"/usr/local/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.4/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:359:in `run_task'",
"/usr/local/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.4/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:350:in `block (3 levels) in create_worker'",
"<internal:kernel>:187:in `loop'",
"/usr/local/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.4/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:341:in `block (2 levels) in create_worker'",
"/usr/local/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.4/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:340:in `catch'",
"/usr/local/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.4/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:340:in `block in create_worker'"
]
} |
@jbennett, does it happen consistently in staging/production for |
This looks to be happening consistently. The job file is located at The recurring job is: production:
daily_sync:
command: Legacy.import_all
schedule: every day at 3am I did try changing the command to |
Huh, that's so odd! How are you deploying the code to production and how are you starting solid queue? |
This is a staging server but it's running with a production environment/configuration being deploy via Kamal. It using using a single server setup with the solid queue in puma plugin with the environment variable for that turned on. |
Oh, interesting! @jbennett, can you reproduce this if you run Solid Queue via |
Periodically I get this error:
Here is the raw data:
If I retry the job (using mission control) it will give the same error. However, if I resubmit a new RunCaseJob with the same arguments, then that second one runs.
If you are curious, the PR that adds solid_queue to my open source app is here: o19s/quepid#1039
Thanks for any ideas!
The text was updated successfully, but these errors were encountered: