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

Parent assignment Course override not found for course

Error message

Parent assignment Course override not found for course %{course_id}

What it means

PeerReview::ParentOverrideNotFoundError raised when validate_course_parent_override_exists cannot find the parent Course-section override for the given course_id. Peer review child overrides depend on an existing parent override; a missing parent blocks child override creation.

Solutions

  1. Create the parent Course override for that course_id before creating child overrides
  2. Confirm course_id refers to the course the parent override was actually created under
  3. Re-run the parent override setup step (or the sync job) that provisions parents
  4. Inspect AssignmentOverride records for the course to see what parents actually exist

Example fix

// before
child = PeerReview::CreateChildOverride.call(parent_override: nil, course_id: course.id)
// after
parent = assignment.assignment_overrides.course_section_overrides.find_by(course_section_id: section.id)
child = PeerReview::CreateChildOverride.call(parent_override: parent, course_id: course.id)
Defensive patterns

Strategy: try-catch

Validate before calling

parent = assignment.assignment_overrides.where(set_type: 'CourseSection').exists?

Type guard

null

Try / catch

begin
  PeerReview::CreateChildOverride.call(parent_override:, course_id:)
rescue PeerReview::ParentOverrideNotFoundError
  # provision the parent course override, then retry
end

Prevention

When it happens

Trigger: Calling the peer-review child override service for a course-section override when no parent override for that course/section exists (never created or deleted).

Common situations: Course section was changed/deleted after parent creation; the parent override was created for a different course_id; seeding/import flows that skip parent override creation.

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/f5e47a0ba2be893e. Report an issue: GitHub.

Appendix: source

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

    unless assignment.group_category_id
      raise PeerReview::GroupAssignmentRequiredError, I18n.t("Must be a group assignment to create group overrides")
    end
  end

  def validate_group_exists(group)
    raise PeerReview::GroupNotFoundError, I18n.t("Group does not exist") unless group.present?
  end

  def validate_adhoc_parent_override_exists(parent_override, student_ids)
    unless parent_override.present?
      raise PeerReview::ParentOverrideNotFoundError,
            I18n.t("Parent assignment ADHOC override not found for students %{student_ids}", student_ids: student_ids.join(", "))
    end
  end

  def validate_course_parent_override_exists(parent_override, course_id)
    unless parent_override.present?
      raise PeerReview::ParentOverrideNotFoundError,
            I18n.t("Parent assignment Course override not found for course %{course_id}", course_id:)
    end
  end

  def validate_group_parent_override_exists(parent_override, group_id)
    unless parent_override.present?
      raise PeerReview::ParentOverrideNotFoundError,
            I18n.t("Parent assignment Group override not found for group %{group_id}", group_id:)
    end
  end

  def validate_section_parent_override_exists(parent_override, section_id)
    unless parent_override.present?
      raise PeerReview::ParentOverrideNotFoundError,
            I18n.t("Parent assignment Section override not found for section %{section_id}", section_id:)
    end
  end
end

View on GitHub (pinned to 1c9f0bb801)