mongodb/mongoid · error · Mongoid::Errors::UnsupportedIsolationLevel

The isolation level '%{level}' is not supported.

Error message

The isolation level '%{level}' is not supported.

What it means

Error "The isolation level '%{level}' is not supported." thrown in mongodb/mongoid.

Source

Thrown at lib/mongoid/config.rb:197

          # it's something we can work with.
          validate_isolation_level!(level)
        end
      else
        # The default, if Rails does not support IsolatedExecutionState,
        :thread
      end
    end

    # Checks to see if the provided isolation level is something that Mongoid
    # supports. Raises Errors::UnsupportedIsolationLevel if it is not.
    #
    # This will also raise an error if the isolation level is set to `:fiber`
    # and the Ruby version is less than 3.2, since fiber-local storage
    # is not supported in earlier Ruby versions.
    #
    # @api private
    def validate_isolation_level!(level)
      raise Errors::UnsupportedIsolationLevel.new(level) unless VALID_ISOLATION_LEVELS.include?(level)

      return unless level == :fiber && RUBY_VERSION < '3.2'

      raise Errors::UnsupportedIsolationLevel.new(level)
    end

    # When this flag is false, a document will become read-only only once the
    # #readonly! method is called, and an error will be raised on attempting
    # to save or update such documents, instead of just on delete. When this
    # flag is true, a document is only read-only if it has been projected
    # using #only or #without, and read-only documents will not be
    # deletable/destroyable, but they will be savable/updatable.
    # When this feature flag is turned on, the read-only state will be reset on
    # reload, but when it is turned off, it won't be.
    option :legacy_readonly, default: false

    # When this flag is false (the default as of Mongoid 9.0), a document that
    # is created or loaded will remember the storage options that were active

View on GitHub (pinned to 0da0e23d71)

When it happens

Trigger: Thrown at lib/mongoid/config.rb:197 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of mongodb/mongoid@0da0e23d71 (2026-08-23). Data as JSON: /api/errors/065847a355554e36. Report an issue: GitHub.