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

Failures show page does not work with multiple failed queues #98

Open
omarqureshi opened this issue Dec 9, 2015 · 4 comments
Open

Failures show page does not work with multiple failed queues #98

omarqureshi opened this issue Dec 9, 2015 · 4 comments

Comments

@omarqureshi
Copy link

Trying to get multiple failed queues to show up on resque-web 0.0.7, i'm using a fork of resque at 1.25.2 with resque/resque#1234 applied to it as the multiple queue failure backend was not functional

In doing so and trying to go to /failures/:id I get the following error:

Showing /mnt/resque-web/app/views/resque_web/failures/show.html.erb where line #3 raised:

undefined method `any?' for nil:NilClass
Extracted source (around line #3):

1. <h1>Failed Jobs <%= "on '#{params[:id]}'" if params[:id] %> <%= "with class '#{params[:class]}'" if params[:class] %></h1>
2.
3. <% if @jobs.any? %>
4.  <%= form_tag("/failures/#{params[:id] if params[:id]}", :method => :delete) do %>
5.    <%= submit_tag "Clear #{params[:id] ? "'#{params[:id]}'" : 'Failed'} Jobs", :confirm => "Are you sure?", :class => 'btn btn-danger' %>
6.  <% end %>

Rails.root: /mnt/resque-web-container

The underlying stack trace looks pretty unhelpful, however, the error makes sense as @jobs is not defined anywhere other than in the workers helper.

What's interesting is that going to /failures?queue=:queue somewhat works, in that extracts the right failed jobs for the right failed queue however the counts are wrong.

I'll be putting together a pull request which emulates the behaviour of the index view with working pagination if that's ok, unless you have a better solution for me to working towards?

@omarqureshi
Copy link
Author

So, upon looking at the test suite I've realised that actual the failures controller is a bit confused whether the resource that is actually acting upon is a failed job rather than a failed queue (thus the destroy_all / retry member methods which totally make sense for jobs, but, the show method doesn't make sense for queues)

I'll have a think about which routes design-wise makes sense for displaying the failed jobs/queues

@omarqureshi
Copy link
Author

I've put together techfromsage#1 which fixes this (and uses the current 0.0.7 tagging commit as a point of where to start), however, I'm not comfortable submitting this until the multiqueue backend for resque is fixed, is there a good way of getting them to merge one of the pull requests to fix that in?

@mlohbihler
Copy link

@omarqureshi , did you ever get to a solution with this issue? I'm having the same problem, but with different versions. My resque is 1.27.4, resque-web is 0.0.12.

@pn-y
Copy link

pn-y commented Jan 14, 2021

Any updates?

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

No branches or pull requests

3 participants