{"record":{"id":"5621a07027b7a01d","repo":"instructure/canvas-lms","slug":"custom-gradebook-statuses-feature-flag-is-disabled","errorCode":null,"errorMessage":"custom gradebook statuses feature flag is disabled","messagePattern":"custom gradebook statuses feature flag is disabled","errorType":"exception","errorClass":"GraphQL::ExecutionError","httpStatus":null,"severity":"error","filePath":"app/graphql/mutations/delete_custom_grade_status.rb","lineNumber":26,"sourceCode":"# Canvas is free software: you can redistribute it and/or modify it under\n# the terms of the GNU Affero General Public License as published by the Free\n# Software Foundation, version 3 of the License.\n#\n# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY\n# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR\n# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more\n# details.\n#\n# 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#\nmodule Mutations\n  class DeleteCustomGradeStatus < BaseMutation\n    argument :id, ID, required: true\n    field :custom_grade_status_id, ID, null: true\n\n    def resolve(input:)\n      raise GraphQL::ExecutionError, \"custom gradebook statuses feature flag is disabled\" unless Account.site_admin.feature_enabled?(:custom_gradebook_statuses)\n\n      custom_grade_status = CustomGradeStatus.active.find(input[:id])\n\n      unless custom_grade_status.grants_right?(current_user, session, :delete)\n        raise GraphQL::ExecutionError, I18n.t(\"Insufficient permissions\")\n      end\n\n      context[:deleted_models] ||= {}\n      context[:deleted_models][:custom_grade_status] = custom_grade_status\n      custom_grade_status_id = custom_grade_status.id\n      custom_grade_status.deleted_by = current_user\n      custom_grade_status.destroy\n\n      InstStatsd::Statsd.distributed_increment(\"custom_grade_status.graphql.delete\")\n\n      { custom_grade_status_id: }\n    rescue ActiveRecord::RecordNotFound\n      raise GraphQL::ExecutionError, \"custom grade status not found\"","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/app/graphql/mutations/delete_custom_grade_status.rb#L8-L44","documentation":"GraphQL::ExecutionError raised in Mutations::DeleteCustomGradeStatus#resolve when the site-admin feature flag custom_gradebook_statuses is not enabled. The mutation refuses to run entirely unless Account.site_admin has that flag on.","triggerScenarios":"Calling deleteCustomGradeStatus in any account/site where Account.site_admin.feature_enabled?(:custom_gradebook_statuses) is false.","commonSituations":"Self-hosted or regional Canvas installs where the flag was never enabled; environments where the flag was recently turned off; staging vs production flag divergence.","solutions":["Enable the custom_gradebook_statuses feature flag on the site admin account","Confirm you are on the intended environment/site where the flag is on","If the feature is not meant to be used, remove the client code calling this mutation","Check via Rails console: Account.site_admin.feature_enabled?(:custom_gradebook_statuses)"],"exampleFix":"// before\nmutation { deleteCustomGradeStatus(id: \"5\") { customGradeStatusId } } # flag off\n// after\n# Rails console\nAccount.site_admin.set_feature_flag!('custom_gradebook_statuses', 'on')","handlingStrategy":"validation","validationCode":"const enabled = await fetchFeatureFlag('site_admin', 'custom_gradebook_statuses')\nif (!enabled) throw new Error('custom gradebook statuses disabled')","typeGuard":null,"tryCatchPattern":"try {\n  await deleteCustomGradeStatus(id)\n} catch (e) {\n  if (/feature flag is disabled/.test(e.message)) disableFeatureUI()\n}","preventionTips":["Sync feature-flag state to the client","Verify flag state via Rails console before rollout","Keep staging/production flag configs in sync"],"tags":["graphql","feature-flag","gradebook"],"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"}