flippercloud/flipper · error · Flipper::Adapters::ReadOnly::WriteAttempted

write attempted while in read only mode

Error message

write attempted while in read only mode

What it means

Error "write attempted while in read only mode" thrown in flippercloud/flipper.

Source

Thrown at lib/flipper/adapters/read_only.rb:22

  module Adapters
    # Public: Adapter that wraps another adapter and raises for any writes.
    class ReadOnly < Wrapper
      WRITE_METHODS = %i[import add remove clear enable disable]

      class WriteAttempted < Error
        def initialize(message = nil)
          super(message || 'write attempted while in read only mode')
        end
      end

      def read_only?
        true
      end

      private

      def wrap(method, *args, **kwargs)
        raise WriteAttempted if WRITE_METHODS.include?(method)

        yield
      end
    end
  end
end

View on GitHub (pinned to 1f86de3ec9)

Solutions

  1. Remove the Flipper::Adapters::ReadOnly wrapper (or the read_only: true option) if writes are required
  2. Perform enable/disable/import operations against the underlying writable adapter directly, not through the read-only wrapper
  3. Use read-only mode only for processes that only check feature state (e.g. web requests) and keep writes in a separate process configured with the writable adapter

When it happens

Trigger: Thrown at lib/flipper/adapters/read_only.rb:22 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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