{"record":{"id":"22cf39ce204e8840","repo":"instructure/canvas-lms","slug":"no-user-id-given-for-institutional-tag-association-with-tag","errorCode":null,"errorMessage":"No user_id given for institutional tag association with tag #{tag_id}","messagePattern":"No user_id given for institutional tag association with tag #(.+?)","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"lib/sis/institutional_tag_association_importer.rb","lineNumber":51,"sourceCode":"    end\n\n    class Work\n      attr_accessor :success_count, :roll_back_data\n\n      def initialize(batch, root_account, logger, messages)\n        @batch = batch\n        @root_account = root_account\n        @logger = logger\n        @messages = messages\n        @success_count = 0\n        @roll_back_data = []\n        @tags_cache = {}\n        @association_batch = []\n      end\n\n      def add_institutional_tag_association(tag_id, user_id, status, csv: nil, lineno: nil, row_info: nil)\n        raise ImportError, \"No institutional_tag_id given for an institutional tag association\" if tag_id.blank?\n        raise ImportError, \"No user_id given for institutional tag association with tag #{tag_id}\" if user_id.blank?\n        raise ImportError, \"No status given for institutional tag association (tag: #{tag_id}, user: #{user_id})\" if status.blank?\n        raise ImportError, \"Improper status \\\"#{status}\\\" for institutional tag association (tag: #{tag_id}, user: #{user_id})\" unless /\\A(active|deleted)/i.match?(status)\n        return if @batch.skip_deletes? && /deleted/i.match?(status)\n\n        @association_batch << { tag_id:, user_id:, status:, csv:, lineno:, row_info: }\n        process_batch if @association_batch.size >= BATCH_SIZE\n      end\n\n      def any_left_to_process?\n        @association_batch.any?\n      end\n\n      def process_batch\n        return unless any_left_to_process?\n\n        batch = @association_batch.shift(BATCH_SIZE)\n\n        user_ids = batch.map { |r| r[:user_id] }.uniq # rubocop:disable Rails/Pluck","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/lib/sis/institutional_tag_association_importer.rb#L33-L69","documentation":"Guard in SIS::InstitutionalTagAssociationImporter::Work#add_institutional_tag_association: the row is missing user_id for the association with the given tag, so ImportError is raised for that CSV row.","triggerScenarios":"Thrown at lib/sis/institutional_tag_association_importer.rb:51 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add the user_id (sis user id) to each institutional tag association row","Correct and re-import the affected batch"],"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"}