{"record":{"id":"38b296fdbfee6fab","repo":"instructure/canvas-lms","slug":"poll-session-not-found","errorCode":null,"errorMessage":"Poll session not found","messagePattern":"Poll session not found","errorType":"exception","errorClass":"ActiveRecord::RecordNotFound","httpStatus":404,"severity":"error","filePath":"app/controllers/filters/polling.rb","lineNumber":46,"sourceCode":"\n    @course\n  end\n\n  def require_poll\n    id = params.key?(:poll_id) ? params[:poll_id] : params[:id]\n\n    unless (@poll = Polling::Poll.find(id))\n      raise ActiveRecord::RecordNotFound, \"Poll not found\"\n    end\n\n    @poll\n  end\n\n  def require_poll_session\n    id = params[:poll_session_id]\n\n    unless (@poll_session = @poll.poll_sessions.find(id))\n      raise ActiveRecord::RecordNotFound, \"Poll session not found\"\n    end\n\n    @poll_session\n  end\nend\n","sourceCodeStart":28,"sourceCodeEnd":52,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/app/controllers/filters/polling.rb#L28-L52","documentation":"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.","triggerScenarios":"Thrown at app/controllers/filters/polling.rb:46 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the poll_session_id (or id) param matches an existing poll session belonging to the given poll","Confirm the poll session wasn't deleted and the client is using the correct poll_id"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1c9f0bb8013ed69c4f2efe11fd483025469b7e6c","analyzedAt":"2026-09-15T20:33:18.891Z","contentChangedAt":"2026-09-15T20:33:18.891Z","schemaVersion":2},"datasetVersion":"2026-09-23T02:17:17.105Z"}