{"record":{"id":"5a9a22b831115db6","repo":"mongodb/mongoid","slug":"no-hosts-provided-for-client-configuration-nam","errorCode":null,"errorMessage":"No hosts provided for client configuration: :%{name}.","messagePattern":"No hosts provided for client configuration: :%(.+?)\\.","errorType":"exception","errorClass":"Mongoid::Errors::NoClientHosts","httpStatus":null,"severity":"error","filePath":"lib/mongoid/config/validators/client.rb","lineNumber":58,"sourceCode":"        def validate_client_database(name, config)\n          return unless no_database_or_uri?(config)\n\n          raise Errors::NoClientDatabase.new(name, config)\n        end\n\n        # Validate that the client config has hosts.\n        #\n        # @api private\n        #\n        # @example Validate the client has hosts.\n        #   validator.validate_client_hosts(:default, {})\n        #\n        # @param [ String | Symbol ] name The config key.\n        # @param [ Hash ] config The configuration.\n        def validate_client_hosts(name, config)\n          return unless no_hosts_or_uri?(config)\n\n          raise Errors::NoClientHosts.new(name, config)\n        end\n\n        # Validate that not both a uri and standard options are provided for a\n        # single client.\n        #\n        # @api private\n        #\n        # @example Validate the uri and options.\n        #   validator.validate_client_uri(:default, {})\n        #\n        # @param [ String | Symbol ] name The config key.\n        # @param [ Hash ] config The configuration.\n        def validate_client_uri(name, config)\n          return unless both_uri_and_standard?(config)\n\n          raise Errors::MixedClientConfiguration.new(name, config)\n        end\n","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/mongodb/mongoid/blob/0da0e23d71adfbad31128c18e5e2c8c301c6f7c4/lib/mongoid/config/validators/client.rb#L40-L76","documentation":"Error \"No hosts provided for client configuration: :%{name}.\" thrown in mongodb/mongoid.","triggerScenarios":"Thrown at lib/mongoid/config/validators/client.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"}