1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

ldapsearch result: Can't contact LDAP server (-1)

Discussion in 'Main Forum' started by Neil, Sep 12, 2018.

  1. Neil

    Neil Guest

    Anyone knows which the problem?

    I installed LDAP: yum -y install openldap-servers and then checked is the installation work well starting slapd service and doing ldapsearch like this:

    ldapsearch -h 127.0.0.1 -x -b '' -s base '(objectclass=*)' namingContexts -d1


    log:

    ldap_create
    ldap_url_parse_ext(ldap://127.0.0.1)
    ldap_sasl_bind
    ldap_send_initial_request
    ldap_new_connection 1 1 0
    ldap_int_open_connection
    ldap_connect_to_host: TCP 127.0.0.1:389
    ldap_new_socket: 3
    ldap_prepare_socket: 3
    ldap_connect_to_host: Trying 127.0.0.1:389
    ldap_pvt_connect: fd: 3 tm: -1 async: 0
    attempting to connect:
    connect success
    ldap_open_defconn: successful
    ldap_send_server_request
    ber_scanf fmt ({it) ber:
    ber_scanf fmt ({i) ber:
    ber_flush2: 14 bytes to sd 3
    ldap_result ld 0x7f7d211a4350 msgid 1
    wait4msg ld 0x7f7d211a4350 msgid 1 (infinite timeout)
    wait4msg continue ld 0x7f7d211a4350 msgid 1 all 1
    ** ld 0x7f7d211a4350 Connections:
    * host: 127.0.0.1 port: 389 (default)
    refcnt: 2 status: Connected
    last used: Mon Jan 26 12:05:16 2015


    ** ld 0x7f7d211a4350 Outstanding Requests:
    * msgid 1, origid 1, status InProgress
    outstanding referrals 0, parent count 0
    ld 0x7f7d211a4350 request count 1 (abandoned 0)
    ** ld 0x7f7d211a4350 Response Queue:
    Empty
    ld 0x7f7d211a4350 response count 0
    ldap_chkResponseList ld 0x7f7d211a4350 msgid 1 all 1
    ldap_chkResponseList returns ld 0x7f7d211a4350 NULL
    ldap_int_select
    read1msg: ld 0x7f7d211a4350 msgid 1 all 1
    ber_get_next
    ldap_err2string
    ldap_result: Can't contact LDAP server (-1)
    ldap_free_request (origid 1, msgid 1)
    ldap_free_connection 1 1
    ldap_free_connection: actually freed


    After that I've tried to configure LDAP but the problem it's the same. And I started from scratch and then I asked with this question.

    My ldap.conf:

    #
    # LDAP Defaults
    #

    # See ldap.conf(5) for details
    # This file should be world readable but not world writable.

    BASE dc=example,dc=com
    URI ldap://127.0.0.1 #ldap://ldap-master.example.com:666

    #SIZELIMIT 12
    #TIMELIMIT 15
    #DEREF never

    TLS_CACERTDIR /etc/openldap/certs

    # Turning this off breaks GSSAPI used with krb5 when rdns = false
    SASL_NOCANON on


    Is it a problem of my Centos 7 server?

    EDIT:

    I checked and I can't ping to localhost: ping localhost or ping 127.0.0.1 may be is the problem. How can I solve it?

    New Edit:

    Ping is not the problem. Now I can ping but still not works. Only works ldapsearch like this:

    ldapsearch -H ldapi:/// -x -b '' -s base '(objectclass=*)' namingContexts

    Login To add answer/comment
     

Share This Page