puppetlabs/puppet · error · Puppet::Error

Could not connect to LDAP

Error message

Could not connect to LDAP: %{detail}

What it means

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.

Solutions

  1. Verify ldapserver/ldapport settings point at a reachable LDAP host
  2. Check ldapuser/ldappassword credentials are correct
  3. Confirm TLS/SSL configuration matches the server (ldaps vs plain)
  4. Test connectivity with ldapsearch or telnet to the server/port
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at lib/puppet/util/ldap/connection.rb:73 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of puppetlabs/puppet@e227c27540 (2026-08-21). Data as JSON: /api/errors/b8b878653affa714. Report an issue: GitHub.

Appendix: source

Thrown at lib/puppet/util/ldap/connection.rb:73

  def reset?
    reset
  end

  # Start our ldap connection.
  def start
    case ssl
    when :tls
      @connection = LDAP::SSLConn.new(host, port, true)
    when true
      @connection = LDAP::SSLConn.new(host, port)
    else
      @connection = LDAP::Conn.new(host, port)
    end
    @connection.set_option(LDAP::LDAP_OPT_PROTOCOL_VERSION, 3)
    @connection.set_option(LDAP::LDAP_OPT_REFERRALS, LDAP::LDAP_OPT_ON)
    @connection.simple_bind(user, password)
  rescue => detail
    raise Puppet::Error, _("Could not connect to LDAP: %{detail}") % { detail: detail }, detail.backtrace
  end
end

View on GitHub (pinned to e227c27540)