Skip to content

Retry / Discard buttons on the Failed Jobs page return 404 #48

Closed

Description

@Nosk14

Description

On the Failed Jobs page, clicking a row's Retry or Discard button returns a 404. "Retry selected" / "Discard selected" work.

Versions

  • solid_queue_monitor 2.2.1
  • Rails 8.1, solid_queue 1.7; Chrome/Firefox

Steps to reproduce

  1. Have at least one failed job.
  2. Open /solid_queue/failed_jobs (engine mounted at /solid_queue).
  3. Click Retry on a row.

Expected: POST /solid_queue/retry_failed_job/:id, the job is retried, redirect back to the list.
Actual: the browser sends POST /solid_queue/failed_jobs with an empty body:

ActionController::RoutingError (No route matches [POST] "/solid_queue/failed_jobs")

Cause

failed_jobs/index.html.erb wraps the table in the bulk-action form, which has no action:

<form method="post" id="failed-jobs-form">
  <%= render 'solid_queue_monitor/shared/jobs_table', ... %>
</form>

Each row (failed_jobs/_row.html.erb) renders its own <form method="post" action="<%= retry_failed_job_path(id: job.id) %>"> (and one for discard) inside it. HTML doesn't allow nested forms, so browsers drop the inner <form> tags. The row buttons then submit the outer form, which posts to the current URL. The bulk buttons work only because application.js sets form.action before calling form.submit().

Suggested fix

Avoid nesting, for example by giving the row buttons their own target URL instead of their own form:

<button type="submit" class="action-button retry-button"
        formaction="<%= retry_failed_job_path(id: job.id) %>" formmethod="post">Retry</button>

(Discard would need its confirmation moved to the button, e.g. a click handler instead of the form's data-confirm.) Alternatively, keep the row forms outside the bulk form and attach the checkboxes to it with the form="failed-jobs-form" attribute.

The Retry buttons on the job detail page, the overview and the queue page aren't affected, because their forms aren't nested.

Activity

  1. phmunhoz commented on Oct 28, 2026

    @phmunhoz
    Contributor

    Hey @Nosk14,

    I can confirm the behavior for the single row "Retry" action.

    I can't reproduce for the "Discard" one.

    Ruby 3.4.9
    Rails 8.1.3.1
    SolidQueueMonitor 2.2.1
    Solid Queue 1.7.0

  2. phmunhoz commented on Oct 28, 2026

    @phmunhoz
    Contributor

    Update:

    It's not happening to all failed jobs in my tests.

    Deep diving I discovered it only happens to the Retry in the first line job.

    Can you confirm that @Nosk14?

  3. Nosk14 commented on Oct 28, 2026

    @Nosk14
    Author

    Thanks @phmunhoz for looking at it!
    My mistake, I have taken a deeper look and I confirm: only the first row’s Retry fails. Discard works as expected.

  4. phmunhoz commented on Oct 28, 2026

    @phmunhoz
    Contributor

    No problem my friend.

    I've open the #49, it would help us. ;o)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions