Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-33406

ldap authentication: Sync users fails to add new users but updates existing users during cli/sync_users.php execution. Errors with Unable to write to database

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • None
    • 2.2.3
    • Authentication
    • MOODLE_22_STABLE
    • wip_master_mdl-33406
    • Hide
      1. Create a new user in one of your configured LDAP contexts, with a username of '0' (zero, without the quotes).
      2. Before applying the patch
        1. Run auth/ldap/cli/sync.php. It should display some errors like "Notice: Undefined property: stdClass::$username in /.../auth/ldap/auth.php on line 848
          !!! Error writing to database !!!..." and stop the syncing process.
      3. After applying the patch
        1. Run auth/ldap/cli/sync.php It should run without problems and sync all the users.
      Show
      Create a new user in one of your configured LDAP contexts, with a username of '0' (zero, without the quotes). Before applying the patch Run auth/ldap/cli/sync.php. It should display some errors like "Notice: Undefined property: stdClass::$username in /.../auth/ldap/auth.php on line 848 !!! Error writing to database !!!..." and stop the syncing process. After applying the patch Run auth/ldap/cli/sync.php It should run without problems and sync all the users.

      when running sync_users.php to update moodle db from ldap directory (Active Directory in my case) existing user details are updated but new users are not and the php script finishes with "!!! Error Writing to Database !!!" Enabling debugging and rerunning the script gives the additional error
      "Notice undefined property: stdClass::$username in /pathtoWeb/auth/ldap/auth.php on line 848

      The issue is discussed here http://moodle.org/mod/forum/discuss.php?d=203600

      Note: noticed the problem earlier but wasn't a show stopper for me at the time so earlier versions of moodle may be also affected

            iarenaza Iñaki Arenaza
            mobcdi Michael OBrien
            Damyon Wiese Damyon Wiese
            Dan Poltawski Dan Poltawski
            Votes:
            4 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.