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

feature flag is disabled

Error message

feature flag is disabled

What it means

The updateInstitutionalTagArchivedState mutation first requires the :institutional_tags feature flag on the domain root account. If the flag is disabled, it raises GraphQL::ExecutionError "feature flag is disabled" before checking permissions or loading the tag.

Solutions

  1. Enable the institutional_tags feature flag on the target root account (Rails console: account.enable_feature! :institutional_tags or via account feature flags UI).
  2. Confirm which root account the request resolves to and that the flag is set there, not on a different account.
  3. Gate the archive UI behind the same feature flag availability query.
  4. Check config/feature_flags to ensure the flag is not marked hidden or removed.
Defensive patterns

Strategy: validation

Validate before calling

// confirm flag before archive/restore
const flags = await fetchAccountFeatureFlags(rootAccountId)
if (!flags.includes('institutional_tags')) throw new Error('institutional_tags disabled')

Try / catch

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

Prevention

When it happens

Trigger: Calling updateInstitutionalTagArchivedState on an account where institutional_tags is off (never enabled, or turned off), or when the request resolves to a root account that lacks the flag even though the tag exists elsewhere.

Common situations: Flag rolled out only to some environments/accounts but clients calling it broadly; environment mismatch (beta vs production); testing an archive flow before enabling the flag locally.

Related errors


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

Appendix: source

Thrown at app/graphql/mutations/update_institutional_tag_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 InstitutionalTag and InstitutionalTagAssociation models

module Mutations
  class UpdateInstitutionalTagArchivedState < BaseMutation
    argument :archived, Boolean, required: true
    argument :id,
             ID,
             required: true,
             prepare: GraphQLHelpers.relay_or_legacy_id_prepare_func("InstitutionalTag")

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

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

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

View on GitHub (pinned to 1c9f0bb801)