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

Error hiding assignment grades for sections

Error message

Error hiding assignment grades for sections

What it means

Raised when the Progress record created to track the background hide_submissions job fails to save (progress.save returns false). The mutation could not enqueue the background job, so no grades were hidden. Progress model validations (e.g. missing tag/context/user) are the usual cause.

Solutions

  1. Inspect progress.errors after reproduction (rails c) to see why Progress#save failed
  2. Verify database connectivity and that the progresses table has no failing constraint/trigger
  3. Check for plugins or overrides that add Progress validations
  4. Retry the mutation; if persistent, examine course record validity (course.valid?)

Example fix

# server-side guard before raising a generic message
progress = course.progresses.new(tag: "hide_assignment_grades_for_sections")
unless progress.save
  raise GraphQL::ExecutionError, "Error hiding assignment grades for sections: #{progress.errors.full_messages.join(', ')}"
end
Defensive patterns

Strategy: try-catch

Try / catch

try {
  const res = await hideAssignmentGradesForSections(input);
  // poll res.progress until completed; treat workflowState 'failed' as hidden-failure
} catch (e) {
  if (e.message.includes("Error hiding assignment grades for sections")) {
    // surface a retry prompt; check backend progress.errors for the real cause
  }
}

Prevention

When it happens

Trigger: Calling hideAssignmentGradesForSections when course.progresses.new(tag: 'hide_assignment_grades_for_sections') fails validation on save — e.g. invalid progress state, database constraint, or a corrupted course/progress association.

Common situations: Database connection/replication issues during save; custom Progress validations from plugins; stalled progress rows from prior failed runs blocking new ones; data corruption in the courses record.

Related errors


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

Appendix: source

Thrown at app/graphql/mutations/hide_assignment_grades_for_sections.rb:69

    visible_enrollments = course.apply_enrollment_visibility(course.student_enrollments, current_user, sections)

    submissions_scope = input[:graded_only] ? assignment.submissions.graded : assignment.submissions
    submissions_scope = submissions_scope.joins(user: :enrollments).merge(visible_enrollments)

    progress = course.progresses.new(tag: "hide_assignment_grades_for_sections")

    if progress.save
      progress.process_job(
        assignment,
        :hide_submissions,
        { preserve_method_args: true, priority: Delayed::HIGH_PRIORITY },
        progress:,
        submission_ids: submissions_scope.pluck(:id),
        skip_content_participation_refresh: false
      )
      { assignment:, progress:, sections: }
    else
      raise GraphQL::ExecutionError, "Error hiding assignment grades for sections"
    end
  end
end

View on GitHub (pinned to 1c9f0bb801)