instructure/canvas-lms · error · ActiveRecord::RecordNotFound

Poll session not found

Error message

Poll session not found

What it means

Generic not-found guard in Filters::Polling#require_poll_session: no Polling::PollSession exists under @poll with the id from params[:poll_session_id]. The filter raises ActiveRecord::RecordNotFound for any polls API route needing a poll session.

Solutions

  1. Verify the poll_session_id (or id) param matches an existing poll session belonging to the given poll
  2. Confirm the poll session wasn't deleted and the client is using the correct poll_id
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at app/controllers/filters/polling.rb:46 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/38b296fdbfee6fab. Report an issue: GitHub.

Appendix: source

Thrown at app/controllers/filters/polling.rb:46

    @course
  end

  def require_poll
    id = params.key?(:poll_id) ? params[:poll_id] : params[:id]

    unless (@poll = Polling::Poll.find(id))
      raise ActiveRecord::RecordNotFound, "Poll not found"
    end

    @poll
  end

  def require_poll_session
    id = params[:poll_session_id]

    unless (@poll_session = @poll.poll_sessions.find(id))
      raise ActiveRecord::RecordNotFound, "Poll session not found"
    end

    @poll_session
  end
end

View on GitHub (pinned to 1c9f0bb801)