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

Error posting assignment grades for sections

Error message

Error posting assignment grades for sections

What it means

Raised when Gradezilla#post_assignment_grades (invoked with the collected submission ids and posting params) returns falsy — i.e. the backend posting job/operation failed to start or report progress. It is a generic failure wrapper for the section-posting workflow, not a validation error.

Solutions

  1. Check whether any submissions in the scope are postable; if using graded_only, confirm graded submissions exist in the selected sections
  2. Inspect Rails/Progress logs for the failing post_assignment_grades call
  3. Retry the mutation after confirming assignment and submissions state
  4. If reproducible, report/investigate why assignment.post_assignment_grades returned falsy

Example fix

// before
postAssignmentGradesForSections(id, sectionIds, { gradedOnly: true }) // no graded submissions
// after
if (assignment.submissions.postable.exists?) {
  postAssignmentGradesForSections(id, sectionIds, { gradedOnly: true })
}
Defensive patterns

Strategy: retry

Validate before calling

const hasPostable = await assignment.submissions.postable.length > 0
if (gradedOnly && !hasPostable) skipMutation()

Type guard

null

Try / catch

try {
  await postAssignmentGradesForSections({ id, sectionIds, gradedOnly })
} catch (e) {
  if (e.message.includes('Error posting assignment grades')) {
    logError(e); await delay(retryBackoff); retryOnce()
  } else throw e
}

Prevention

When it happens

Trigger: post_assignment_grades returns nil/false, e.g. no matching postable submissions when graded_only is set, an internal failure creating the Progress, or a persistence error in the posting pipeline.

Common situations: Posting with graded_only: true when no graded submissions exist in the selected sections; transient DB errors; moderator workflow state changing between the scope build and the post call.

Related errors


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

Appendix: source

Thrown at app/graphql/mutations/post_assignment_grades_for_sections.rb:75

    posting_params = {
      graded_only: !!input[:graded_only],
      section_names: sections&.pluck(:name)
    }

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

View on GitHub (pinned to 1c9f0bb801)