{"record":{"id":"20e7edbc4ed2537b","repo":"mongodb/mongoid","slug":"no-clients-configuration-provided","errorCode":null,"errorMessage":"No clients configuration provided.","messagePattern":"No clients configuration provided\\.","errorType":"exception","errorClass":"Mongoid::Errors::NoClientsConfig","httpStatus":null,"severity":"error","filePath":"lib/mongoid/clients/factory.rb","lineNumber":58,"sourceCode":"      # @return [ Mongo::Client ] The default client.\n      def default\n        create_client(Mongoid.clients[:default])\n      end\n\n      private\n\n      # Create the client for the provided config.\n      #\n      # @api private\n      #\n      # @example Create the client.\n      #   Factory.create_client(config)\n      #\n      # @param [ Hash ] configuration The client config.\n      #\n      # @return [ Mongo::Client ] The client.\n      def create_client(configuration)\n        raise Errors::NoClientsConfig.new unless configuration\n\n        config = configuration.dup\n        uri = config.delete(:uri)\n        database = config.delete(:database) || Mongo::URI.get(uri).database\n        hosts = config.delete(:hosts)\n        opts = config.delete(:options) || {}\n        if opts.key?(:auto_encryption_options)\n          opts[:auto_encryption_options] = build_auto_encryption_options(opts, database)\n        end\n        default_logger.warn(\"Unknown config options detected: #{config}.\") unless config.empty?\n        if uri\n          Mongo::Client.new(uri, options(opts))\n        else\n          Mongo::Client.new(\n            hosts,\n            options(opts).merge(database: database)\n          )\n        end","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/mongodb/mongoid/blob/0da0e23d71adfbad31128c18e5e2c8c301c6f7c4/lib/mongoid/clients/factory.rb#L40-L76","documentation":"Error \"No clients configuration provided.\" thrown in mongodb/mongoid.","triggerScenarios":"Thrown at lib/mongoid/clients/factory.rb:58 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0da0e23d71adfbad31128c18e5e2c8c301c6f7c4","analyzedAt":"2026-08-23T06:25:47.656Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}