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

custom gradebook statuses feature flag is disabled

Error message

custom gradebook statuses feature flag is disabled

What it means

Raised by the UpsertStandardGradeStatus mutation when the :custom_gradebook_statuses feature flag is not enabled on Account.site_admin. The mutation refuses to run at all, raising a GraphQL::ExecutionError before any permission or lookup logic executes.

Solutions

  1. Enable the flag: in Rails console run Account.site_admin.enable_feature!(:custom_gradebook_statuses) or use the site-admin Feature Options UI
  2. Confirm the flag on the correct environment (site admin account, not a sub-account)
  3. Gate the client-side call behind the same flag check so the mutation is never invoked when disabled
  4. Contact Canvas support/admin if the flag is unavailable on a hosted instance

Example fix

// before
await updateStandardGradeStatus({ name: "mastery", color: "#00AA00" })
// after
if (ENV.featureFlags.customGradebookStatuses) {
  await updateStandardGradeStatus({ name: "mastery", color: "#00AA00" })
}
Defensive patterns

Strategy: try-catch

Validate before calling

if (!ENV.featureFlags?.customGradebookStatuses) {
  throw new Error('mutation unavailable: custom_gradebook_statuses flag disabled')
}

Try / catch

try {
  await client.mutate(UPSERT_STANDARD_GRADE_STATUS, vars)
} catch (e) {
  if (/feature flag is disabled/.test(e.message)) {
    disableUiFeature()
  } else throw e
}

Prevention

When it happens

Trigger: Calling upsertStandardGradeStatus (create or update by id) while the site-admin account feature flag custom_gradebook_statuses is disabled for the current context.

Common situations: Testing against a Canvas instance where the feature was never enabled; flag enabled on one environment but not another; UI shipped before the flag was turned on; flag rolled back after an incident.

Related errors


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

Appendix: source

Thrown at app/graphql/mutations/upsert_standard_grade_status.rb:28

# Software Foundation, version 3 of the License.
#
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# 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/>.
#
module Mutations
  class UpsertStandardGradeStatus < BaseMutation
    argument :color, String, required: true
    argument :id, ID, required: false
    argument :name, String, required: true
    field :standard_grade_status, Types::StandardGradeStatusType, null: true

    def resolve(input:)
      raise GraphQL::ExecutionError, "custom gradebook statuses feature flag is disabled" unless Account.site_admin.feature_enabled?(:custom_gradebook_statuses)

      root_account = context[:domain_root_account]
      standard_grade_status = input[:id] ? root_account.standard_grade_statuses.find_by!(id: input[:id], status_name: input[:name]) : StandardGradeStatus.new(root_account:, status_name: input[:name])

      required_permission = standard_grade_status.new_record? ? :create : :update
      unless standard_grade_status.grants_right?(current_user, session, required_permission)
        raise GraphQL::ExecutionError, I18n.t("Insufficient permissions")
      end

      if standard_grade_status.update(color: input[:color])
        { standard_grade_status: }
      else
        errors_for(standard_grade_status)
      end
    rescue ActiveRecord::RecordNotFound
      raise GraphQL::ExecutionError, "standard grade status not found"
    end
  end

View on GitHub (pinned to 1c9f0bb801)