{"record":{"id":"b8b878653affa714","repo":"puppetlabs/puppet","slug":"could-not-connect-to-ldap-detail","errorCode":null,"errorMessage":"Could not connect to LDAP: %{detail}","messagePattern":"Could not connect to LDAP: %(.+?)","errorType":"exception","errorClass":"Puppet::Error","httpStatus":null,"severity":"error","filePath":"lib/puppet/util/ldap/connection.rb","lineNumber":73,"sourceCode":"  def reset?\n    reset\n  end\n\n  # Start our ldap connection.\n  def start\n    case ssl\n    when :tls\n      @connection = LDAP::SSLConn.new(host, port, true)\n    when true\n      @connection = LDAP::SSLConn.new(host, port)\n    else\n      @connection = LDAP::Conn.new(host, port)\n    end\n    @connection.set_option(LDAP::LDAP_OPT_PROTOCOL_VERSION, 3)\n    @connection.set_option(LDAP::LDAP_OPT_REFERRALS, LDAP::LDAP_OPT_ON)\n    @connection.simple_bind(user, password)\n  rescue => detail\n    raise Puppet::Error, _(\"Could not connect to LDAP: %{detail}\") % { detail: detail }, detail.backtrace\n  end\nend\n","sourceCodeStart":55,"sourceCodeEnd":76,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/util/ldap/connection.rb#L55-L76","documentation":"Wrapper error raised in Puppet::Util::Ldap::Connection#start: any exception from opening the LDAP::Conn/LDAP::SSLConn (bad host/port, TLS failure) or from simple_bind (invalid credentials) is rescued and re-raised as a Puppet::Error with the original detail appended. It means the LDAP session could not be established or authenticated.","triggerScenarios":"Thrown at lib/puppet/util/ldap/connection.rb:73 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify ldapserver/ldapport settings point at a reachable LDAP host","Check ldapuser/ldappassword credentials are correct","Confirm TLS/SSL configuration matches the server (ldaps vs plain)","Test connectivity with ldapsearch or telnet to the server/port"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","contentChangedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}