{"record":{"id":"2cde42fa01a2231f","repo":"instructure/canvas-lms","slug":"custom-gradebook-statuses-feature-flag-is-disabled-set","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/set_override_status.rb","lineNumber":28,"sourceCode":"# 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 SetOverrideStatus < BaseMutation\n    argument :custom_grade_status_id, ID, required: false, default_value: nil\n    argument :enrollment_id, ID, required: true\n    argument :grading_period_id, ID, required: false, default_value: nil\n    field :grades, Types::GradesType, 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      score = score(input:)\n      unless score.grants_right?(current_user, session, :update_custom_status)\n        raise GraphQL::ExecutionError, I18n.t(\"Insufficient permissions\")\n      end\n\n      enrollment = Enrollment.find_by(id: input[:enrollment_id])\n      custom_grade_status = get_custom_grade_status(input:)\n      grading_period_id = input[:grading_period_id]\n\n      updated_score = enrollment.update_override_status(custom_grade_status:, grading_period_id:)\n      InstStatsd::Statsd.distributed_increment(\"custom_grade_status.applied_to.final_grade\")\n      { grades: updated_score }\n    rescue ActiveRecord::RecordNotFound => e\n      raise GraphQL::ExecutionError, \"#{e.model} not found\"\n    rescue ActiveRecord::RecordInvalid => e\n      errors_for(e.record)\n    end","sourceCodeStart":10,"sourceCodeEnd":46,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/app/graphql/mutations/set_override_status.rb#L10-L46","documentation":"SetOverrideStatus requires the custom_gradebook_statuses feature flag to be enabled on the site-admin account. resolve raises immediately if Account.site_admin.feature_enabled?(:custom_gradebook_statuses) is false — the mutation is entirely gated on this flag.","triggerScenarios":"Any setOverrideStatus mutation call while the custom_gradebook_statuses feature flag is off for site admin, regardless of arguments.","commonSituations":"Self-hosted or new Canvas instance where the flag was never enabled; flag was recently turned off after a rollout decision; testing against an environment with default flags.","solutions":["Enable the flag: in a Rails console run Account.site_admin.enable_feature! :custom_gradebook_statuses, or via Site Admin > Feature Options in the UI","Upgrade to a Canvas version where the flag exists/enabled by default if it is absent","Remove or gate the client call behind the same flag check"],"exampleFix":"// before\ncustomGradeStatus(enrollmentId: 12, customGradeStatusId: 3)\n// after\n// only when Account.site_admin.feature_enabled?(:custom_gradebook_statuses)\nAccount.site_admin.enable_feature! :custom_gradebook_statuses\ncustomGradeStatus(enrollmentId: 12, customGradeStatusId: 3)","handlingStrategy":"validation","validationCode":"// Ruby\nflag_on = Account.site_admin.feature_enabled?(:custom_gradebook_statuses)","typeGuard":null,"tryCatchPattern":"// Ruby\nbegin\n  mutation\nrescue GraphQL::ExecutionError => e\n  disable_custom_status_ui if e.message.include?(\"feature flag is disabled\")\nend","preventionTips":["Check the flag in Site Admin > Feature Options before shipping UI that calls this mutation","Gate client code behind the same flag query returned via the API","Keep environments' flag settings in sync to avoid test/prod divergence"],"tags":["graphql","ruby","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"}