{"record":{"id":"2be93819a0adebd4","repo":"instructure/canvas-lms","slug":"no-status-given-for-type-display-sis-id","errorCode":null,"errorMessage":"No status given for #{type_display} #{sis_id}","messagePattern":"No status given for #(.+?) #(.+?)","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"lib/sis/group_category_importer.rb","lineNumber":47,"sourceCode":"    end\n\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","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/lib/sis/group_category_importer.rb#L29-L65","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Add a status value ('active' or 'deleted') to every group_categorys.csv / differentiation_tag_sets.csv row before import.","Fix the upstream export script to always emit the status column.","If you control the caller, default a nil status to 'active' before calling add_group_category / add_differentiation_tag_set."],"exampleFix":"// before (CSV row)\ngc-1,Math Groups,My Course,,\n// after\ngc-1,Math Groups,My Course,,active","handlingStrategy":"validation","validationCode":"if status.blank?\n  raise ArgumentError, 'group category row must include status (active|deleted)'\nend\n# or pre-check before calling the importer:\n# rows.all? { |r| !r['status'].to_s.empty? } or abort","typeGuard":null,"tryCatchPattern":"begin\n  importer.add_group_category(sis_id, acct_id, course_id, name, status)\nrescue SIS::GroupCategoryImporter::ImportError => e\n  Rails.logger.warn(\"skipped row: #{e.message}\")\nend","preventionTips":["Validate CSV headers/rows with a schema check before import","Always emit the status column in exports, even when empty per-row","Default new rows to status=active in your export tooling"],"tags":["sis","csv-import","validation","missing-field"],"backgroundTag":"empty-required-field","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"}