{"record":{"id":"4559815184405624","repo":"instructure/canvas-lms","slug":"no-section-id-given-for-a-section-in-course-course-id","errorCode":null,"errorMessage":"No section_id given for a section in course #{course_id}","messagePattern":"No section_id given for a section in course #(.+?)","errorType":"validation","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"lib/sis/section_importer.rb","lineNumber":81,"sourceCode":"        :sections_to_update_sis_batch_ids,\n        :course_ids_to_update_associations,\n        :deleted_section_ids,\n        :roll_back_data\n      )\n\n      def initialize(batch, root_account, logger)\n        @batch = batch\n        @root_account = root_account\n        @logger = logger\n        @success_count = 0\n        @sections_to_update_sis_batch_ids = []\n        @roll_back_data = []\n        @course_ids_to_update_associations = Set.new\n        @deleted_section_ids = Set.new\n      end\n\n      def add_section(section_id, course_id, name, status, start_date = nil, end_date = nil, integration_id = nil)\n        raise ImportError, \"No section_id given for a section in course #{course_id}\" if section_id.blank?\n        raise ImportError, \"No course_id given for a section #{section_id}\" if course_id.blank?\n        raise ImportError, \"No name given for section #{section_id} in course #{course_id}\" if name.blank? && status =~ /\\Aactive/i\n        raise ImportError, \"Improper status \\\"#{status}\\\" for section #{section_id} in course #{course_id}\" unless /\\Aactive|\\Adeleted/i.match?(status)\n        return if @batch.skip_deletes? && status =~ /deleted/i\n\n        course = @root_account.all_courses.find_by(sis_source_id: course_id)\n        raise ImportError, \"Section #{section_id} references course #{course_id} which doesn't exist\" unless course\n\n        section = @root_account.course_sections.find_by(sis_source_id: section_id)\n        section ||= course.course_sections.where(sis_source_id: section_id).first_or_initialize\n        section.root_account = @root_account\n        # this is an easy way to load up the cache with data we already have\n        section.course = course if course.id == section.course_id\n\n        # only update the name on new records, and ones that haven't been changed since the last sis import\n        raise ImportError, \"No name given for section #{section_id} in course #{course_id}\" if name.blank? && section.new_record?\n\n        section.name = name if section.new_record? || (!section.stuck_sis_fields.include?(:name) && name.present?)","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/lib/sis/section_importer.rb#L63-L99","documentation":"Validation guard in SectionImporter::Work#add_section raised when the section_id argument is blank. Without a SIS section identifier the section cannot be matched or created, so the CSV row is rejected before any course lookup.","triggerScenarios":"Thrown at lib/sis/section_importer.rb:81 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide section_id on every sections CSV 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"}