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
The UpsertCustomGradeStatus GraphQL mutation is gated behind the :custom_gradebook_statuses feature flag on Account.site_admin. resolve checks the flag first and raises this GraphQL::ExecutionError when the flag is off, refusing to create or update custom gradebook statuses.
Solutions
- Enable the feature flag: in a Rails console run Account.site_admin.enable_feature! :custom_gradebook_statuses (or via the site admin feature settings UI)
- Verify the flag state with Account.site_admin.feature_enabled?(:custom_gradebook_statuses)
- If the feature should not be used, stop calling the mutation and use standard gradebook statuses
Example fix
// before (Rails console) # flag off, mutation fails // after Account.site_admin.enable_feature! :custom_gradebook_statuses Account.site_admin.feature_enabled?(:custom_gradebook_statuses) # => true
Defensive patterns
Strategy: try-catch
Validate before calling
// Rails console Account.site_admin.feature_enabled?(:custom_gradebook_statuses) # must be true before calling the mutation
Try / catch
try {
await upsertCustomGradeStatus(input);
} catch (e) {
if (e.message.includes("feature flag is disabled")) {
notifyAdminToEnableFlag("custom_gradebook_statuses");
}
} Prevention
- Check the flag in the target environment before shipping UI that calls this mutation
- Document flag dependencies for GraphQL-backed features
- Use the feature-flag state from the environment query to hide the UI entry point
When it happens
Trigger: Calling the upsertCustomGradeStatus mutation in any account/shard where Account.site_admin.feature_enabled?(:custom_gradebook_statuses) is false.
Common situations: Testing the mutation in a development or staging environment before the flag is enabled; production rollout not yet complete; flag enabled only for some root accounts but the check is site-admin level.
Related errors
- feature flag is disabled
- Insufficient permissions
- Insufficient permissions
- peer_review_allocation_and_grading feature flag is not…
- ActiveRecord::RecordNotFound
AI-assisted analysis of instructure/canvas-lms@1c9f0bb801 (2026-09-15).
Data as JSON: /api/errors/f905ad73894c1cde.
Report an issue: GitHub.
Appendix: source
Thrown at app/graphql/mutations/upsert_custom_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 UpsertCustomGradeStatus < BaseMutation
argument :color, String, required: true
argument :id, ID, required: false
argument :name, String, required: true
field :custom_grade_status, Types::CustomGradeStatusType, 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]
custom_grade_status = input[:id] ? root_account.custom_grade_statuses.active.find(input[:id]) : CustomGradeStatus.new(root_account:, created_by: current_user)
required_permission = custom_grade_status.new_record? ? :create : :update
unless custom_grade_status.grants_right?(current_user, session, required_permission)
raise GraphQL::ExecutionError, I18n.t("Insufficient permissions")
end
if custom_grade_status.new_record?
InstStatsd::Statsd.distributed_increment("custom_grade_status.graphql.create")
else
InstStatsd::Statsd.distributed_increment("custom_grade_status.graphql.update")
end
if custom_grade_status.update(name: input[:name], color: input[:color])
{ custom_grade_status: }
elseView on GitHub (pinned to 1c9f0bb801)