{"record":{"id":"482f086ace94d18c","repo":"instructure/canvas-lms","slug":"override-does-not-exist","errorCode":null,"errorMessage":"Override does not exist","messagePattern":"Override does not exist","errorType":"validation","errorClass":"PeerReview::OverrideNotFoundError","httpStatus":null,"severity":"error","filePath":"app/services/peer_review/validations.rb","lineNumber":203,"sourceCode":"    end\n\n    # Validate: child lock_at <= parent lock_at\n    if child_lock_at && parent_lock_at && child_lock_at > parent_lock_at\n      raise PeerReview::InvalidDatesError,\n            is_override ? I18n.t(\"Peer review override until date cannot be after parent override until date\") : I18n.t(\"Peer review until date cannot be after assignment until date\")\n    end\n  end\n\n  def validate_set_type_required(set_type)\n    raise PeerReview::SetTypeRequiredError, I18n.t(\"Set type is required\") unless set_type.present?\n  end\n\n  def validate_set_id_required(set_id)\n    raise PeerReview::SetIdRequiredError, I18n.t(\"Set id is required\") unless set_id.present?\n  end\n\n  def validate_override_exists(override)\n    raise PeerReview::OverrideNotFoundError, I18n.t(\"Override does not exist\") unless override.present?\n  end\n\n  def validate_section_exists(section)\n    raise PeerReview::SectionNotFoundError, I18n.t(\"Section does not exist\") unless section.present?\n  end\n\n  def validate_course_exists(course)\n    raise PeerReview::CourseNotFoundError, I18n.t(\"Course does not exist\") unless course.present?\n  end\n\n  def validate_student_ids_required(student_ids)\n    if student_ids.nil? || student_ids == \"\" || student_ids.to_s.strip.empty? || (student_ids.is_a?(Array) && student_ids.empty?)\n      raise PeerReview::StudentIdsRequiredError, I18n.t(\"Student ids are required\")\n    end\n  end\n\n  def validate_student_ids_in_course(student_ids)\n    raise PeerReview::StudentIdsNotInCourseError, I18n.t(\"Student ids are not in course\") if student_ids.blank?","sourceCodeStart":185,"sourceCodeEnd":221,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/app/services/peer_review/validations.rb#L185-L221","documentation":"PeerReview::OverrideNotFoundError raised by validate_override_exists when the supplied assignment override object is nil/not present. The service needs the parent override to derive the set (section/group) and date boundaries.","triggerScenarios":"Calling a peer review override service with an override id that resolves to nil (deleted override, wrong course, or lookup returned nothing) which is then passed to validate_override_exists.","commonSituations":"Override was deleted between listing and calling; using an override id from another course/shard; stale frontend data after an override was removed.","solutions":["Re-fetch the override by id and confirm it exists before calling the service","Verify the override belongs to the same course as the request","Refresh stale client data and retry with a valid override id"],"exampleFix":"// before\noverride = course.assignment_overrides.find_by(id: params[:override_id]) # nil after delete\nservice.call(override: override)\n// after\noverride = course.assignment_overrides.find(params[:override_id])\nservice.call(override: override)","handlingStrategy":"try-catch","validationCode":"override = course.assignment_overrides.find_by(id: override_id)\nraise ArgumentError, 'override not found' unless override","typeGuard":null,"tryCatchPattern":"begin\n  service.call(override:)\nrescue PeerReview::OverrideNotFoundError\n  redirect_to course_assignment_path(course, assignment), alert: 'Override no longer exists'\nend","preventionTips":["Re-fetch overrides immediately before use instead of caching ids","Scope override lookups to the current course","Handle deleted overrides gracefully in the UI"],"tags":["ruby","peer-review","not-found","canvas"],"backgroundTag":"record-not-found","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"}