LafColITS / moodle-local_ldap

Various synchronization scripts between Moodle and LDAP directories (see https://tracker.moodle.org/browse/MDL-25011 )
9 stars 7 forks source link

moodle v3.5.1|postgresql 10.5| - Sync cohorts with LDAP attribute stuck endlessly after SQL request "SELECT pg_advisory_unlock($1, $2) AS unlocked" #13

Closed isrc closed 2 years ago

isrc commented 6 years ago

Hi, A couple of month ago, i've installed moodle 3.5.1 on a brand new ubuntu 18.04.x install shipped with postgresql 10.5 and since then, i never managed to make the local_ldap (v3.4.0 and now v3.4.1) script sync moodle cohorts with an LDAP attribute on this new installation

But before explaining the issue, let me say that i'm successfully running (old) release v3.3.3 of this plugin on an old moodle installation (moodle v3.4.2) whith the same ldap settings and at least i get a first cohort synchronisation.

Running the scheduled task from CLI with sudo -u www-data php admin/tool/task/cli/schedule_task.php --showdebugging --showsql --execute=\\local_ldap\\task\\attribute_sync_task, shows taht the script is endlessly stucked after this request:

SELECT pg_advisory_unlock($1, $2) AS unlocked [array ( 0 => 1289808297, 1 => '3', )] Query took: 0.00053691864013672 seconds. I've attached the full result but as i said the process just hung there without ever finishing local_ldap-pgsql10.log.txt

The issue doesn't seem to be related to the LDAP server as user authentication works fine (the authentication is actually managed by a CAS service and the user's attribute are retrieved via a separate LDAP server)

Could you help me identify what i might doing wrong please ? Thanks

mackensen commented 6 years ago

I'm not very familiar with postgresql; it's not clear to me what it's trying to do there. The plugin's unit tests run against postgresql v9.3-9.4; I've created a branch to test on 10.5 to see if that reveals anything.

isrc commented 6 years ago

I've just let the script run for ~24 hours and it was still stucked :-/

I'll try to check if there's some option to activate in order to get more debug information but please let me know if you're aware of any procedure to do that (provided it doesn't imply touching the LDAP server which i don't have any direct access)

Thank for your help !

mackensen commented 6 years ago

Unfortunately travis doesn't support postgresql 10 yet and I haven't had much luck getting it to run manually: https://github.com/travis-ci/travis-ci/issues/8537. That may not even be the issue. Judging from the queries it never even gets around to querying LDAP. Are you on OpenLDAP or Active Directory? Do other scheduled tasks run correctly from the command line?