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

Allowing enqueing of recurring task right away doesn't work if misson control is on a separate rails instance #200

Closed
salmonsteak1 opened this issue Nov 9, 2024 · 3 comments · Fixed by #202

Comments

@salmonsteak1
Copy link

Clicking on "Run now" for scheduled tasks can't work if we're running Mission Control on a separate instance that does not contain the main codebase. Seems like it's because Mission Control is calling the queue adapter's enqueue method. It then eventually hits this line of code:

job_class.queue_adapter_name.inquiry.solid_queue?

But since the job class isn't defined on this separate instance, an exception is thrown. Here's the full stack trace:

solid_queue (1.0.1) app/models/solid_queue/recurring_task.rb:110:in `using_solid_queue_adapter?'
solid_queue (1.0.1) app/models/solid_queue/recurring_task.rb:58:in `block in enqueue'
activesupport (7.1.3.4) lib/active_support/notifications.rb:206:in `block in instrument'
activesupport (7.1.3.4) lib/active_support/notifications/instrumenter.rb:58:in `instrument'
activesupport (7.1.3.4) lib/active_support/notifications.rb:206:in `instrument'
solid_queue (1.0.1) lib/solid_queue.rb:67:in `instrument'
solid_queue (1.0.1) app/models/solid_queue/recurring_task.rb:57:in `enqueue'
mission_control-jobs (0.5.0) lib/active_job/queue_adapters/solid_queue_ext/recurring_tasks.rb:25:in `enqueue_recurring_task'
mission_control-jobs (0.5.0) app/models/mission_control/jobs/recurring_task.rb:16:in `enqueue'
mission_control-jobs (0.5.0) app/controllers/mission_control/jobs/recurring_tasks_controller.rb:14:in `update'
actionpack (7.1.3.4) lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
actionpack (7.1.3.4) lib/abstract_controller/base.rb:224:in `process_action'
actionpack (7.1.3.4) lib/action_controller/metal/rendering.rb:165:in `process_action'
actionpack (7.1.3.4) lib/abstract_controller/callbacks.rb:259:in `block in process_action'
activesupport (7.1.3.4) lib/active_support/callbacks.rb:121:in `block in run_callbacks'
mission_control-jobs (0.5.0) lib/mission_control/jobs/adapter.rb:3:in `activating'
mission_control-jobs (0.5.0) lib/mission_control/jobs/server.rb:19:in `activating'
mission_control-jobs (0.5.0) app/controllers/concerns/mission_control/jobs/application_scoped.rb:28:in `activating_job_server'
activesupport (7.1.3.4) lib/active_support/callbacks.rb:130:in `block in run_callbacks'
turbo-rails (2.0.11) lib/turbo-rails.rb:24:in `with_request_id'
turbo-rails (2.0.11) app/controllers/concerns/turbo/request_id_tracking.rb:10:in `turbo_tracking_request_id'
activesupport (7.1.3.4) lib/active_support/callbacks.rb:130:in `block in run_callbacks'
actiontext (7.1.3.4) lib/action_text/rendering.rb:23:in `with_renderer'
actiontext (7.1.3.4) lib/action_text/engine.rb:69:in `block (4 levels) in <class:Engine>'
activesupport (7.1.3.4) lib/active_support/callbacks.rb:130:in `instance_exec'
activesupport (7.1.3.4) lib/active_support/callbacks.rb:130:in `block in run_callbacks'
activesupport (7.1.3.4) lib/active_support/callbacks.rb:141:in `run_callbacks'
actionpack (7.1.3.4) lib/abstract_controller/callbacks.rb:258:in `process_action'
actionpack (7.1.3.4) lib/action_controller/metal/rescue.rb:25:in `process_action'
actionpack (7.1.3.4) lib/action_controller/metal/instrumentation.rb:74:in `block in process_action'
activesupport (7.1.3.4) lib/active_support/notifications.rb:206:in `block in instrument'
activesupport (7.1.3.4) lib/active_support/notifications/instrumenter.rb:58:in `instrument'
activesupport (7.1.3.4) lib/active_support/notifications.rb:206:in `instrument'
actionpack (7.1.3.4) lib/action_controller/metal/instrumentation.rb:73:in `process_action'
actionpack (7.1.3.4) lib/action_controller/metal/params_wrapper.rb:261:in `process_action'
activerecord (7.1.3.4) lib/active_record/railties/controller_runtime.rb:32:in `process_action'
actionpack (7.1.3.4) lib/abstract_controller/base.rb:160:in `process'
actionview (7.1.3.4) lib/action_view/rendering.rb:40:in `process'
actionpack (7.1.3.4) lib/action_controller/metal.rb:227:in `dispatch'
actionpack (7.1.3.4) lib/action_controller/metal.rb:309:in `dispatch'
actionpack (7.1.3.4) lib/action_dispatch/routing/route_set.rb:49:in `dispatch'
actionpack (7.1.3.4) lib/action_dispatch/routing/route_set.rb:32:in `serve'
actionpack (7.1.3.4) lib/action_dispatch/journey/router.rb:51:in `block in serve'
actionpack (7.1.3.4) lib/action_dispatch/journey/router.rb:131:in `block in find_routes'
actionpack (7.1.3.4) lib/action_dispatch/journey/router.rb:124:in `each'
actionpack (7.1.3.4) lib/action_dispatch/journey/router.rb:124:in `find_routes'
actionpack (7.1.3.4) lib/action_dispatch/journey/router.rb:32:in `serve'
actionpack (7.1.3.4) lib/action_dispatch/routing/route_set.rb:882:in `call'
railties (7.1.3.4) lib/rails/engine.rb:536:in `call'
railties (7.1.3.4) lib/rails/railtie.rb:226:in `public_send'
railties (7.1.3.4) lib/rails/railtie.rb:226:in `method_missing'
actionpack (7.1.3.4) lib/action_dispatch/routing/mapper.rb:22:in `block in <class:Constraints>'
actionpack (7.1.3.4) lib/action_dispatch/routing/mapper.rb:51:in `serve'
actionpack (7.1.3.4) lib/action_dispatch/journey/router.rb:51:in `block in serve'
actionpack (7.1.3.4) lib/action_dispatch/journey/router.rb:131:in `block in find_routes'
actionpack (7.1.3.4) lib/action_dispatch/journey/router.rb:124:in `each'
actionpack (7.1.3.4) lib/action_dispatch/journey/router.rb:124:in `find_routes'
actionpack (7.1.3.4) lib/action_dispatch/journey/router.rb:32:in `serve'
actionpack (7.1.3.4) lib/action_dispatch/routing/route_set.rb:882:in `call'
rack (3.1.8) lib/rack/tempfile_reaper.rb:20:in `call'
rack (3.1.8) lib/rack/etag.rb:29:in `call'
rack (3.1.8) lib/rack/conditional_get.rb:43:in `call'
rack (3.1.8) lib/rack/head.rb:15:in `call'
actionpack (7.1.3.4) lib/action_dispatch/http/permissions_policy.rb:36:in `call'
actionpack (7.1.3.4) lib/action_dispatch/http/content_security_policy.rb:33:in `call'
rack-session (2.0.0) lib/rack/session/abstract/id.rb:272:in `context'
rack-session (2.0.0) lib/rack/session/abstract/id.rb:266:in `call'
actionpack (7.1.3.4) lib/action_dispatch/middleware/cookies.rb:689:in `call'
activerecord (7.1.3.4) lib/active_record/migration.rb:655:in `call'
actionpack (7.1.3.4) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (7.1.3.4) lib/active_support/callbacks.rb:101:in `run_callbacks'
actionpack (7.1.3.4) lib/action_dispatch/middleware/callbacks.rb:28:in `call'
actionpack (7.1.3.4) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (7.1.3.4) lib/action_dispatch/middleware/actionable_exceptions.rb:16:in `call'
actionpack (7.1.3.4) lib/action_dispatch/middleware/debug_exceptions.rb:29:in `call'
web-console (4.2.1) lib/web_console/middleware.rb:132:in `call_app'
web-console (4.2.1) lib/web_console/middleware.rb:19:in `block in call'
web-console (4.2.1) lib/web_console/middleware.rb:17:in `catch'
web-console (4.2.1) lib/web_console/middleware.rb:17:in `call'
actionpack (7.1.3.4) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
railties (7.1.3.4) lib/rails/rack/logger.rb:37:in `call_app'
railties (7.1.3.4) lib/rails/rack/logger.rb:24:in `block in call'
activesupport (7.1.3.4) lib/active_support/tagged_logging.rb:135:in `block in tagged'
activesupport (7.1.3.4) lib/active_support/tagged_logging.rb:39:in `tagged'
activesupport (7.1.3.4) lib/active_support/tagged_logging.rb:135:in `tagged'
activesupport (7.1.3.4) lib/active_support/broadcast_logger.rb:240:in `method_missing'
railties (7.1.3.4) lib/rails/rack/logger.rb:24:in `call'
sprockets-rails (3.5.2) lib/sprockets/rails/quiet_assets.rb:17:in `call'
actionpack (7.1.3.4) lib/action_dispatch/middleware/remote_ip.rb:92:in `call'
actionpack (7.1.3.4) lib/action_dispatch/middleware/request_id.rb:28:in `call'
rack (3.1.8) lib/rack/method_override.rb:28:in `call'
rack (3.1.8) lib/rack/runtime.rb:24:in `call'
activesupport (7.1.3.4) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
actionpack (7.1.3.4) lib/action_dispatch/middleware/server_timing.rb:59:in `block in call'
actionpack (7.1.3.4) lib/action_dispatch/middleware/server_timing.rb:24:in `collect_events'
actionpack (7.1.3.4) lib/action_dispatch/middleware/server_timing.rb:58:in `call'
actionpack (7.1.3.4) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (7.1.3.4) lib/action_dispatch/middleware/static.rb:25:in `call'
rack (3.1.8) lib/rack/sendfile.rb:114:in `call'
actionpack (7.1.3.4) lib/action_dispatch/middleware/host_authorization.rb:141:in `call'
railties (7.1.3.4) lib/rails/engine.rb:536:in `call'
puma (6.4.3) lib/puma/configuration.rb:272:in `call'
puma (6.4.3) lib/puma/request.rb:100:in `block in handle_request'
puma (6.4.3) lib/puma/thread_pool.rb:378:in `with_force_shutdown'
puma (6.4.3) lib/puma/request.rb:99:in `handle_request'
puma (6.4.3) lib/puma/server.rb:464:in `process_client'
puma (6.4.3) lib/puma/server.rb:245:in `block in run'
puma (6.4.3) lib/puma/thread_pool.rb:155:in `block in spawn_thread' 
@rosa
Copy link
Member

rosa commented Nov 9, 2024

Ah, yes, this is a limitation of the current implementation. I'll make it so that the option to Run now is hidden in this case.

@salmonsteak1
Copy link
Author

I see, thanks for all the work done on Solid Queue and Mission Control @rosa !

rosa added a commit that referenced this issue Nov 10, 2024
For example, if running Mission Control from another app than the one
where the recurring task classes are defined.

Fixes #200
@rosa
Copy link
Member

rosa commented Nov 10, 2024

Improved here: #202

rosa added a commit that referenced this issue Nov 10, 2024
For example, if running Mission Control from another app than the one
where the recurring task classes are defined.

Fixes #200
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

Successfully merging a pull request may close this issue.

2 participants