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
- 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.
- Add a boot assertion: Gem.loaded_specs['flipper-redis'].version == Gem.loaded_specs['flipper'].version.
- 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.
- 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
- Bump flipper and flipper-redis together, pinned to the same version, in one PR.
- Assert Gem.loaded_specs version equality at boot in every process that touches the shared Redis.
- Upgrade web and background workers before the first expression write — reads raise too.
- If older processes must keep running, keep expression keys out of the shared Redis until they are upgraded.
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
- #{data_type} is not supported by this adapter
- #{data_type} is not supported by this adapter
- #{gate} is not supported by this adapter yet
- Group #{name.inspect} has already been registered
- Your database needs to be migrated to use the latest Flipper
AI-assisted analysis of flippercloud/flipper@1f86de3ec9 (2026-08-23).
Data as JSON: /api/errors/afbebc6f7308468e.
Report an issue: GitHub.