{"record":{"id":"f5e47a0ba2be893e","repo":"instructure/canvas-lms","slug":"parent-assignment-course-override-not-found-for-course","errorCode":null,"errorMessage":"Parent assignment Course override not found for course %{course_id}","messagePattern":"Parent assignment Course override not found for course %(.+?)","errorType":"validation","errorClass":"PeerReview::ParentOverrideNotFoundError","httpStatus":null,"severity":"error","filePath":"app/services/peer_review/validations.rb","lineNumber":251,"sourceCode":"    unless assignment.group_category_id\n      raise PeerReview::GroupAssignmentRequiredError, I18n.t(\"Must be a group assignment to create group overrides\")\n    end\n  end\n\n  def validate_group_exists(group)\n    raise PeerReview::GroupNotFoundError, I18n.t(\"Group does not exist\") unless group.present?\n  end\n\n  def validate_adhoc_parent_override_exists(parent_override, student_ids)\n    unless parent_override.present?\n      raise PeerReview::ParentOverrideNotFoundError,\n            I18n.t(\"Parent assignment ADHOC override not found for students %{student_ids}\", student_ids: student_ids.join(\", \"))\n    end\n  end\n\n  def validate_course_parent_override_exists(parent_override, course_id)\n    unless parent_override.present?\n      raise PeerReview::ParentOverrideNotFoundError,\n            I18n.t(\"Parent assignment Course override not found for course %{course_id}\", course_id:)\n    end\n  end\n\n  def validate_group_parent_override_exists(parent_override, group_id)\n    unless parent_override.present?\n      raise PeerReview::ParentOverrideNotFoundError,\n            I18n.t(\"Parent assignment Group override not found for group %{group_id}\", group_id:)\n    end\n  end\n\n  def validate_section_parent_override_exists(parent_override, section_id)\n    unless parent_override.present?\n      raise PeerReview::ParentOverrideNotFoundError,\n            I18n.t(\"Parent assignment Section override not found for section %{section_id}\", section_id:)\n    end\n  end\nend","sourceCodeStart":233,"sourceCodeEnd":269,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/app/services/peer_review/validations.rb#L233-L269","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Create the parent Course override for that course_id before creating child overrides","Confirm course_id refers to the course the parent override was actually created under","Re-run the parent override setup step (or the sync job) that provisions parents","Inspect AssignmentOverride records for the course to see what parents actually exist"],"exampleFix":"// before\nchild = PeerReview::CreateChildOverride.call(parent_override: nil, course_id: course.id)\n// after\nparent = assignment.assignment_overrides.course_section_overrides.find_by(course_section_id: section.id)\nchild = PeerReview::CreateChildOverride.call(parent_override: parent, course_id: course.id)","handlingStrategy":"try-catch","validationCode":"parent = assignment.assignment_overrides.where(set_type: 'CourseSection').exists?","typeGuard":"null","tryCatchPattern":"begin\n  PeerReview::CreateChildOverride.call(parent_override:, course_id:)\nrescue PeerReview::ParentOverrideNotFoundError\n  # provision the parent course override, then retry\nend","preventionTips":["Run parent-override provisioning for all course sections when peer review is enabled","Confirm course_id matches the assignment's course_id","Monitor sync jobs that generate parent overrides"],"tags":["ruby","rails","peer-review","overrides","course","not-found"],"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"}