ClearFoundation Tracker - ClearOS
View Issue Details
0007541ClearOSwebconfig-httpdpublic2016-03-02 20:202016-07-26 04:56
user2 
bchambers 
highmajorhave not tried
closedfixed 
 
7.2.0 Updates7.2.0 Updates 
0007541: Webconfig unable to connect to LDAP - Account system is offline
The _bind() method in /usr/clearos/apps/ldap/libraries/LDAP_Client.php is used to connect to LDAP (OpenLDAP or Samba Directory). From time to time, we have seen systems that have failed to bind to LDAP which in turn generates a "Account system is offline" warning in webconfig. Strangely, the exact same method call using a simple command line test script works just fine.

Turning up the PHP LDAP debug is possible by adding the following to the LDAP_Client.php code:

 ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7);

With this debug in place, the following is shown in the /var/log/webconfig/error.log

ldap_bind_s
ldap_simple_bind_s
ldap_sasl_bind_s
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_connect_to_host: getaddrinfo failed: Address family for hostname not supported
ldap_err2string

The "getaddrinfo failed" warning is... odd!


No tags attached.
related to 0007551closed user2 Perform a full restart with logrotate 
Issue History
2016-03-02 20:20user2New Issue
2016-03-02 20:25user2Statusnew => confirmed
2016-03-03 11:47user2Issue cloned: 0007551
2016-03-03 11:47user2Relationship addedrelated to 0007551
2016-06-21 09:18user2Prioritynormal => high
2016-07-07 12:40dloperNote Added: 0003561
2016-07-07 12:40bchambersAssigned To => bchambers
2016-07-07 12:40bchambersStatusconfirmed => assigned
2016-07-08 09:40bchambersSeverityminor => major
2016-07-08 15:37bchambersNote Added: 0003621
2016-07-14 12:33bchambersNote Edited: 0003621bug_revision_view_page.php?bugnote_id=3621#r1071
2016-07-26 04:54bchambersStatusassigned => acknowledged
2016-07-26 04:55bchambersStatusacknowledged => confirmed
2016-07-26 04:56bchambersStatusconfirmed => resolved
2016-07-26 04:56bchambersFixed in Version => 7.2.0 Updates
2016-07-26 04:56bchambersResolutionopen => fixed
2016-07-26 04:56bchambersStatusresolved => closed

Notes
(0003561)
dloper   
2016-07-07 12:40   
Create dialog box similar to ssl cert error that restarts webconfig.
(0003621)
bchambers   
2016-07-08 15:37   
(edited on: 2016-07-14 12:33)
Possible cause is that we're not closing ldap connections...ever.

Try closing connections with __destruct() function...eg:

In /usr/clearos/apps/ldap/libraries/LDAP_Client.php

add the following function after the __construct(..) function:

/**
     * Performs LDAP close.
     *
     * @return void
     */

    public function __destruct() {
        $this->close();
    }