{"record":{"id":"c00e81728ef91410","repo":"instructure/canvas-lms","slug":"improper-status-status-for-type-display-name-type-id","errorCode":null,"errorMessage":"Improper status \"#{status}\" for #{type_display_name(type)} #{id}.","messagePattern":"Improper status \"#(.+?)\" for #(.+?) #(.+?)\\.","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"lib/sis/group_importer.rb","lineNumber":55,"sourceCode":"        @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      private\n\n      def type_display_name(type)\n        type.tr(\"_\", \" \")\n      end\n\n      def invalid_import_item?(id, name, status, type)\n        raise ImportError, \"No #{(type == \"group\") ? type : \"tag\"}_id given for a #{type_display_name(type)}.\" unless id\n        raise ImportError, \"No name given for #{type_display_name(type)} #{id}.\" if name.blank?\n        raise ImportError, \"Improper status \\\"#{status}\\\" for #{type_display_name(type)} #{id}.\" unless /\\A(available|closed|completed|deleted)/i.match?(status)\n        return true if @batch.skip_deletes? && status =~ /deleted/i\n\n        false\n      end\n\n      def find_context(id, id_type, type, item_id)\n        context = nil\n        cache = (id_type == :course_id) ? @courses_cache : @accounts_cache\n\n        if id\n          context = cache[id]\n          context ||= if id_type == :course_id\n                        @root_account.all_courses.active.find_by(sis_source_id: id)\n                      else\n                        @root_account.all_accounts.active.find_by(sis_source_id: id)\n                      end\n\n          unless context","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/lib/sis/group_importer.rb#L37-L73","documentation":"Raised when the 'status' of a group or differentiation tag row is not one of the accepted SIS statuses: available, closed, completed, or deleted (case-insensitive). The importer enforces this vocabulary so downstream record state transitions are well-defined. The message echoes the invalid status plus the item type and id.","triggerScenarios":"add_group/add_tag receiving a status like 'active', '', 'unpublished', or a typo such as 'availible' — anything not matching /\\A(available|closed|completed|deleted)/i.","commonSituations":"Migrating CSVs from another LMS with different status names; typo'd statuses; translated status columns; legacy scripts emitting 'active' instead of 'available'.","solutions":["Change the status to one of: available, closed, completed, deleted.","Map source-system statuses to SIS statuses in your CSV generator.","Use 'deleted' to deactivate the group.","Validate the status column against the allowed pattern before upload."],"exampleFix":"# before\ngroup_id,course_id,name,status\nG101,C200,Study Group A,active\n# after\ngroup_id,course_id,name,status\nG101,C200,Study Group A,available","handlingStrategy":"validation","validationCode":"ALLOWED = %w[available closed completed deleted]\nunless ALLOWED.any? { |s| status.to_s.downcase.start_with?(s) }\n  raise ArgumentError, \"status must be one of #{ALLOWED.join(', ')}\"\nend","typeGuard":null,"tryCatchPattern":"begin\n  importer.add_group(gid, cat_id, acct_id, course_id, name, status)\nrescue ImportError => e\n  logger.warn(\"Bad status row: #{e.message}\")\nend","preventionTips":["Map foreign status vocabularies to SIS statuses before export","Whitelist status values in the CSV generator","Pre-validate against /\\A(available|closed|completed|deleted)/i","Never leave the status column blank"],"tags":["sis-import","enum-value","csv-validation"],"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"}