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

Email job breaks dashboard #313

Open
sebastiandeutsch opened this issue Jul 26, 2021 · 8 comments
Open

Email job breaks dashboard #313

sebastiandeutsch opened this issue Jul 26, 2021 · 8 comments
Labels
bug Something isn't working

Comments

@sebastiandeutsch
Copy link

Hi,

I have a simple email job and when perform it the dashboard will throw the following error while the job is queued (the job actual works):

arguments passed to url_for can't be handled. Please require routes or provide your own implementation

Showing /home/app/server/staging/shared/bundle/ruby/2.7.0/gems/good_job-1.11.3/engine/app/views/good_job/dashboards/index.html.erb where line #46 raised:

          _back_url
        else
          raise ArgumentError, "arguments passed to url_for can't be handled. Please require " \
                               "routes or provide your own implementation"
        end
      end

StackTrace:

actionview (6.0.3.2) lib/action_view/helpers/url_helper.rb:40:in `url_for'
actionview (6.0.3.2) lib/action_view/helpers/url_helper.rb:202:in `link_to'
good_job (1.11.3) engine/app/views/good_job/dashboards/index.html.erb:46
actionview (6.0.3.2) lib/action_view/base.rb:274:in `_run'
actionview (6.0.3.2) lib/action_view/template.rb:185:in `block in render'
activesupport (6.0.3.2) lib/active_support/notifications.rb:182:in `instrument'
actionview (6.0.3.2) lib/action_view/template.rb:385:in `instrument_render_template'
actionview (6.0.3.2) lib/action_view/template.rb:183:in `render'
actionview (6.0.3.2) lib/action_view/renderer/template_renderer.rb:58:in `block (2 levels) in render_template'
actionview (6.0.3.2) lib/action_view/renderer/abstract_renderer.rb:88:in `block in instrument'
activesupport (6.0.3.2) lib/active_support/notifications.rb:180:in `block in instrument'
activesupport (6.0.3.2) lib/active_support/notifications/instrumenter.rb:24:in `instrument'
activesupport (6.0.3.2) lib/active_support/notifications.rb:180:in `instrument'
actionview (6.0.3.2) lib/action_view/renderer/abstract_renderer.rb:87:in `instrument'
actionview (6.0.3.2) lib/action_view/renderer/template_renderer.rb:57:in `block in render_template'
actionview (6.0.3.2) lib/action_view/renderer/template_renderer.rb:65:in `render_with_layout'
actionview (6.0.3.2) lib/action_view/renderer/template_renderer.rb:56:in `render_template'
actionview (6.0.3.2) lib/action_view/renderer/template_renderer.rb:13:in `render'
actionview (6.0.3.2) lib/action_view/renderer/renderer.rb:61:in `render_template_to_object'
actionview (6.0.3.2) lib/action_view/renderer/renderer.rb:29:in `render_to_object'
actionview (6.0.3.2) lib/action_view/rendering.rb:117:in `block in _render_template'
actionview (6.0.3.2) lib/action_view/base.rb:304:in `in_rendering_context'
actionview (6.0.3.2) lib/action_view/rendering.rb:116:in `_render_template'
actionpack (6.0.3.2) lib/action_controller/metal/streaming.rb:218:in `_render_template'
actionview (6.0.3.2) lib/action_view/rendering.rb:103:in `render_to_body'
actionpack (6.0.3.2) lib/action_controller/metal/rendering.rb:52:in `render_to_body'
actionpack (6.0.3.2) lib/action_controller/metal/renderers.rb:142:in `render_to_body'
actionpack (6.0.3.2) lib/abstract_controller/rendering.rb:25:in `render'
actionpack (6.0.3.2) lib/action_controller/metal/rendering.rb:36:in `render'
actionpack (6.0.3.2) lib/action_controller/metal/instrumentation.rb:44:in `block (2 levels) in render'
activesupport (6.0.3.2) lib/active_support/core_ext/benchmark.rb:14:in `block in ms'
/usr/local/lib/ruby/2.7.0/benchmark.rb:308:in `realtime'
activesupport (6.0.3.2) lib/active_support/core_ext/benchmark.rb:14:in `ms'
actionpack (6.0.3.2) lib/action_controller/metal/instrumentation.rb:44:in `block in render'
actionpack (6.0.3.2) lib/action_controller/metal/instrumentation.rb:84:in `cleanup_view_runtime'
activerecord (6.0.3.2) lib/active_record/railties/controller_runtime.rb:34:in `cleanup_view_runtime'
actionpack (6.0.3.2) lib/action_controller/metal/instrumentation.rb:43:in `render'
actionpack (6.0.3.2) lib/action_controller/metal/implicit_render.rb:35:in `default_render'
actionpack (6.0.3.2) lib/action_controller/metal/basic_implicit_render.rb:6:in `block in send_action'
actionpack (6.0.3.2) lib/action_controller/metal/basic_implicit_render.rb:6:in `tap'
actionpack (6.0.3.2) lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
actionpack (6.0.3.2) lib/abstract_controller/base.rb:195:in `process_action'
actionpack (6.0.3.2) lib/action_controller/metal/rendering.rb:30:in `process_action'
actionpack (6.0.3.2) lib/abstract_controller/callbacks.rb:42:in `block in process_action'
activesupport (6.0.3.2) lib/active_support/callbacks.rb:135:in `run_callbacks'
actionpack (6.0.3.2) lib/abstract_controller/callbacks.rb:41:in `process_action'
actionpack (6.0.3.2) lib/action_controller/metal/rescue.rb:22:in `process_action'
actionpack (6.0.3.2) lib/action_controller/metal/instrumentation.rb:33:in `block in process_action'
activesupport (6.0.3.2) lib/active_support/notifications.rb:180:in `block in instrument'
activesupport (6.0.3.2) lib/active_support/notifications/instrumenter.rb:24:in `instrument'
activesupport (6.0.3.2) lib/active_support/notifications.rb:180:in `instrument'
actionpack (6.0.3.2) lib/action_controller/metal/instrumentation.rb:32:in `process_action'
actionpack (6.0.3.2) lib/action_controller/metal/params_wrapper.rb:245:in `process_action'
activerecord (6.0.3.2) lib/active_record/railties/controller_runtime.rb:27:in `process_action'
actionpack (6.0.3.2) lib/abstract_controller/base.rb:136:in `process'
actionview (6.0.3.2) lib/action_view/rendering.rb:39:in `process'
actionpack (6.0.3.2) lib/action_controller/metal.rb:190:in `dispatch'
actionpack (6.0.3.2) lib/action_controller/metal.rb:254:in `dispatch'
actionpack (6.0.3.2) lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
actionpack (6.0.3.2) lib/action_dispatch/routing/route_set.rb:33:in `serve'
actionpack (6.0.3.2) lib/action_dispatch/journey/router.rb:49:in `block in serve'
actionpack (6.0.3.2) lib/action_dispatch/journey/router.rb:32:in `each'
actionpack (6.0.3.2) lib/action_dispatch/journey/router.rb:32:in `serve'
actionpack (6.0.3.2) lib/action_dispatch/routing/route_set.rb:834:in `call'
rack (2.2.3) lib/rack/auth/basic.rb:28:in `call'
railties (6.0.3.2) lib/rails/engine.rb:527:in `call'
railties (6.0.3.2) lib/rails/railtie.rb:190:in `public_send'
railties (6.0.3.2) lib/rails/railtie.rb:190:in `method_missing'
actionpack (6.0.3.2) lib/action_dispatch/routing/mapper.rb:19:in `block in <class:Constraints>'
actionpack (6.0.3.2) lib/action_dispatch/routing/mapper.rb:48:in `serve'
actionpack (6.0.3.2) lib/action_dispatch/journey/router.rb:49:in `block in serve'
actionpack (6.0.3.2) lib/action_dispatch/journey/router.rb:32:in `each'
actionpack (6.0.3.2) lib/action_dispatch/journey/router.rb:32:in `serve'
actionpack (6.0.3.2) lib/action_dispatch/routing/route_set.rb:834:in `call'
apollo_upload_server (2.0.2) lib/apollo_upload_server/middleware.rb:20:in `call'
rack (2.2.3) lib/rack/tempfile_reaper.rb:15:in `call'
rack (2.2.3) lib/rack/etag.rb:27:in `call'
rack (2.2.3) lib/rack/conditional_get.rb:27:in `call'
rack (2.2.3) lib/rack/head.rb:12:in `call'
actionpack (6.0.3.2) lib/action_dispatch/http/content_security_policy.rb:18:in `call'
rack (2.2.3) lib/rack/session/abstract/id.rb:266:in `context'
rack (2.2.3) lib/rack/session/abstract/id.rb:260:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/cookies.rb:648:in `call'
activerecord (6.0.3.2) lib/active_record/migration.rb:567:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
activesupport (6.0.3.2) lib/active_support/callbacks.rb:101:in `run_callbacks'
actionpack (6.0.3.2) lib/action_dispatch/middleware/callbacks.rb:26:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/actionable_exceptions.rb:17:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/debug_exceptions.rb:32:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
railties (6.0.3.2) lib/rails/rack/logger.rb:37:in `call_app'
railties (6.0.3.2) lib/rails/rack/logger.rb:26:in `block in call'
activesupport (6.0.3.2) lib/active_support/tagged_logging.rb:80:in `block in tagged'
activesupport (6.0.3.2) lib/active_support/tagged_logging.rb:28:in `tagged'
activesupport (6.0.3.2) lib/active_support/tagged_logging.rb:80:in `tagged'
railties (6.0.3.2) lib/rails/rack/logger.rb:26:in `call'
sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/request_id.rb:27:in `call'
rack (2.2.3) lib/rack/method_override.rb:24:in `call'
rack (2.2.3) lib/rack/runtime.rb:22:in `call'
activesupport (6.0.3.2) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/static.rb:126:in `call'
rack (2.2.3) lib/rack/sendfile.rb:110:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/host_authorization.rb:76:in `call'
rack-cors (1.1.1) lib/rack/cors.rb:100:in `call'
railties (6.0.3.2) lib/rails/engine.rb:527:in `call'
/usr/lib/ruby/vendor_ruby/phusion_passenger/rack/thread_handler_extension.rb:107:in `process_request'
/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:149:in `accept_and_process_next_request'
/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:110:in `main_loop'
/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb:415:in `block (3 levels) in start_threads'
/usr/lib/ruby/vendor_ruby/phusion_passenger/utils.rb:113:in `block in create_thread_and_abort_on_exception'

