instructure/canvas-lms · error · ImportError

Improper status "# " for institutional tag #

Error message

Improper status "#{status}" for institutional tag #{tag_id}

What it means

Validation guard in InstitutionalTagImporter::Work#add_institutional_tag raised when the status argument is present but not one of the recognized workflow states (e.g. active/deleted). This is a value-format error, not a missing-field error: the CSV supplied an unrecognized status string.

Solutions

  1. Use 'active' or 'deleted' as status
  2. Correct the CSV and re-run the SIS batch
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at lib/sis/institutional_tag_importer.rb:48 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/68e871c5064ae0be. Report an issue: GitHub.

Appendix: source

Thrown at lib/sis/institutional_tag_importer.rb:48

    class Work
      attr_accessor :success_count, :roll_back_data

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

      def add_institutional_tag(tag_id, category_id, name, description, status)
        raise ImportError, "No institutional_tag_id given for an institutional tag" if tag_id.blank?
        raise ImportError, "No category_id given for institutional tag #{tag_id}" if category_id.blank?
        raise ImportError, "No name given for institutional tag #{tag_id}" if name.blank?
        raise ImportError, "No description given for institutional tag #{tag_id}" if description.blank?
        raise ImportError, "No status given for institutional tag #{tag_id}" if status.blank?
        raise ImportError, "Improper status \"#{status}\" for institutional tag #{tag_id}" unless /\A(active|deleted)/i.match?(status)
        return if @batch.skip_deletes? && /deleted/i.match?(status)

        category = @categories_cache[category_id]
        category ||= InstitutionalTagCategory.find_by(root_account_id: @root_account.id, sis_source_id: category_id)
        raise ImportError, "Category with id \"#{category_id}\" didn't exist for institutional tag #{tag_id}" unless category

        @categories_cache[category_id] = category

        tag = InstitutionalTag.find_by(root_account_id: @root_account.id, sis_source_id: tag_id)
        tag ||= InstitutionalTag.new(category:,
                                     root_account: @root_account,
                                     sis_source_id: tag_id)

        tag.name = name
        tag.description = description
        tag.sis_batch_id = @batch.id
        tag.workflow_state = /deleted/i.match?(status) ? "deleted" : "active"

View on GitHub (pinned to 1c9f0bb801)