flippercloud/flipper · error · RuntimeError

#{data_type} is not supported by this adapter

Error message

#{data_type} is not supported by this adapter

What it means

flipper-redis stores boolean/integer values as strings under 'feature_key/gate_key' keys, sets as Redis sets, and json via Typecast; enable, disable, and result_for_feature call unsupported_data_type for any other data type (lib/flipper/adapters/redis.rb:212-215). flipper-redis is versioned separately from flipper core, so the common producer is Bundler resolving an older flipper-redis than the flipper core that runs expression gates — the expression gate reports data_type :json, which old adapter releases refuse.

Source

Thrown at lib/flipper/adapters/redis.rb:214

      # Private: Converts gate and thing to hash key.
      def to_field(gate, thing)
        "#{gate.key}/#{thing.value}"
      end

      # Private: Returns a set of values given an array of fields and a gate.
      #
      # Returns a Set of the values enabled for the gate.
      def fields_to_gate_value(fields, gate)
        regex = %r{^#{Regexp.escape(gate.key.to_s)}/}
        keys = fields.grep(regex)
        values = keys.map { |key| key.split('/', 2).last }
        values.to_set
      end

      # Private
      def unsupported_data_type(data_type)
        raise "#{data_type} is not supported by this adapter"
      end
    end
  end
end

Flipper.configure do |config|
  config.adapter do
    client = Redis.new(url: ENV["FLIPPER_REDIS_URL"] || ENV["REDIS_URL"] || "redis://localhost:6379")
    Flipper::Adapters::Redis.new(client)
  end
end

View on GitHub (pinned to 1f86de3ec9)

Solutions

  1. Align versions in lockstep: bundle update flipper flipper-redis (or pin both to the same release) so the adapter's enable/disable/result_for_feature include the :json branch.
  2. Add a boot assertion: Gem.loaded_specs['flipper-redis'].version == Gem.loaded_specs['flipper'].version.
  3. Until upgraded, avoid expression writes/reads on this app; if a newer writer already created flipper/* expression keys, DEL those keys or clear the features so old readers stop raising on get.
  4. For custom gates, use one of the four supported data types.

Example fix

# before — mismatched lockstep versions
gem 'flipper',       '~> 0.28.0'
gem 'flipper-redis', '~> 0.25.0'

# after — identical releases
gem 'flipper',       '~> 0.28.0'
gem 'flipper-redis', '~> 0.28.0'
Defensive patterns

Strategy: validation

Validate before calling

def assert_flipper_gems_aligned!
  core = Gem.loaded_specs.fetch('flipper').version
  adapter = Gem.loaded_specs.fetch('flipper-redis').version
  raise "flipper-redis #{adapter} != flipper #{core}; align both gems" unless core == adapter
end

assert_flipper_gems_aligned! # at boot, before enabling expressions

Type guard

def expression_writable?(feature)
  Gem.loaded_specs.fetch('flipper-redis').version >= Gem.loaded_specs.fetch('flipper').version &&
    feature.gates.all? { |g| %i[boolean integer set json].include?(g.data_type) }
end

Try / catch

begin
  feature.enable_expression(expr)
rescue RuntimeError => e
  raise unless e.message.end_with?('is not supported by this adapter')
  Flipper.logger.warn('flipper-redis lacks :json support; using percentage rollout instead')
  feature.enable_percentage_of_time(10)
end

Prevention

When it happens

Trigger: feature.enable_expression(expr) / feature.add_expression (or Cloud sync and the UI conditions editor) with a flipper-redis lockfile entry older than flipper core: enable/disable raise ':json is not supported by this adapter'. Reads raise too — feature.enabled? / flipper.enabled? hit result_for_feature, and one flipper/expression key already present in Redis is enough. Custom gates with novel data types trigger it on any version.

Common situations: Bumping flipper without bumping flipper-redis in the Gemfile; multiple apps (or a web app plus Sidekiq workers) sharing one Redis for flags where the newer process already wrote expression keys; pinning the adapter gem while floating core.

Related errors


AI-assisted analysis of flippercloud/flipper@1f86de3ec9 (2026-08-23). Data as JSON: /api/errors/afbebc6f7308468e. Report an issue: GitHub.