{"record":{"id":"aff39cc7361194c5","repo":"instructure/canvas-lms","slug":"feature-flag-is-disabled-aff39c","errorCode":null,"errorMessage":"feature flag is disabled","messagePattern":"feature flag is disabled","errorType":"exception","errorClass":"GraphQL::ExecutionError","httpStatus":null,"severity":"error","filePath":"app/graphql/mutations/update_institutional_tag_category_archived_state.rb","lineNumber":35,"sourceCode":"# You should have received a copy of the GNU Affero General Public License along\n# with this program. If not, see <http://www.gnu.org/licenses/>.\n#\n\n# NOTE: Depends on InstitutionalTagCategory model (app/models/institutional_tag_category.rb)\n\nmodule Mutations\n  class UpdateInstitutionalTagCategoryArchivedState < BaseMutation\n    argument :archived, Boolean, required: true\n    argument :id,\n             ID,\n             required: true,\n             prepare: GraphQLHelpers.relay_or_legacy_id_prepare_func(\"InstitutionalTagCategory\")\n\n    field :institutional_tag_category, Types::InstitutionalTagCategoryType, null: true\n\n    def resolve(input:)\n      root_account = context[:domain_root_account]\n      raise GraphQL::ExecutionError, \"feature flag is disabled\" unless root_account.feature_enabled?(:institutional_tags)\n      raise GraphQL::ExecutionError, \"not authorized\" unless root_account.grants_right?(current_user, session, :manage_institutional_tags_edit)\n\n      category = root_account.institutional_tag_categories.find_by(id: input[:id])\n      raise GraphQL::ExecutionError, \"not found\" unless category\n\n      input[:archived] ? category.destroy : category.undestroy\n\n      { institutional_tag_category: category }\n    rescue ActiveRecord::RecordInvalid\n      errors_for(category)\n    rescue ActiveRecord::RecordNotFound\n      raise GraphQL::ExecutionError, \"not found\"\n    end\n  end\nend\n","sourceCodeStart":17,"sourceCodeEnd":51,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/app/graphql/mutations/update_institutional_tag_category_archived_state.rb#L17-L51","documentation":"updateInstitutionalTagCategoryArchivedState raises this GraphQL::ExecutionError when the :institutional_tags feature flag is disabled on the domain root account. Archiving/restoring institutional tag categories is gated behind the same feature flag as the other institutional tag mutations.","triggerScenarios":"Calling updateInstitutionalTagCategoryArchivedState on a root account where feature_enabled?(:institutional_tags) is false — flag never enabled, recently disabled, or request resolved to a different root account.","commonSituations":"Staging/dev environments without the flag enabled, rollout mismatch between environments, or misconfigured Canvas domain mapping to an account without the flag.","solutions":["Enable the flag on the root account (Rails console: account.enable_feature!(:institutional_tags) or account Settings > Feature Options).","Confirm the request domain maps to the intended root account.","Check flag inheritance if set at a higher (site admin) level."],"exampleFix":"// Rails console\n# before: disabled\n# after\nAccount.find(<id>).enable_feature!(:institutional_tags)","handlingStrategy":"validation","validationCode":"// Rails console pre-check\nraise 'flag off' unless root_account.feature_enabled?(:institutional_tags)","typeGuard":"function flagEnabled(account) { return account?.featureFlags?.some(f => f.flag === 'institutional_tags' && f.state !== 'off') ?? false }","tryCatchPattern":null,"preventionTips":["Enable institutional_tags on all accounts where archive tooling runs","Verify the Canvas domain resolves to the expected root account","Gate UI entry points behind the same feature flag query","Keep flag configs in sync across environments"],"tags":["graphql","feature-flag","configuration"],"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"}