instructure/canvas-lms · error · ImportError

No status given for #

Error message

No status given for #{type_display} #{sis_id}

What it means

SIS CSV import validation in GroupCategoryImporter: when importing a group category or differentiation tag set, the row's `status` column is blank. The importer refuses to guess whether the record should be created, updated, or deleted, so it raises ImportError and aborts the row.

Solutions

  1. Add a status value ('active' or 'deleted') to every group_categorys.csv / differentiation_tag_sets.csv row before import.
  2. Fix the upstream export script to always emit the status column.
  3. If you control the caller, default a nil status to 'active' before calling add_group_category / add_differentiation_tag_set.

Example fix

// before (CSV row)
gc-1,Math Groups,My Course,,
// after
gc-1,Math Groups,My Course,,active
Defensive patterns

Strategy: validation

Validate before calling

if status.blank?
  raise ArgumentError, 'group category row must include status (active|deleted)'
end
# or pre-check before calling the importer:
# rows.all? { |r| !r['status'].to_s.empty? } or abort

Try / catch

begin
  importer.add_group_category(sis_id, acct_id, course_id, name, status)
rescue SIS::GroupCategoryImporter::ImportError => e
  Rails.logger.warn("skipped row: #{e.message}")
end

Prevention

When it happens

Trigger: Calling add_group_category(sis_id, account_id, course_id, category_name, status) or add_differentiation_tag_set(sis_id, course_id, set_name, status) with a nil/empty status — typically a group_categorys.csv or differentiation_tag_sets.csv row whose status column is empty.

Common situations: Hand-edited SIS CSV exports where the status column was deleted; export tools that omit trailing empty columns; users creating new rows and forgetting the required 'active' status.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


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

Appendix: source

Thrown at lib/sis/group_category_importer.rb:47

    end

    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

View on GitHub (pinned to 1c9f0bb801)