{"record":{"id":"ea75cda1eccb45c9","repo":"mongodb/mongoid","slug":"no-clients-configuration-provided-ea75cd","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/config.rb","lineNumber":527,"sourceCode":"    #\n    # @return [ true | false ] If the app is deployed on Passenger.\n    #\n    # @deprecated\n    def running_with_passenger?\n      @running_with_passenger ||= defined?(PhusionPassenger)\n    end\n\n    Mongoid.deprecate(self, :running_with_passenger?)\n\n    private\n\n    def set_log_levels\n      Mongoid.logger.level = Mongoid::Config.log_level unless defined?(::Rails)\n      Mongo::Logger.logger.level = Mongoid.logger.level\n    end\n\n    def clients=(clients)\n      raise Errors::NoClientsConfig.new unless clients\n\n      c = clients.with_indifferent_access\n      Validators::Client.validate(c)\n      @clients = c\n    end\n\n    # Get database client that respects global overrides\n    # Config.override_database and Config.override_client.\n    #\n    # @return [Mongo::Client] Client according to global overrides.\n    def global_client\n      client = if Threaded.client_override\n                 Clients.with_name(Threaded.client_override)\n               else\n                 Clients.default\n               end\n      if Threaded.database_override\n        client.use(Threaded.database_override)","sourceCodeStart":509,"sourceCodeEnd":545,"githubUrl":"https://github.com/mongodb/mongoid/blob/0da0e23d71adfbad31128c18e5e2c8c301c6f7c4/lib/mongoid/config.rb#L509-L545","documentation":"Raised by the private Config#clients= setter when Mongoid.configure is called with a nil or falsy clients configuration, i.e. no mongoid.yml clients section was loaded or no clients hash was passed to configure. It signals that Mongoid cannot proceed without at least one client definition.","triggerScenarios":"Thrown at lib/mongoid/config.rb:527 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a clients hash containing a :default entry in mongoid.yml","Ensure the environment key in mongoid.yml matches the current environment"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0da0e23d71adfbad31128c18e5e2c8c301c6f7c4","analyzedAt":"2026-08-23T06:25:47.656Z","contentChangedAt":"2026-08-23T06:25:47.656Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}