{"record":{"id":"2b5a2a27ae8818df","repo":"instructure/canvas-lms","slug":"error-posting-assignment-grades","errorCode":null,"errorMessage":"Error posting assignment grades","messagePattern":"Error posting assignment grades","errorType":"exception","errorClass":"GraphQL::ExecutionError","httpStatus":null,"severity":"error","filePath":"app/graphql/mutations/post_assignment_grades.rb","lineNumber":84,"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:,\n        posting_params:,\n        skip_content_participation_refresh: false\n      )\n      { assignment:, progress:, sections: }\n    else\n      raise GraphQL::ExecutionError, \"Error posting assignment grades\"\n    end\n  end\nend\n","sourceCodeStart":66,"sourceCodeEnd":88,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/app/graphql/mutations/post_assignment_grades.rb#L66-L88","documentation":"Catch-all failure branch of postAssignmentGrades: when the code path reaches the final else, the Gradebook posting service did not return a success result, so a generic 'Error posting assignment grades' ExecutionError is raised instead of a granular message.","triggerScenarios":"The internal postgrades service returns a non-success result (e.g. internal submission posting failure) after passing earlier validations.","commonSituations":"Transient backend/data issues while enqueueing posting; unexpected return shape from the posting service during upgrades.","solutions":["Retry the mutation once; the failure is often transient during job processing.","Check server logs (Canvas error reports) for the underlying exception raised by the posting service.","Verify submissions exist and grades are in a postable state; contact admin/inspect progress jobs if it persists."],"exampleFix":"// before\nawait postAssignmentGrades({input});\n// after\ntry {\n  await postAssignmentGrades({input});\n} catch (e) {\n  if (e.message === \"Error posting assignment grades\") {\n    // retry once, then surface logs to the user\n  }\n}","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { await post(); } catch (e) { if (e.message === 'Error posting assignment grades') { await retryWithBackoff(post, 2); } else throw e; }","preventionTips":["Retry transient failures with backoff before alerting users.","Correlate with server logs / error reports for root cause.","Verify posting prerequisites (grades published, submissions present) before calling."],"tags":["graphql","assignments","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"}