{"record":{"id":"d84f0dfe857a99a9","repo":"instructure/canvas-lms","slug":"no-name-given-for-type-display-name-type-id","errorCode":null,"errorMessage":"No name given for #{type_display_name(type)} #{id}.","messagePattern":"No name given for #(.+?) #(.+?)\\.","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"lib/sis/group_importer.rb","lineNumber":54,"sourceCode":"      def initialize(batch, root_account, logger)\n        @batch = batch\n        @root_account = root_account\n        @logger = logger\n        @success_count = 0\n        @roll_back_data = []\n        @accounts_cache = {}\n        @courses_cache = {}\n      end\n\n      private\n\n      def type_display_name(type)\n        type.tr(\"_\", \" \")\n      end\n\n      def invalid_import_item?(id, name, status, type)\n        raise ImportError, \"No #{(type == \"group\") ? type : \"tag\"}_id given for a #{type_display_name(type)}.\" unless id\n        raise ImportError, \"No name given for #{type_display_name(type)} #{id}.\" if name.blank?\n        raise ImportError, \"Improper status \\\"#{status}\\\" for #{type_display_name(type)} #{id}.\" unless /\\A(available|closed|completed|deleted)/i.match?(status)\n        return true if @batch.skip_deletes? && status =~ /deleted/i\n\n        false\n      end\n\n      def find_context(id, id_type, type, item_id)\n        context = nil\n        cache = (id_type == :course_id) ? @courses_cache : @accounts_cache\n\n        if id\n          context = cache[id]\n          context ||= if id_type == :course_id\n                        @root_account.all_courses.active.find_by(sis_source_id: id)\n                      else\n                        @root_account.all_accounts.active.find_by(sis_source_id: id)\n                      end\n","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/lib/sis/group_importer.rb#L36-L72","documentation":"Raised during a SIS import when a group or differentiation tag row supplies no name. GroupImporter requires every imported item to have a non-blank name because the Group/GroupCategory models validate name presence, so the importer fails fast with a row-specific message instead of a model validation error. The message includes the humanized type and the supplied id.","triggerScenarios":"add_group or add_tag called with a blank/nil name — a CSV row in the groups/tags file whose 'name' column is empty or whitespace, or nil passed programmatically.","commonSituations":"Exports from external systems emitting optional columns as empty strings; hand-edited CSVs with missing name cells; generators omitting trailing empty fields; leftover template rows.","solutions":["Add a non-blank value to the 'name' column for the row with the given id.","Remove the row if it is not meant to be imported.","Trim or supply real names if values are whitespace-only.","Validate name presence before calling add_group/add_tag programmatically."],"exampleFix":"# before\ngroup_id,course_id,name,status\nG101,C200,,available\n# after\ngroup_id,course_id,name,status\nG101,C200,Study Group A,available","handlingStrategy":"validation","validationCode":"raise ArgumentError, 'name is required for SIS group row' if name.to_s.strip.empty?","typeGuard":null,"tryCatchPattern":"begin\n  importer.add_group(gid, cat_id, acct_id, course_id, name, status)\nrescue ImportError => e\n  logger.warn(\"Row skipped: #{e.message}\")\nend","preventionTips":["Require the name column in your CSV schema/export query","Strip whitespace and reject empty cells at CSV-parse time","Dry-run lint the SIS CSV before uploading","Keep template/demo rows out of production files"],"tags":["sis-import","csv-validation","ruby"],"backgroundTag":"empty-required-field","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"}