LDAP sync not working (moodle application and moodle database are in different servers) - Users are "inserted" but not saved!

LDAP sync not working (moodle application and moodle database are in different servers) - Users are "inserted" but not saved!

by Fernanda R. -
Number of replies: 4

Hi,

We are using moodle 3.7.1 in the cloud and with the following configuration:

Operational System: CentOS7

Database: MariaDB (in a different machine than moodle)

We run the command to do the syncing (php MOODLE PATH/admin/tool/task/cli/schedule_task.php --execute=\\auth_ldap\\task\\sync_task) and it looks like it went all ok... it says it is inserting all the users... it ends like this: 

Usuário inserido xxxxxxx id xxxxxxxx

But when we login to moodle, the users are not there! sad

Does anyone know if the LDAP sync works when moodle application and moodle database are in different servers...? And how can we make this work?


Average of ratings: -
In reply to Fernanda R.

Re: LDAP sync not working (moodle application and moodle database are in different servers) - Users are "inserted" but not saved!

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

Is it getting all the way through or is there an error at the end?

In reply to Emma Richardson

Re: LDAP sync not working (moodle application and moodle database are in different servers) - Users are "inserted" but not saved!

by Fernanda R. -
Hi, @Emma Richardson! sorriso

It is getting all the way through, the last message is this:
"Usuário inserido xxxxxxx id xxxxxxxx"
that means: "User inserted xxxx id xxxxxx."

I looked the log and I didn't see any errors in the end...

There is only a warning in the beginning: "PHP Warning: Module 'zip' already loaded in Unknown on line 0" but I don't know if this is important.

Thank you!!
In reply to Fernanda R.

Re: LDAP sync not working (moodle application and moodle database are in different servers) - Users are "inserted" but not saved!

by Iñaki Arenaza -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Can you have a look at the database logs? Moodle uses a database transaction to insert the users. If for some reason[1] the transaction is not committed, all the inserted users will disappear as soon as Moodle closes the connection to the database.

[1] That doesn't leave a trace in the PHP error logs. Just in case, make sure you set Debugging setting to Developer level, to get the maximum amount of detail in your PHP error logs.

Average of ratings: Useful (1)
In reply to Iñaki Arenaza

Re: LDAP sync not working (moodle application and moodle database are in different servers) - Users are "inserted" but not saved!

by Fernanda R. -
Hi,
thanks for the tips... we looked the logs and discovered that we needed to increase memory limit. After doing that, restarting httpd and the database (there was a lock in the table too), and enabling TLS, it worked! sorriso
Thanks for the help, people!