instructure/canvas-lms · error · ImportError

No institutional_tag_id given for an institutional tag…

Error message

No institutional_tag_id given for an institutional tag association

What it means

Guard in SIS::InstitutionalTagAssociationImporter::Work#add_institutional_tag_association: the association row has a blank institutional_tag_id, so ImportError is raised and the row fails in the SIS batch.

Solutions

  1. Provide institutional_tag_id (sis id of the tag) on every association CSV row
  2. Re-run the SIS batch after correcting the CSV
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at lib/sis/institutional_tag_association_importer.rb:50 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of instructure/canvas-lms@1c9f0bb801 (2026-09-15). Data as JSON: /api/errors/e812d607d999fa6b. Report an issue: GitHub.

Appendix: source

Thrown at lib/sis/institutional_tag_association_importer.rb:50

      importer.success_count
    end

    class Work
      attr_accessor :success_count, :roll_back_data

      def initialize(batch, root_account, logger, messages)
        @batch = batch
        @root_account = root_account
        @logger = logger
        @messages = messages
        @success_count = 0
        @roll_back_data = []
        @tags_cache = {}
        @association_batch = []
      end

      def add_institutional_tag_association(tag_id, user_id, status, csv: nil, lineno: nil, row_info: nil)
        raise ImportError, "No institutional_tag_id given for an institutional tag association" if tag_id.blank?
        raise ImportError, "No user_id given for institutional tag association with tag #{tag_id}" if user_id.blank?
        raise ImportError, "No status given for institutional tag association (tag: #{tag_id}, user: #{user_id})" if status.blank?
        raise ImportError, "Improper status \"#{status}\" for institutional tag association (tag: #{tag_id}, user: #{user_id})" unless /\A(active|deleted)/i.match?(status)
        return if @batch.skip_deletes? && /deleted/i.match?(status)

        @association_batch << { tag_id:, user_id:, status:, csv:, lineno:, row_info: }
        process_batch if @association_batch.size >= BATCH_SIZE
      end

      def any_left_to_process?
        @association_batch.any?
      end

      def process_batch
        return unless any_left_to_process?

        batch = @association_batch.shift(BATCH_SIZE)

View on GitHub (pinned to 1c9f0bb801)