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

feature flag is disabled

Error message

feature flag is disabled

What it means

The updateInstitutionalTagCategory mutation raises this GraphQL::ExecutionError when the :institutional_tags feature flag is not enabled on the domain root account. Canvas gates institutional tag functionality behind this root-account feature flag, and the mutation refuses to run without it. It is an intentional guard, not a bug.

Solutions

  1. Enable the flag: in a Rails console run Account.find(<root_account_id>).enable_feature!(:institutional_tags) or via the account Settings > Feature Options UI.
  2. Confirm you are hitting the correct Canvas domain so context[:domain_root_account] is the intended account.
  3. If the flag should be on but isn't, check account-level vs site-admin flag inheritance and any environment-specific flag settings.

Example fix

// Rails console
# before: flag off
# after
account = Account.default
account.enable_feature!(:institutional_tags)
Defensive patterns

Strategy: validation

Validate before calling

// Rails console pre-check
raise 'flag off' unless root_account.feature_enabled?(:institutional_tags)
// client-side: read flag state via account.featureFlags query before calling

Type guard

function canMutate(account) { return account?.featureFlags?.some(f => f.flag === 'institutional_tags' && f.state === 'allowed') ?? false }

Prevention

When it happens

Trigger: Calling updateInstitutionalTagCategory on an account where root_account.feature_enabled?(:institutional_tags) returns false — the flag was never enabled, was disabled after being on, or the request resolves to a root account (e.g. via domain) that lacks the flag.

Common situations: Testing against a local/dev account where the flag is off, a Canvas instance or shard where institutional_tags hasn't been rolled out, or a request hitting the wrong domain root account due to hostname configuration.

Related errors


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

Appendix: source

Thrown at app/graphql/mutations/update_institutional_tag_category.rb:36

# with this program. If not, see <http://www.gnu.org/licenses/>.
#

# NOTE: Depends on InstitutionalTagCategory model (app/models/institutional_tag_category.rb)

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

    field :institutional_tag_category, Types::InstitutionalTagCategoryType, 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)

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

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

      if category.update(attrs)
        { institutional_tag_category: category }
      else
        errors_for(category)
      end
    rescue ActiveRecord::RecordInvalid
      errors_for(category)
    rescue ActiveRecord::RecordNotFound
      raise GraphQL::ExecutionError, "not found"

View on GitHub (pinned to 1c9f0bb801)