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

feature flag is disabled

Error message

feature flag is disabled

What it means

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.

Solutions

  1. Enable the flag on the root account (Rails console: account.enable_feature!(:institutional_tags) or account Settings > Feature Options).
  2. Confirm the request domain maps to the intended root account.
  3. Check flag inheritance if set at a higher (site admin) level.

Example fix

// Rails console
# before: disabled
# after
Account.find(<id>).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)

Type guard

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

Prevention

When it happens

Trigger: 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.

Common situations: Staging/dev environments without the flag enabled, rollout mismatch between environments, or misconfigured Canvas domain mapping to an account without the flag.

Related errors


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

Appendix: source

Thrown at app/graphql/mutations/update_institutional_tag_category_archived_state.rb:35

# You should have received a copy of the GNU Affero General Public License along
# 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 UpdateInstitutionalTagCategoryArchivedState < BaseMutation
    argument :archived, Boolean, required: true
    argument :id,
             ID,
             required: true,
             prepare: GraphQLHelpers.relay_or_legacy_id_prepare_func("InstitutionalTagCategory")

    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.find_by(id: input[:id])
      raise GraphQL::ExecutionError, "not found" unless category

      input[:archived] ? category.destroy : category.undestroy

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

View on GitHub (pinned to 1c9f0bb801)