SYSTEM WARNING: 'file_get_contents(https://www.clearos.com/?rendertype=json&get=header): failed to open stream: Connection refused' in '/var/www/virtual/newwrapper/cf_topmenu.inc' line 5

ClearOS Bug Tracker


View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007541ClearOSwebconfig-httpdpublic2016-03-02 20:202016-07-26 04:56
Reporteruser2 
Assigned Tobchambers 
PriorityhighSeveritymajorReproducibilityhave not tried
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target Version7.2.0 UpdatesFixed in Version7.2.0 Updates 
Summary0007541: Webconfig unable to connect to LDAP - Account system is offline
DescriptionThe _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!


TagsNo tags attached.
Attached Files

- Relationships
related to 0007551closeduser2 Perform a full restart with logrotate 

-  Notes
(0003561)
dloper (administrator)
2016-07-07 12:40

Create dialog box similar to ssl cert error that restarts webconfig.
(0003621)
bchambers (administrator)
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();
    }


- Issue History
Date Modified Username Field Change
2016-03-02 20:20 user2 New Issue
2016-03-02 20:25 user2 Status new => confirmed
2016-03-03 11:47 user2 Issue cloned: 0007551
2016-03-03 11:47 user2 Relationship added related to 0007551
2016-06-21 09:18 user2 Priority normal => high
2016-07-07 12:40 dloper Note Added: 0003561
2016-07-07 12:40 bchambers Assigned To => bchambers
2016-07-07 12:40 bchambers Status confirmed => assigned
2016-07-08 09:40 bchambers Severity minor => major
2016-07-08 15:37 bchambers Note Added: 0003621
2016-07-14 12:33 bchambers Note Edited: 0003621 View Revisions
2016-07-26 04:54 bchambers Status assigned => acknowledged
2016-07-26 04:55 bchambers Status acknowledged => confirmed
2016-07-26 04:56 bchambers Status confirmed => resolved
2016-07-26 04:56 bchambers Fixed in Version => 7.2.0 Updates
2016-07-26 04:56 bchambers Resolution open => fixed
2016-07-26 04:56 bchambers Status resolved => closed

SYSTEM WARNING: 'file_get_contents(https://www.clearos.com/?rendertype=json&get=footer): failed to open stream: Connection refused' in '/var/www/virtual/newwrapper/cf_footer.inc' line 7