{"record":{"id":"ae72a08c3214f1b1","repo":"instructure/canvas-lms","slug":"differentiation-tags-are-not-enabled-for-account-context","errorCode":null,"errorMessage":"Differentiation Tags are not enabled for Account #{context.account.id}.","messagePattern":"Differentiation Tags are not enabled for Account #(.+?)\\.","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"lib/sis/group_category_importer.rb","lineNumber":136,"sourceCode":"\n        check_context_movement(gc, context, sis_id, \"group category\")\n\n        gc ||= context.group_categories.new\n        gc.name = category_name\n        gc.context = context\n        gc.root_account_id = @root_account.id\n        gc.sis_source_id = sis_id\n        gc.sis_batch_id = @batch.id\n\n        apply_status(gc, status)\n        save_category(gc, sis_id, \"group category\")\n      end\n\n      def add_differentiation_tag_set(sis_id, course_id, set_name, status)\n        return if invalid_category?(sis_id, set_name, status, \"differentiation tag set\")\n\n        context = find_context(nil, course_id, sis_id, \"differentiation tag set\")\n        raise ImportError, \"Differentiation Tags are not enabled for Account #{context.account.id}.\" unless context.account.allow_assign_to_differentiation_tags?\n\n        tag_set = @root_account.all_differentiation_tag_categories.find_by(sis_source_id: sis_id)\n\n        check_context_movement(tag_set, context, sis_id, \"differentiation tag set\")\n\n        tag_set ||= context.differentiation_tag_categories.new\n        tag_set.name = set_name\n        tag_set.context = context\n        tag_set.root_account_id = @root_account.id\n        tag_set.sis_source_id = sis_id\n        tag_set.non_collaborative = true\n        tag_set.sis_batch_id = @batch.id\n\n        apply_status(tag_set, status)\n        save_category(tag_set, sis_id, \"differentiation tag set\")\n      end\n\n      def build_data(category)","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/lib/sis/group_category_importer.rb#L118-L154","documentation":"add_differentiation_tag_set requires the 'Assign to Differentiation Tags' feature (allow_assign_to_differentiation_tags?) to be enabled on the owning account. When the resolved context's account has the feature off, the importer raises ImportError rather than creating tag sets for a disabled feature.","triggerScenarios":"add_differentiation_tag_set imports (differentiation_tag_sets.csv rows) into a course whose root/owning account has allow_assign_to_differentiation_tags? == false — i.e., the differentiation tags feature flag is disabled at the account level.","commonSituations":"Copying an import bundle from an instance/account with differentiation tags enabled to one where it's off; account admins turning the feature off while scheduled SIS jobs still emit tag-set rows; sub-accounts with differing flag states.","solutions":["Enable the differentiation tags feature flag on the target account (account settings / feature flags).","Remove differentiation_tag_sets.csv rows from the import bundle if the feature should stay off.","Point the import at a course under an account where the feature is enabled."],"exampleFix":"// before (account flag off)\n# rails console\naccount.allow_assign_to_differentiation_tags? # => false\n// after\naccount.update!(allow_assign_to_differentiation_tags: true)","handlingStrategy":"validation","validationCode":"unless context.account.allow_assign_to_differentiation_tags?\n  raise ArgumentError, \"differentiation tags disabled for account #{context.account.id}\"\nend","typeGuard":null,"tryCatchPattern":"begin\n  importer.add_differentiation_tag_set(sis_id, course_id, name, status)\nrescue SIS::GroupCategoryImporter::ImportError => e\n  if e.message =~ /Differentiation Tags are not enabled/ then skip_bundle_section\n  else raise end\nend","preventionTips":["Check the account feature flag before shipping tag-set imports to an instance","Coordinate with admins before turning the flag off while SIS jobs are active","Gate tag-set CSV generation on the flag so files are only produced where usable"],"tags":["sis","csv-import","feature-flag","differentiation-tags"],"backgroundTag":"feature-not-enabled","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"}