← Back to team overview

mahara-contributors team mailing list archive

[Bug 1607669] [NEW] LDAP user sync incorrectly proceeds when LDAP list or search fails

 

Public bug reported:

Mahara: 16.04
DB: Postgres
OS: Linux

The LDAP user sync is incorrectly continuing when the search in the
context fails to contact the server.

The following error is generated in the cron.log file:

Jul 29 00:01:05 server mahara-site: [WAR] 29 (auth/ldap/lib.php:937) ldap_list(): Search: Can't contact LDAP server
Jul 29 00:01:05 server mahara-site: Call stack (most recent first):
Jul 29 00:01:05 server mahara-site:   * log_message("ldap_list(): Search: Can't contact LDAP server", 8, true, true, "/var/www/mahara-site/auth/ldap/lib.php", 937)
 at /var/www/mahara-site/lib/errors.php:489
Jul 29 00:01:05 server mahara-site:   * error(2, "ldap_list(): Search: Can't contact LDAP server", "/var/www/mahara-site/auth/ldap/lib.php", 937, array(size 11)) a
t Unknown:0
Jul 29 00:01:05 server mahara-site:   * ldap_list(resource(#87), "ou=people,o=ldapserver.xxx", "(uid=*)", array(size 5)) at /var/www/mahara-site/auth/ldap/lib.php:937
Jul 29 00:01:05 server mahara-site:   * AuthLdap->ldap_get_users_scalable("auth_ldap_extusers_temp", "extusername", "") at /var/www/mahara-site/auth/ldap/lib.php:1
121
Jul 29 00:01:05 server mahara-site:   * AuthLdap->sync_users() at /var/www/mahara-site/auth/ldap/lib.php:1614
Jul 29 00:01:05 server mahara-site:   * PluginAuthLdap::auth_ldap_sync_cron() at Unknown:0
Jul 29 00:01:05 server mahara-site:   * call_user_func_array(array(size 2), array(size 0)) at /var/www/mahara-site/lib/mahara.php:1714
Jul 29 00:01:05 server mahara-site:   * call_static_method("PluginAuthLdap", "auth_ldap_sync_cron") at /var/www/mahara-site/lib/cron.php:89


It then proceeds to sync the users:

Jul 29 00:01:05 server mahara-site: [WAR] 29 (auth/ldap/lib.php:940) ldap_first_entry() expects parameter 2 to be resource, boolean given
Jul 29 00:01:05 server mahara-site: Call stack (most recent first):
Jul 29 00:01:05 server mahara-site:   * log_message("ldap_first_entry() expects parameter 2 to be resou...", 8, true, true, "/var/www/mahara-site/auth/ldap/lib.php
", 940) at /var/www/mahara-site/lib/errors.php:489
Jul 29 00:01:05 server mahara-site:   * error(2, "ldap_first_entry() expects parameter 2 to be resou...", "/var/www/mahara-site/auth/ldap/lib.php", 940, array(size
 12)) at Unknown:0
Jul 29 00:01:05 server mahara-site:   * ldap_first_entry(resource(#87), false) at /var/www/mahara-site/auth/ldap/lib.php:940
Jul 29 00:01:05 server mahara-site:   * AuthLdap->ldap_get_users_scalable("auth_ldap_extusers_temp", "extusername", "") at /var/www/mahara-site/auth/ldap/lib.php:1121
Jul 29 00:01:05 server mahara-site:   * AuthLdap->sync_users() at /var/www/mahara-site/auth/ldap/lib.php:1614
Jul 29 00:01:05 server mahara-site:   * PluginAuthLdap::auth_ldap_sync_cron() at Unknown:0
Jul 29 00:01:05 server mahara-site:   * call_user_func_array(array(size 2), array(size 0)) at /var/www/mahara-site/lib/mahara.php:1714
Jul 29 00:01:05 server mahara-site:   * call_static_method("PluginAuthLdap", "auth_ldap_sync_cron") at /var/www/mahara-site/lib/cron.php:89
Jul 29 00:01:05 server mahara-site: 
Jul 29 00:01:05 server mahara-site: [WAR] 29 (auth/ldap/lib.php:971) ldap_free_result() expects parameter 1 to be resource, boolean given
Jul 29 00:01:05 server mahara-site: Call stack (most recent first):
Jul 29 00:01:05 server mahara-site:   * log_message("ldap_free_result() expects parameter 1 to be resou...", 8, true, true, "/var/www/mahara-site/auth/ldap/lib.php", 971) at /var/www/mahara-site/lib/errors.php:489
Jul 29 00:01:05 server mahara-site:   * error(2, "ldap_free_result() expects parameter 1 to be resou...", "/var/www/mahara-site/auth/ldap/lib.php", 971, array(size 13)) at Unknown:0
Jul 29 00:01:05 server mahara-site:   * ldap_free_result(false) at /var/www/mahara-site/auth/ldap/lib.php:971
Jul 29 00:01:05 server mahara-site:   * AuthLdap->ldap_get_users_scalable("auth_ldap_extusers_temp", "extusername", "") at /var/www/mahara-site/auth/ldap/lib.php:1121
Jul 29 00:01:05 server mahara-site:   * AuthLdap->sync_users() at /var/www/mahara-site/auth/ldap/lib.php:1614
Jul 29 00:01:05 server mahara-site:   * PluginAuthLdap::auth_ldap_sync_cron() at Unknown:0
Jul 29 00:01:05 server mahara-site:   * call_user_func_array(array(size 2), array(size 0)) at /var/www/mahara-site/lib/mahara.php:1714
Jul 29 00:01:05 server mahara-site:   * call_static_method("PluginAuthLdap", "auth_ldap_sync_cron") at /var/www/mahara-site/lib/cron.php:89
Jul 29 00:01:05 server mahara-site: 
Jul 29 00:01:05 server mahara-site: [INF] 29 (auth/ldap/lib.php:1122) LDAP users found : 0
Jul 29 00:01:05 server mahara-site: [INF] 29 (auth/ldap/lib.php:1169) 0 users known to Mahara 
Jul 29 00:01:05 server mahara-site: [INF] 29 (auth/ldap/lib.php:1232) 45161 users no longer in LDAP 


Because we've set the sync to suspend users, all LDAP users are then
suspended.

** Affects: mahara
     Importance: Undecided
     Assignee: Ghada El-Zoghbi (ghada-z)
         Status: New

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1607669

Title:
  LDAP user sync incorrectly proceeds when LDAP list or search fails

Status in Mahara:
  New

Bug description:
  Mahara: 16.04
  DB: Postgres
  OS: Linux

  The LDAP user sync is incorrectly continuing when the search in the
  context fails to contact the server.

  The following error is generated in the cron.log file:

  Jul 29 00:01:05 server mahara-site: [WAR] 29 (auth/ldap/lib.php:937) ldap_list(): Search: Can't contact LDAP server
  Jul 29 00:01:05 server mahara-site: Call stack (most recent first):
  Jul 29 00:01:05 server mahara-site:   * log_message("ldap_list(): Search: Can't contact LDAP server", 8, true, true, "/var/www/mahara-site/auth/ldap/lib.php", 937)
   at /var/www/mahara-site/lib/errors.php:489
  Jul 29 00:01:05 server mahara-site:   * error(2, "ldap_list(): Search: Can't contact LDAP server", "/var/www/mahara-site/auth/ldap/lib.php", 937, array(size 11)) a
  t Unknown:0
  Jul 29 00:01:05 server mahara-site:   * ldap_list(resource(#87), "ou=people,o=ldapserver.xxx", "(uid=*)", array(size 5)) at /var/www/mahara-site/auth/ldap/lib.php:937
  Jul 29 00:01:05 server mahara-site:   * AuthLdap->ldap_get_users_scalable("auth_ldap_extusers_temp", "extusername", "") at /var/www/mahara-site/auth/ldap/lib.php:1
  121
  Jul 29 00:01:05 server mahara-site:   * AuthLdap->sync_users() at /var/www/mahara-site/auth/ldap/lib.php:1614
  Jul 29 00:01:05 server mahara-site:   * PluginAuthLdap::auth_ldap_sync_cron() at Unknown:0
  Jul 29 00:01:05 server mahara-site:   * call_user_func_array(array(size 2), array(size 0)) at /var/www/mahara-site/lib/mahara.php:1714
  Jul 29 00:01:05 server mahara-site:   * call_static_method("PluginAuthLdap", "auth_ldap_sync_cron") at /var/www/mahara-site/lib/cron.php:89


  It then proceeds to sync the users:

  Jul 29 00:01:05 server mahara-site: [WAR] 29 (auth/ldap/lib.php:940) ldap_first_entry() expects parameter 2 to be resource, boolean given
  Jul 29 00:01:05 server mahara-site: Call stack (most recent first):
  Jul 29 00:01:05 server mahara-site:   * log_message("ldap_first_entry() expects parameter 2 to be resou...", 8, true, true, "/var/www/mahara-site/auth/ldap/lib.php
  ", 940) at /var/www/mahara-site/lib/errors.php:489
  Jul 29 00:01:05 server mahara-site:   * error(2, "ldap_first_entry() expects parameter 2 to be resou...", "/var/www/mahara-site/auth/ldap/lib.php", 940, array(size
   12)) at Unknown:0
  Jul 29 00:01:05 server mahara-site:   * ldap_first_entry(resource(#87), false) at /var/www/mahara-site/auth/ldap/lib.php:940
  Jul 29 00:01:05 server mahara-site:   * AuthLdap->ldap_get_users_scalable("auth_ldap_extusers_temp", "extusername", "") at /var/www/mahara-site/auth/ldap/lib.php:1121
  Jul 29 00:01:05 server mahara-site:   * AuthLdap->sync_users() at /var/www/mahara-site/auth/ldap/lib.php:1614
  Jul 29 00:01:05 server mahara-site:   * PluginAuthLdap::auth_ldap_sync_cron() at Unknown:0
  Jul 29 00:01:05 server mahara-site:   * call_user_func_array(array(size 2), array(size 0)) at /var/www/mahara-site/lib/mahara.php:1714
  Jul 29 00:01:05 server mahara-site:   * call_static_method("PluginAuthLdap", "auth_ldap_sync_cron") at /var/www/mahara-site/lib/cron.php:89
  Jul 29 00:01:05 server mahara-site: 
  Jul 29 00:01:05 server mahara-site: [WAR] 29 (auth/ldap/lib.php:971) ldap_free_result() expects parameter 1 to be resource, boolean given
  Jul 29 00:01:05 server mahara-site: Call stack (most recent first):
  Jul 29 00:01:05 server mahara-site:   * log_message("ldap_free_result() expects parameter 1 to be resou...", 8, true, true, "/var/www/mahara-site/auth/ldap/lib.php", 971) at /var/www/mahara-site/lib/errors.php:489
  Jul 29 00:01:05 server mahara-site:   * error(2, "ldap_free_result() expects parameter 1 to be resou...", "/var/www/mahara-site/auth/ldap/lib.php", 971, array(size 13)) at Unknown:0
  Jul 29 00:01:05 server mahara-site:   * ldap_free_result(false) at /var/www/mahara-site/auth/ldap/lib.php:971
  Jul 29 00:01:05 server mahara-site:   * AuthLdap->ldap_get_users_scalable("auth_ldap_extusers_temp", "extusername", "") at /var/www/mahara-site/auth/ldap/lib.php:1121
  Jul 29 00:01:05 server mahara-site:   * AuthLdap->sync_users() at /var/www/mahara-site/auth/ldap/lib.php:1614
  Jul 29 00:01:05 server mahara-site:   * PluginAuthLdap::auth_ldap_sync_cron() at Unknown:0
  Jul 29 00:01:05 server mahara-site:   * call_user_func_array(array(size 2), array(size 0)) at /var/www/mahara-site/lib/mahara.php:1714
  Jul 29 00:01:05 server mahara-site:   * call_static_method("PluginAuthLdap", "auth_ldap_sync_cron") at /var/www/mahara-site/lib/cron.php:89
  Jul 29 00:01:05 server mahara-site: 
  Jul 29 00:01:05 server mahara-site: [INF] 29 (auth/ldap/lib.php:1122) LDAP users found : 0
  Jul 29 00:01:05 server mahara-site: [INF] 29 (auth/ldap/lib.php:1169) 0 users known to Mahara 
  Jul 29 00:01:05 server mahara-site: [INF] 29 (auth/ldap/lib.php:1232) 45161 users no longer in LDAP 


  Because we've set the sync to suspend users, all LDAP users are then
  suspended.

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1607669/+subscriptions


Follow ups