{"record":{"id":"34ec8ce952a8a8ee","repo":"instructure/canvas-lms","slug":"no-name-given-for-institutional-tag-category-sis-id","errorCode":null,"errorMessage":"No name given for institutional tag category #{sis_id}","messagePattern":"No name given for institutional tag category #(.+?)","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"lib/sis/institutional_tag_category_importer.rb","lineNumber":43,"sourceCode":"      yield importer\n      SisBatchRollBackData.bulk_insert_roll_back_data(importer.roll_back_data)\n      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      end\n\n      def add_institutional_tag_category(sis_id, name, description, status)\n        raise ImportError, \"No category_id given for an institutional tag category\" if sis_id.blank?\n        raise ImportError, \"No name given for institutional tag category #{sis_id}\" if name.blank?\n        raise ImportError, \"No status given for institutional tag category #{sis_id}\" if status.blank?\n        raise ImportError, \"Improper status \\\"#{status}\\\" for institutional tag category #{sis_id}\" unless /\\A(active|deleted)/i.match?(status)\n        return if @batch.skip_deletes? && /deleted/i.match?(status)\n\n        category = InstitutionalTagCategory.find_by(root_account_id: @root_account.id, sis_source_id: sis_id)\n        category ||= InstitutionalTagCategory.new(account: @root_account,\n                                                  root_account: @root_account,\n                                                  sis_source_id: sis_id)\n\n        category.name = name\n        category.description = description\n        category.sis_batch_id = @batch.id\n        category.workflow_state = /deleted/i.match?(status) ? \"deleted\" : \"active\"\n\n        if category.save\n          data = SisBatchRollBackData.build_data(sis_batch: @batch, context: category)\n          @roll_back_data << data if data\n          @success_count += 1","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/lib/sis/institutional_tag_category_importer.rb#L25-L61","documentation":"Raised by SisImports::InstitutionalTagCategoryImporter#add_institutional_tag_category when a category row from the SIS import has a category_id (sis_id) but an empty/blank name. The importer validates each required column before touching the database, and name is mandatory for every institutional tag category. The sis_id is interpolated into the message so the offending row can be located in the import file.","triggerScenarios":"Calling add_institutional_tag_category(sis_id, name, description, status) with name set to nil, '' or whitespace-only; a CSV row in the institutional_tag_categories SIS file where the name column is empty; a mapping/scope that binds the wrong column into name so it arrives blank.","commonSituations":"Hand-edited or partially exported SIS CSVs missing the name column; import templates with a name header but empty cells; upstream HR/ERP exports that omit names for inactive categories; column-order changes after a template update so name is fed an empty value.","solutions":["Locate the row with the interpolated sis_id in the institutional_tag_categories CSV and fill in a non-blank name.","Check the SIS import mapping/scope so the name column is actually bound to the name argument.","If the category should be removed, set status to deleted instead of blanking the name.","Re-run the SIS import after fixing the file."],"exampleFix":"// before\nadd_institutional_tag_category('cat-1', nil, 'desc', 'active')\n// after\nadd_institutional_tag_category('cat-1', 'Department Tags', 'desc', 'active')","handlingStrategy":"validation","validationCode":"raise ArgumentError, 'name is required' if name.blank?\nadd_institutional_tag_category(sis_id, name, description, status)","typeGuard":null,"tryCatchPattern":"begin\n  importer.add_institutional_tag_category(sis_id, name, description, status)\nrescue SisImports::ImportError => e\n  Rails.logger.warn(\"Skipping category #{sis_id}: #{e.message}\")\nend","preventionTips":["Validate SIS CSV rows (presence of category_id and name) before importing.","Add a preprocessing step that reports blank required columns per row.","Keep import templates and column mappings under version control.","Fail fast in CI on malformed sample SIS files."],"tags":["sis-import","validation","missing-field","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"}