{"record":{"id":"3fe868f926218058","repo":"flippercloud/flipper","slug":"data-type-is-not-supported-by-this-adapter-3fe868","errorCode":null,"errorMessage":"#{data_type} is not supported by this adapter","messagePattern":"#(.+?) is not supported by this adapter","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"lib/flipper/adapters/sequel.rb","lineNumber":175,"sourceCode":"        when :boolean\n          clear(feature)\n        when :integer\n          set(feature, gate, thing)\n        when :json\n          delete(feature, gate)\n        when :set\n          @gate_class.where(gate_attrs(feature, gate, thing, json: gate.data_type == :json)).delete\n        else\n          unsupported_data_type gate.data_type\n        end\n\n        true\n      end\n\n      private\n\n      def unsupported_data_type(data_type)\n        raise \"#{data_type} is not supported by this adapter\"\n      end\n\n      def set(feature, gate, thing, options = {})\n        clear_feature = options.fetch(:clear, false)\n        json_feature = options.fetch(:json, false)\n\n        raise VALUE_TO_TEXT_WARNING if json_feature && value_not_text?\n\n        @gate_class.db.transaction do\n          clear(feature) if clear_feature\n          delete(feature, gate)\n\n          begin\n            @gate_class.create(gate_attrs(feature, gate, thing, json: json_feature))\n          rescue ::Sequel::UniqueConstraintViolation\n          end\n        end\n      end","sourceCodeStart":157,"sourceCodeEnd":193,"githubUrl":"https://github.com/flippercloud/flipper/blob/1f86de3ec91521585b156445e156642938b19cb0/lib/flipper/adapters/sequel.rb#L157-L193","documentation":"flipper-sequel persists features in the flipper_features and flipper_gates tables, choosing the write per the gate's data type; enable, disable, and result_for_feature route unknown data types to unsupported_data_type, which raises (lib/flipper/adapters/sequel.rb:173-176). The supported set is :boolean, :integer, :set and :json — the expression gate reports :json. flipper-sequel is a separate gem from flipper core, so the usual cause is a lockfile pairing newer core (expression gates) with an older adapter release lacking the :json branch.","triggerScenarios":"feature.enable_expression(...) / feature.add_expression (or Cloud/UI-driven expression writes) while flipper-sequel resolves older than flipper core — enable/disable raise ':json is not supported by this adapter'; feature.enabled? on a feature that already has expression rows raises via result_for_feature. Custom gates with data types outside %i[boolean integer set json] trigger it on any release.","commonSituations":"Rails apps that bump flipper but not flipper-sequel; multi-process setups (web + background jobs) sharing the same database where one process already wrote expression gate rows; adding a custom gate type to a fork.","solutions":["Align versions: bundle update flipper flipper-sequel so the adapter release matches flipper core (they ship in lockstep).","Assert at boot that Gem.loaded_specs['flipper-sequel'].version equals Gem.loaded_specs['flipper'].version.","If a newer writer already stored expression rows, clear those features (feature.delete via a current-version process) so old readers stop raising on get.","Avoid expression rollouts until every process touching the database runs the aligned versions; map custom gates to supported data types."],"exampleFix":"# before\ngem 'flipper',        '~> 0.28.0'\ngem 'flipper-sequel', '~> 0.25.0'\n\n# after\ngem 'flipper',        '~> 0.28.0'\ngem 'flipper-sequel', '~> 0.28.0'","handlingStrategy":"validation","validationCode":"def assert_flipper_gems_aligned!\n  core = Gem.loaded_specs.fetch('flipper').version\n  adapter = Gem.loaded_specs.fetch('flipper-sequel').version\n  raise \"flipper-sequel #{adapter} != flipper #{core}; align both gems\" unless core == adapter\nend\n\nassert_flipper_gems_aligned! # at boot, before any expression operations","typeGuard":"def expression_writable?\n  Gem.loaded_specs.fetch('flipper-sequel').version == Gem.loaded_specs.fetch('flipper').version\nend","tryCatchPattern":"begin\n  feature.enable_expression(expr)\nrescue RuntimeError => e\n  raise unless e.message.end_with?('is not supported by this adapter')\n  Flipper.logger.warn('flipper-sequel lacks :json support; using percentage rollout instead')\n  feature.enable_percentage_of_time(10)\nend","preventionTips":["Pin flipper and flipper-sequel to identical versions and bump them atomically.","Boot-assert version equality in web and job processes that share the database.","Sequence rollouts: upgrade all Sequel-reading processes before enabling expressions anywhere.","Run bundle exec rake with a spec that calls feature.enabled? after upgrades to catch read-path raises early."],"tags":["ruby","flipper","sequel","adapter","gates","version-mismatch","expression-gate"],"backgroundTag":"unsupported-adapter-data-type","analyzedSha":"1f86de3ec91521585b156445e156642938b19cb0","analyzedAt":"2026-08-23T04:36:09.896Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}