{"record":{"id":"279f8461202377dc","repo":"instructure/canvas-lms","slug":"parent-assignment-section-override-not-found-for-section","errorCode":null,"errorMessage":"Parent assignment Section override not found for section %{section_id}","messagePattern":"Parent assignment Section override not found for section %(.+?)","errorType":"validation","errorClass":"PeerReview::ParentOverrideNotFoundError","httpStatus":null,"severity":"error","filePath":"app/services/peer_review/validations.rb","lineNumber":265,"sourceCode":"  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\n","sourceCodeStart":247,"sourceCodeEnd":270,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/app/services/peer_review/validations.rb#L247-L270","documentation":"PeerReview::ParentOverrideNotFoundError raised when validate_section_parent_override_exists cannot find the parent Section override for the given section_id. The peer-review flow requires a parent section override before creating per-section child overrides.","triggerScenarios":"Creating a peer-review section child override when no parent override exists for that course_section_id — section added after parent generation, parent deleted, or wrong section id passed.","commonSituations":"New course sections created after initial override setup; section merged/deleted; sync job that creates parents failed or hasn't run; passing a section from a different course.","solutions":["Run the parent override creation/sync for the course's sections before child creation","Confirm section_id belongs to the assignment's course","Create the missing parent Section override explicitly","Check for deleted/failed parent-override records and re-create them"],"exampleFix":"// before\nPeerReview::CreateChildOverride.call(parent_override: nil, section_id: section.id)\n// after\nparent = PeerReview::EnsureSectionParentOverride.call(assignment:, section:)\nPeerReview::CreateChildOverride.call(parent_override: parent, section_id: section.id)","handlingStrategy":"validation","validationCode":"parent = assignment.assignment_overrides.active.find_by(set_type: 'CourseSection', set_id: section_id)\nraise ArgumentError, 'missing parent section override' unless parent","typeGuard":"null","tryCatchPattern":"begin\n  PeerReview::CreateChildOverride.call(parent_override:, section_id:)\nrescue PeerReview::ParentOverrideNotFoundError\n  # create parent section override, then retry\nend","preventionTips":["Create parent overrides for every section when enabling peer review","Run parent provisioning when new sections are added","Confirm the section belongs to the assignment's course"],"tags":["ruby","rails","peer-review","overrides","sections","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"}