instructure/canvas-lms · error · PeerReview::OverrideNotFoundError

Override does not exist

Error message

Override does not exist

What it means

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.

Solutions

  1. Re-fetch the override by id and confirm it exists before calling the service
  2. Verify the override belongs to the same course as the request
  3. Refresh stale client data and retry with a valid override id

Example fix

// before
override = course.assignment_overrides.find_by(id: params[:override_id]) # nil after delete
service.call(override: override)
// after
override = course.assignment_overrides.find(params[:override_id])
service.call(override: override)
Defensive patterns

Strategy: try-catch

Validate before calling

override = course.assignment_overrides.find_by(id: override_id)
raise ArgumentError, 'override not found' unless override

Try / catch

begin
  service.call(override:)
rescue PeerReview::OverrideNotFoundError
  redirect_to course_assignment_path(course, assignment), alert: 'Override no longer exists'
end

Prevention

When it happens

Trigger: 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.

Common situations: Override was deleted between listing and calling; using an override id from another course/shard; stale frontend data after an override was removed.

Understand the failure class

Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.

Related errors


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

Appendix: source

Thrown at app/services/peer_review/validations.rb:203

    end

    # Validate: child lock_at <= parent lock_at
    if child_lock_at && parent_lock_at && child_lock_at > parent_lock_at
      raise PeerReview::InvalidDatesError,
            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")
    end
  end

  def validate_set_type_required(set_type)
    raise PeerReview::SetTypeRequiredError, I18n.t("Set type is required") unless set_type.present?
  end

  def validate_set_id_required(set_id)
    raise PeerReview::SetIdRequiredError, I18n.t("Set id is required") unless set_id.present?
  end

  def validate_override_exists(override)
    raise PeerReview::OverrideNotFoundError, I18n.t("Override does not exist") unless override.present?
  end

  def validate_section_exists(section)
    raise PeerReview::SectionNotFoundError, I18n.t("Section does not exist") unless section.present?
  end

  def validate_course_exists(course)
    raise PeerReview::CourseNotFoundError, I18n.t("Course does not exist") unless course.present?
  end

  def validate_student_ids_required(student_ids)
    if student_ids.nil? || student_ids == "" || student_ids.to_s.strip.empty? || (student_ids.is_a?(Array) && student_ids.empty?)
      raise PeerReview::StudentIdsRequiredError, I18n.t("Student ids are required")
    end
  end

  def validate_student_ids_in_course(student_ids)
    raise PeerReview::StudentIdsNotInCourseError, I18n.t("Student ids are not in course") if student_ids.blank?

View on GitHub (pinned to 1c9f0bb801)