{"record":{"id":"c2e030752ca5b718","repo":"instructure/canvas-lms","slug":"error-posting-assignment-grades-for-sections","errorCode":null,"errorMessage":"Error posting assignment grades for sections","messagePattern":"Error posting assignment grades for sections","errorType":"exception","errorClass":"GraphQL::ExecutionError","httpStatus":null,"severity":"error","filePath":"app/graphql/mutations/post_assignment_grades_for_sections.rb","lineNumber":75,"sourceCode":"\n    posting_params = {\n      graded_only: !!input[:graded_only],\n      section_names: sections&.pluck(:name)\n    }\n\n    if progress.save\n      progress.process_job(\n        assignment,\n        :post_submissions,\n        { preserve_method_args: true, priority: Delayed::HIGH_PRIORITY },\n        progress:,\n        submission_ids: submissions_scope.pluck(:id),\n        posting_params:,\n        skip_content_participation_refresh: false\n      )\n      { assignment:, progress:, sections: }\n    else\n      raise GraphQL::ExecutionError, \"Error posting assignment grades for sections\"\n    end\n  end\nend\n","sourceCodeStart":57,"sourceCodeEnd":79,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/app/graphql/mutations/post_assignment_grades_for_sections.rb#L57-L79","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Check whether any submissions in the scope are postable; if using graded_only, confirm graded submissions exist in the selected sections","Inspect Rails/Progress logs for the failing post_assignment_grades call","Retry the mutation after confirming assignment and submissions state","If reproducible, report/investigate why assignment.post_assignment_grades returned falsy"],"exampleFix":"// before\npostAssignmentGradesForSections(id, sectionIds, { gradedOnly: true }) // no graded submissions\n// after\nif (assignment.submissions.postable.exists?) {\n  postAssignmentGradesForSections(id, sectionIds, { gradedOnly: true })\n}","handlingStrategy":"retry","validationCode":"const hasPostable = await assignment.submissions.postable.length > 0\nif (gradedOnly && !hasPostable) skipMutation()","typeGuard":"null","tryCatchPattern":"try {\n  await postAssignmentGradesForSections({ id, sectionIds, gradedOnly })\n} catch (e) {\n  if (e.message.includes('Error posting assignment grades')) {\n    logError(e); await delay(retryBackoff); retryOnce()\n  } else throw e\n}","preventionTips":["Verify postable submissions exist in the selected sections before posting","Avoid mutating assignment state concurrently with the post operation","Monitor Progress records for failures after posting","Check Rails logs for the underlying post_assignment_grades failure"],"tags":["graphql","grades","internal-error"],"backgroundTag":"api-error-response","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"}