{"record":{"id":"aed67dbf3ae78ac7","repo":"instructure/canvas-lms","slug":"no-name-given-for-type-display-sis-id","errorCode":null,"errorMessage":"No name given for #{type_display} #{sis_id}","messagePattern":"No name given for #(.+?) #(.+?)","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"lib/sis/group_category_importer.rb","lineNumber":46,"sourceCode":"      importer.success_count\n    end\n\n    class Work\n      attr_accessor :success_count, :roll_back_data\n\n      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      def invalid_category?(sis_id, name, status, type_display)\n        raise ImportError, \"No sis_id given for a #{type_display}\" if sis_id.blank?\n        raise ImportError, \"No name given for #{type_display} #{sis_id}\" if name.blank?\n        raise ImportError, \"No status given for #{type_display} #{sis_id}\" if status.blank?\n        raise ImportError, \"Improper status \\\"#{status}\\\" for #{type_display} #{sis_id}, skipping\" unless /\\A(active|deleted)/i.match?(status)\n        return true if @batch.skip_deletes? && status =~ /deleted/i\n\n        false\n      end\n\n      def find_context(account_id, course_id, sis_id, type_display)\n        context = nil\n        if account_id && course_id\n          raise ImportError, \"Only one context is allowed and both course_id and account_id where provided for #{type_display} #{sis_id}.\"\n        end\n\n        if account_id\n          context = @accounts_cache[account_id]\n          context ||= @root_account.all_accounts.active.find_by(sis_source_id: account_id)\n          raise ImportError, \"Account with id \\\"#{account_id}\\\" didn't exist for #{type_display} #{sis_id}\" unless context\n","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/lib/sis/group_category_importer.rb#L28-L64","documentation":"invalid_category? raises ImportError when the name of a group category or differentiation tag set is blank, even when a valid sis_id is present. The message interpolates type_display and sis_id so the offending row can be located.","triggerScenarios":"`invalid_category?(sis_id, nil_or_empty_name, status, type_display)` — a group_categories CSV row with a sis_id but empty name column; add_group_category/add_differentiation_tag_set called with a nil name.","commonSituations":"Export that leaves name empty for programmatically-created categories; column misalignment shifting names into the wrong field; translators/localization pipelines dropping the name value.","solutions":["Ensure every category row has a non-blank name column","Fix CSV header mapping so name parses correctly","Backfill names for categories created without one in the source system","Guard the call site: skip rows with blank names before invoking the importer"],"exampleFix":"// before\nimporter.add_group_category(account, row['id'], row['name'], row['status'])\n// after\nnext if row['name'].blank?\nimporter.add_group_category(account, row['id'], row['name'], row['status'])","handlingStrategy":"validation","validationCode":"raise 'missing name' if name.blank?\nimporter.add_group_category(account, sis_id, name, status)","typeGuard":null,"tryCatchPattern":"begin\n  importer.add_group_category(account, sis_id, name, status)\nrescue SIS::Base::ImportError => e\n  logger.warn(\"Skipping category: #{e.message}\")\nend","preventionTips":["Backfill empty names in the source system before export","Check column alignment after any export format change","Validate each row (sis_id + name + status) before invoking the importer"],"tags":["ruby","sis-import","group-category","missing-required-field"],"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"}