gitlabhq/gitlabhq · error · Feature::InvalidOperation

Opt-out exists for #{target_name} - remove opt-out before en

Error message

Opt-out exists for #{target_name} - remove opt-out before enabling

What it means

Error "Opt-out exists for #{target_name} - remove opt-out before enabling" thrown in gitlabhq/gitlabhq.

Source

Thrown at app/services/admin/set_feature_flag_service.rb:88

                "Cannot set '#{name}' (#{key.inspect}) to #{value.inspect}"
              else
                "Cannot set '#{name}' to #{value.inspect}"
              end

        raise UnknownOperationError, msg
      end
    end

    def remove_opt_out(target)
      raise Feature::InvalidOperation, "No opt-out exists for #{target}" unless Feature.opted_out?(name, target)

      Feature.remove_opt_out(name, target)
    end

    def enable(target)
      if Feature.opted_out?(name, target)
        target_name = target.respond_to?(:to_reference) ? target.to_reference : target.to_s
        raise Feature::InvalidOperation, "Opt-out exists for #{target_name} - remove opt-out before enabling"
      end

      Feature.enable(name, target)
    end

    def value
      params[:value]
    end

    def key
      params[:key]
    end

    def numeric_value?
      params[:value].match?(/^\d+(\.\d+)?$/)
    end

    def percentage

View on GitHub (pinned to 55ee20384a)

When it happens

Trigger: Thrown at app/services/admin/set_feature_flag_service.rb:88 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of gitlabhq/gitlabhq@55ee20384a (2026-08-21). Data as JSON: /api/errors/a07af51056e5c3b1. Report an issue: GitHub.