{"record":{"id":"e26dcc7b2922804f","repo":"instructure/canvas-lms","slug":"a-term-did-not-pass-validation-term-term-id-name-error-term","errorCode":null,"errorMessage":"A term did not pass validation (term: #{term_id} / #{name}, error: #{term.errors.full_messages.join(\", \")})","messagePattern":"A term did not pass validation \\(term: #(.+?) / #(.+?), error: #(.+?)\\)","errorType":"validation","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"lib/sis/term_importer.rb","lineNumber":102,"sourceCode":"            term.workflow_state = \"active\"\n          when /deleted/i\n            term.workflow_state = \"deleted\"\n          end\n          unless term.stuck_sis_fields.intersect?([:start_at, :end_at])\n            term.start_at = start_date\n            term.end_at = end_date\n          end\n        end\n\n        if term.save\n          data = SisBatchRollBackData.build_data(sis_batch: @batch, context: term)\n          @roll_back_data << data if data\n          @success_count += 1\n        else\n          msg = \"A term did not pass validation \"\n          msg += \"(\" + \"term: #{term_id} / #{name}, error: \"\n          msg += term.errors.full_messages.join(\", \") + \")\"\n          raise ImportError, msg\n        end\n      end\n    end\n  end\nend\n","sourceCodeStart":84,"sourceCodeEnd":108,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/lib/sis/term_importer.rb#L84-L108","documentation":"Persistence failure in TermImporter::Work#add_term: the enrollment term record was built and populated but ActiveRecord save returned false (model-level validation failures such as invalid dates or missing name). The error aggregates term.errors.full_messages, and the term is not counted or rolled into batch data.","triggerScenarios":"Thrown at lib/sis/term_importer.rb:102 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the embedded validation errors (e.g. bad dates) and fix the row","Re-run the SIS batch after correction"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}