instructure/canvas-lms · error · ImportError

Improper status "# " for # # , skipping

Error message

Improper status "#{status}" for #{type_display} #{sis_id}, skipping

What it means

GroupCategoryImporter validates that a group category / differentiation tag set row's status starts with 'active' or 'deleted' (case-insensitive). Any other string — a typo, a status borrowed from another importer's vocabulary, or whitespace-polluted text — raises ImportError and skips the record.

Solutions

  1. Change the status to exactly 'active' or 'deleted' (case-insensitive, no leading/trailing spaces).
  2. If you intended deletion semantics of a group membership-style record, note categories only accept 'active'/'deleted' — not 'completed' or 'closed'.
  3. Strip whitespace/BOM from CSV columns in the export pipeline before import.

Example fix

// before
gc-1,Math Groups,My Course,,archived
// after
gc-1,Math Groups,My Course,,deleted
Defensive patterns

Strategy: validation

Validate before calling

ALLOWED = %w[active deleted]
unless status.to_s.match?(/\A(active|deleted)\z/i)
  raise ArgumentError, "status must be active or deleted, got: #{status.inspect}"
end

Try / catch

begin
  importer.add_differentiation_tag_set(sis_id, course_id, name, status)
rescue SIS::GroupCategoryImporter::ImportError => e
  errors << e.message # collect and report after batch
end

Prevention

When it happens

Trigger: add_group_category(...) or add_differentiation_tag_set(...) called with status like 'archived', 'deactive', 'AVAILABLE', ' active' (leading space), or any value not matching /\A(active|deleted)/i.

Common situations: Mixing up status vocabularies: the group importer accepts (available|closed|completed|deleted) while the category importer only accepts (active|deleted); copying a row from groups.csv into group_categorys.csv; CSV values with stray spaces or BOM characters.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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

Appendix: source

Thrown at lib/sis/group_category_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 = []
        @accounts_cache = {}
        @courses_cache = {}
      end

      def invalid_category?(sis_id, name, status, type_display)
        raise ImportError, "No sis_id given for a #{type_display}" if sis_id.blank?
        raise ImportError, "No name given for #{type_display} #{sis_id}" if name.blank?
        raise ImportError, "No status given for #{type_display} #{sis_id}" if status.blank?
        raise ImportError, "Improper status \"#{status}\" for #{type_display} #{sis_id}, skipping" unless /\A(active|deleted)/i.match?(status)
        return true if @batch.skip_deletes? && status =~ /deleted/i

        false
      end

      def find_context(account_id, course_id, sis_id, type_display)
        context = nil
        if account_id && course_id
          raise ImportError, "Only one context is allowed and both course_id and account_id where provided for #{type_display} #{sis_id}."
        end

        if account_id
          context = @accounts_cache[account_id]
          context ||= @root_account.all_accounts.active.find_by(sis_source_id: account_id)
          raise ImportError, "Account with id \"#{account_id}\" didn't exist for #{type_display} #{sis_id}" unless context

          @accounts_cache[context.sis_source_id] = context
        end

View on GitHub (pinned to 1c9f0bb801)