instructure/canvas-lms · error · GraphQL::ExecutionError

feature flag is disabled

Error message

feature flag is disabled

What it means

The updateInstitutionalTag mutation checks that the domain root account has the :institutional_tags feature enabled before doing anything else. If the flag is off, it raises GraphQL::ExecutionError "feature flag is disabled" regardless of arguments, so the mutation is a no-op that surfaces in the GraphQL errors array.

Solutions

  1. Enable the flag on the root account: Account.site_admin.set_feature_flag or account.feature_flags enable 'institutional_tags' (Rails console).
  2. Verify the request targets the intended domain/root account (check Host header / domain root account resolution).
  3. Confirm the flag still exists in config/feature_flags and is not hidden/off by default.
  4. Gate the client UI behind the same feature so the mutation is not called when disabled.

Example fix

// before
mutation { updateInstitutionalTag(input: { id: "...", name: "x" }) { ... } }
// after
// first check the flag via Rails console
root_account.feature_enabled?(:institutional_tags) # => true before calling the mutation
Defensive patterns

Strategy: validation

Validate before calling

// check flag availability before invoking
const flags = await fetchAccountFeatureFlags(rootAccountId)
if (!flags.includes('institutional_tags')) throw new Error('institutional_tags disabled on this account')

Try / catch

try {
  await updateInstitutionalTag(input)
} catch (e) {
  if (e.graphQLErrors?.some(g => g.message === 'feature flag is disabled')) {
    showFeatureDisabledNotice()
  } else { throw e }
}

Prevention

When it happens

Trigger: Calling updateInstitutionalTag on an account where the institutional_tags feature flag has never been enabled, or after the flag was turned off, or when context[:domain_root_account] points at an account without the flag while the tag was created on another account that had it.

Common situations: Deploying code that depends on institutional tags to an environment (test/beta/production) where the flag was not rolled out; a client environment pointing at the wrong account; flag cleaned up after being made obsolete.

Related errors


AI-assisted analysis of instructure/canvas-lms@1c9f0bb801 (2026-09-15). Data as JSON: /api/errors/7c2465a18060dec9. Report an issue: GitHub.

Appendix: source

Thrown at app/graphql/mutations/update_institutional_tag.rb:40

module Mutations
  class UpdateInstitutionalTag < BaseMutation
    argument :category_id,
             ID,
             required: false,
             prepare: GraphQLHelpers.relay_or_legacy_id_prepare_func("InstitutionalTagCategory")
    argument :description, String, required: false
    argument :id,
             ID,
             required: true,
             prepare: GraphQLHelpers.relay_or_legacy_id_prepare_func("InstitutionalTag")
    argument :name, String, required: false

    field :institutional_tag, Types::InstitutionalTagType, null: true

    def resolve(input:)
      root_account = context[:domain_root_account]
      raise GraphQL::ExecutionError, "feature flag is disabled" unless root_account.feature_enabled?(:institutional_tags)
      raise GraphQL::ExecutionError, "not authorized" unless root_account.grants_right?(current_user, session, :manage_institutional_tags_edit)

      tag = InstitutionalTag.where(root_account_id: root_account.id, workflow_state: "active").find_by(id: input[:id])
      raise GraphQL::ExecutionError, "not found" unless tag

      attrs = {}
      attrs[:name] = input[:name] if input.key?(:name)
      attrs[:description] = input[:description] if input.key?(:description)

      if input.key?(:category_id)
        category = root_account.institutional_tag_categories.where(workflow_state: "active").find_by(id: input[:category_id])
        raise GraphQL::ExecutionError, "not found" unless category

        attrs[:category_id] = category.id
      end

      if tag.update(attrs)
        { institutional_tag: tag }

View on GitHub (pinned to 1c9f0bb801)