any idea where that comes from?

@bensheldon
Copy link
Owner

@sebastiandeutsch that's unexpected! I'll see if I can reproduce this error.

This is the offending link_to that seems to be erroring:

<%= link_to({ after_scheduled_at: (@filter.last.scheduled_at || @filter.last.created_at), after_id: @filter.last.id }, class: "page-link") do %>
Next jobs <span aria-hidden="true">&raquo;</span>
<% end %>

I did some light googling and I wonder if this maybe applies somewhere in your application? https://stackoverflow.com/a/20817541/241735

@bensheldon
Copy link
Owner

I'm unable to reproduce this error 😞

@bensheldon bensheldon added the bug Something isn't working label Aug 16, 2021
@bensheldon
Copy link
Owner

Closing this because of inactivity. Please comment if you are still seeing this.

@adentaofftake
Copy link

Encountering something similar when I visit my good_job index!

@adenta
Copy link

adenta commented Jan 10, 2024

This stackoverflow issue solved my problems!

I had a model with include Rails.application.routes.url_helpers. Removing that fixed things. Seems like a legitimate bug in good_job, now with a reproducible way to trigger the issue.

@bensheldon
Copy link
Owner

oooooh! @adenta thanks for sharing that! I'll try to reproduce that case and see if I can fix it 🙌🏻

@bensheldon bensheldon reopened this Jan 10, 2024
@bensheldon
Copy link
Owner

@adenta Does this describe what you discovered in your codebase?

There was an include Rails.application.routes.url_helpers at the start of a file for a [model] instead of being inside the class

@adenta
Copy link

adenta commented Jan 10, 2024 via email

@github-project-automation github-project-automation bot moved this to Prioritized backlog in Backlog Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Prioritized backlog
Development

No branches or pull requests

4 participants