PHP Error log growing to fill root partition

PHP Error log growing to fill root partition

by Charles Johnson -
Number of replies: 3
I was alerted this morning by our system of the fact that our Moodle server's root partition was filling up. When I looked at it, the php_errors.log file was growing very rapidly and the only entries being added were:

PHP Warning:  ldap_search(): Search: Can't contact LDAP server in /var/www/html/moodle/auth/ldap/auth.php on line 712

It is odd, as I can login to the server using my AD credentials just fine and  users are syncing properly. I did recently upgrade our server to version 3.1 [3.1.3+ (Build: 20161208) specifically] and changed our method of syncing users over to the built in Site Administration > Server > Scheduled Tasks method, we were using a standard linux cron job to run the CLI version, but after the upgrade the output stated that it was no longer the valid method to use. As a troubleshooting step,  I disabled that job and I am still getting the warning messages in the php_errors.log file.

I found another potentially related question on the forum that advised disabling it and using the CLI method to troubleshoot, and it worked as I would have expected.

I also talked with our AD Admin about it and he looked at the logs of the domain controller and the only errors he was seeing were schannel errors. I imported the root certificate from our internal certificate server into the cacerts for the server, but it didn't resolve the issue either. I have to see if he is still seeing those errors or not, but it doesn't seem to be related to this issue.

I am at a loss on how the error states that it cannot contact the LDAP server, but every otherwise indicates to me that it is functioning normally.

Any assistance and advise would be greatly appreciated.

Thanks,

Chuck


Average of ratings: -
In reply to Charles Johnson

Re: PHP Error log growing to fill root partition

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Looking at that line shows the following:

// Use ldap_search to find first user from subtree.
$ldap_result = ldap_search($ldapconnection, $context, $filter, array($this->config->user_attribute));

Leads me to suspect that it is not necessarily the main connection but maybe that you have a context faulty or some permission with your bind user maybe?  Are you using a bind user?  Do you have multiple contexts that it is searching?  Or are you searching through subdirectories and your bind user does not have the necessary permissions on the main directory?

Just a few ideas...

In reply to Emma Richardson

Re: PHP Error log growing to fill root partition

by Charles Johnson -

Hi Emma,

Thanks for the reply. I was out of the office on Friday and just got back to this now.

I do have a bind user that I am using for the importing of users into Moodle. I do have a lot of contexts that the users are located in that are included in the Context field of the LDAP settings screen. When I use the account and the LDAP Explorer tool and the BIND user and credentials, I can see all of the users that are located there that are/would be imported into the moodle users database, so I  don't think that it is a permissions error.

I do see that some users don't have some datafields (such as department), but I don't think that would be an issue.

I guess one thing I don't understand is that I have the Scheduled Task set to run every 6 hours, but the errors are continually being posted to the php_errors.log file...

I will continue  to look for the cause and post back what I find.

Thanks!


Chuck


In reply to Charles Johnson

Re: PHP Error log growing to fill root partition

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

The continual error is probably because the ldap server is being queried every time a user logs in as well.  I would double check each context entry in the Moodle settings - I suspect that one is in there slightly wrong.