{"record":{"id":"149894ac5eb84fb5","repo":"instructure/canvas-lms","slug":"improper-status-status-for-type-display-sis-id-skipping","errorCode":null,"errorMessage":"Improper status \"#{status}\" for #{type_display} #{sis_id}, skipping","messagePattern":"Improper status \"#(.+?)\" for #(.+?) #(.+?), skipping","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"lib/sis/group_category_importer.rb","lineNumber":48,"sourceCode":"\n    class Work\n      attr_accessor :success_count, :roll_back_data\n\n      def initialize(batch, root_account, logger)\n        @batch = batch\n        @root_account = root_account\n        @logger = logger\n        @success_count = 0\n        @roll_back_data = []\n        @accounts_cache = {}\n        @courses_cache = {}\n      end\n\n      def invalid_category?(sis_id, name, status, type_display)\n        raise ImportError, \"No sis_id given for a #{type_display}\" if sis_id.blank?\n        raise ImportError, \"No name given for #{type_display} #{sis_id}\" if name.blank?\n        raise ImportError, \"No status given for #{type_display} #{sis_id}\" if status.blank?\n        raise ImportError, \"Improper status \\\"#{status}\\\" for #{type_display} #{sis_id}, skipping\" unless /\\A(active|deleted)/i.match?(status)\n        return true if @batch.skip_deletes? && status =~ /deleted/i\n\n        false\n      end\n\n      def find_context(account_id, course_id, sis_id, type_display)\n        context = nil\n        if account_id && course_id\n          raise ImportError, \"Only one context is allowed and both course_id and account_id where provided for #{type_display} #{sis_id}.\"\n        end\n\n        if account_id\n          context = @accounts_cache[account_id]\n          context ||= @root_account.all_accounts.active.find_by(sis_source_id: account_id)\n          raise ImportError, \"Account with id \\\"#{account_id}\\\" didn't exist for #{type_display} #{sis_id}\" unless context\n\n          @accounts_cache[context.sis_source_id] = context\n        end","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/lib/sis/group_category_importer.rb#L30-L66","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Change the status to exactly 'active' or 'deleted' (case-insensitive, no leading/trailing spaces).","If you intended deletion semantics of a group membership-style record, note categories only accept 'active'/'deleted' — not 'completed' or 'closed'.","Strip whitespace/BOM from CSV columns in the export pipeline before import."],"exampleFix":"// before\ngc-1,Math Groups,My Course,,archived\n// after\ngc-1,Math Groups,My Course,,deleted","handlingStrategy":"validation","validationCode":"ALLOWED = %w[active deleted]\nunless status.to_s.match?(/\\A(active|deleted)\\z/i)\n  raise ArgumentError, \"status must be active or deleted, got: #{status.inspect}\"\nend","typeGuard":null,"tryCatchPattern":"begin\n  importer.add_differentiation_tag_set(sis_id, course_id, name, status)\nrescue SIS::GroupCategoryImporter::ImportError => e\n  errors << e.message # collect and report after batch\nend","preventionTips":["Remember category status vocabulary is only active/deleted — do not copy group status values (available/closed/completed)","Normalize/strip whitespace from CSV cells before import","Add an enum dropdown to any UI that generates these CSVs"],"tags":["sis","csv-import","validation","invalid-enum"],"backgroundTag":"invalid-enum-value","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"}