instructure/canvas-lms · error · GraphQL::ExecutionError

Rubric Association not found

Error message

Rubric Association not found

What it means

If the assignment exists but has no active rubric association (assignment.active_rubric_association? is false), resolve raises "Rubric Association not found". The mutation needs a live rubric_assessments association to create a self-assessment against.

Solutions

  1. Add/re-add a rubric to the assignment in the UI so an active rubric_association exists
  2. Verify with assignment.active_rubric_association? before calling the mutation
  3. If the rubric was deleted, restore it or choose an assignment that still has one

Example fix

// before
setRubricSelfAssessment(assignmentId: 5, ...)
// after
if assignment.active_rubric_association?
  setRubricSelfAssessment(assignmentId: 5, ...)
else
  Rails.logger.warn("assignment 5 has no active rubric association")
end
Defensive patterns

Strategy: validation

Validate before calling

// Ruby
has_rubric = assignment.active_rubric_association?

Try / catch

// Ruby
begin
  mutation
rescue GraphQL::ExecutionError => e
  prompt_add_rubric if e.message == "Rubric Association not found"
end

Prevention

When it happens

Trigger: Calling setRubricSelfAssessment for an assignment whose rubric was deleted or replaced, an assignment that never had a rubric added, or after a rubric import/copy that deactivated the association.

Common situations: Teacher removed the rubric after the student page loaded; course copy where rubric associations did not carry over; assignment graded without rubric in another workflow.

Understand the failure class

Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.

Related errors


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

Appendix: source

Thrown at app/graphql/mutations/set_rubric_self_assessment.rb:34

#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
module Mutations
  class SetRubricSelfAssessment < BaseMutation
    argument :assignment_id, ID, required: true
    argument :rubric_self_assessment_enabled, Boolean, required: true

    def resolve(input:)
      assignment = Assignment.find(input[:assignment_id])
      rubric_association = assignment.rubric_association

      unless Rubric.rubric_self_assessment_enabled?(assignment.course)
        raise GraphQL::ExecutionError, "enhanced_rubrics, rubric_self_assesment and assignments_2_student must be enabled"
      end

      unless assignment.active_rubric_association?
        raise GraphQL::ExecutionError, I18n.t("Rubric Association not found")
      end

      unless rubric_association.grants_right?(current_user, session, :update)
        raise GraphQL::ExecutionError, I18n.t("Insufficient permissions")
      end

      if assignment.has_group_category?
        raise GraphQL::ExecutionError, I18n.t("Cannot set rubric self assessment for group assignments")
      end

      if assignment.quiz_lti? || assignment.quiz?
        raise GraphQL::ExecutionError, I18n.t("Cannot set rubric self assessment for quiz assignments")
      end

      if assignment.discussion_topic?
        raise GraphQL::ExecutionError, I18n.t("Cannot set rubric self assessment for discussion assignments")
      end

View on GitHub (pinned to 1c9f0bb801)