instructure/canvas-lms · error · ActionController::BadRequest

missing term

Error message

missing term

What it means

Guard in JobsV2Controller#throttle_check: the required 'term' parameter is missing or blank when calling the throttle search endpoint, so ActionController::BadRequest is raised instead of running the job-tag query.

Solutions

  1. Supply the required term parameter (tag prefix to search for)
  2. Check the client/UI is sending the search term with the request
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at app/controllers/jobs_v2_controller.rb:459 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of instructure/canvas-lms@1c9f0bb801 (2026-09-15). Data as JSON: /api/errors/ad5eff8b372e94c5. Report an issue: GitHub.

Appendix: source

Thrown at app/controllers/jobs_v2_controller.rb:459

  # @{not an}API Test throttle search term
  #
  # @argument term [Required, String]
  #   The search term. Will find unstranded queued jobs whose tags start with this term.
  #
  # @argument shard_id [Optional, Integer]
  #   If given, limit search to jobs on this shard
  #
  # @example_response
  #   {
  #     matched_jobs: 103,
  #     matched_tags: 7
  #   }
  #
  def throttle_check
    GuardRail.activate(:secondary) do
      term = params[:term]
      raise ActionController::BadRequest, "missing term" unless term.present?

      scope = throttle_scope(term, params[:shard_id])
      render json: {
        matched_jobs: scope.count,
        matched_tags: scope.distinct.count(:tag)
      }
    end
  end

  # @{not an}API Throttle jobs with a specific tag pattern by stranding them
  #
  # @argument term [Required, String]
  #   The search term. Unstranded queued jobs whose tags start with this term
  #   (case sensitively) will be throttled.
  #
  # @argument shard_id [Optional, Integer]
  #   If given, limit to jobs on this shard
  #

View on GitHub (pinned to 1c9f0bb801)