{"record":{"id":"691d240658e1a9f8","repo":"instructure/canvas-lms","slug":"no-category-id-given-for-an-institutional-tag-category","errorCode":null,"errorMessage":"No category_id given for an institutional tag category","messagePattern":"No category_id given for an institutional tag category","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"lib/sis/institutional_tag_category_importer.rb","lineNumber":42,"sourceCode":"      importer = Work.new(@batch, @root_account, @logger)\n      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","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/lib/sis/institutional_tag_category_importer.rb#L24-L60","documentation":"Validation guard in InstitutionalTagCategoryImporter::Work#add_institutional_tag_category raised when the sis_id argument (category_id) is blank. The category cannot be created or matched to an existing institutional tag category without a SIS identifier, so the row is rejected at parse time.","triggerScenarios":"Thrown at lib/sis/institutional_tag_category_importer.rb:42 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a category_id (sis id) for every institutional tag category row","Re-run the SIS batch after correcting the file"],"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"}