instructure/canvas-lms · error · ImportError
No name given for section #
Error message
No name given for section #{section_id} in course #{course_id} What it means
Generic blank-attribute guard in SIS section import: while iterating a CSV's section rows, add_section requires a name for any row whose status is active (or for a brand-new section record), so it fires when an active section row omits the name column (or it is blank).
Solutions
- Provide a name for every section row
- Correct the CSV and re-import
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at lib/sis/section_importer.rb:83 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of instructure/canvas-lms@1c9f0bb801 (2026-09-15).
Data as JSON: /api/errors/ca57841807e7ab48.
Report an issue: GitHub.
Appendix: source
Thrown at lib/sis/section_importer.rb:83
:deleted_section_ids,
:roll_back_data
)
def initialize(batch, root_account, logger)
@batch = batch
@root_account = root_account
@logger = logger
@success_count = 0
@sections_to_update_sis_batch_ids = []
@roll_back_data = []
@course_ids_to_update_associations = Set.new
@deleted_section_ids = Set.new
end
def add_section(section_id, course_id, name, status, start_date = nil, end_date = nil, integration_id = nil)
raise ImportError, "No section_id given for a section in course #{course_id}" if section_id.blank?
raise ImportError, "No course_id given for a section #{section_id}" if course_id.blank?
raise ImportError, "No name given for section #{section_id} in course #{course_id}" if name.blank? && status =~ /\Aactive/i
raise ImportError, "Improper status \"#{status}\" for section #{section_id} in course #{course_id}" unless /\Aactive|\Adeleted/i.match?(status)
return if @batch.skip_deletes? && status =~ /deleted/i
course = @root_account.all_courses.find_by(sis_source_id: course_id)
raise ImportError, "Section #{section_id} references course #{course_id} which doesn't exist" unless course
section = @root_account.course_sections.find_by(sis_source_id: section_id)
section ||= course.course_sections.where(sis_source_id: section_id).first_or_initialize
section.root_account = @root_account
# this is an easy way to load up the cache with data we already have
section.course = course if course.id == section.course_id
# only update the name on new records, and ones that haven't been changed since the last sis import
raise ImportError, "No name given for section #{section_id} in course #{course_id}" if name.blank? && section.new_record?
section.name = name if section.new_record? || (!section.stuck_sis_fields.include?(:name) && name.present?)
# update the course id if necessaryView on GitHub (pinned to 1c9f0bb801)