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

auth/ldap: Try to remove duplicates before storing LDAP search contexts

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.1
    • Fix Version/s: 2.3
    • Component/s: Authentication, Enrolments
    • Labels:
    • Environment:
      Server: CentOS 6.2 64 bit / LDAP: MS AD Windows 2003 R2 32bit
    • Database:
      MySQL
    • Testing Instructions:
      Hide

      1. Go to the LDAP auth settings configuration page
      2. Specify several contexts (separated by ';'). Make sure you include one or more contexts more than once.
      3. Save the settings.
      4. Go to the LDAP auth settings page again and check that the duplicated contexts are removed (an every context will we lowercased).

      Show
      1. Go to the LDAP auth settings configuration page 2. Specify several contexts (separated by ';'). Make sure you include one or more contexts more than once. 3. Save the settings. 4. Go to the LDAP auth settings page again and check that the duplicated contexts are removed (an every context will we lowercased).
    • Affected Branches:
      MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull Master Branch:
      wip_mdl-31540-master

      Description

      When I try to use php -f moodle-dir/auth/ldap/sync_users.php I receive the following error:

      Default exception handler: Error writing to database Debug: Duplicate entry '1-moodleadmin' for key 'mdl_tmpextu_mneuse_uix'
      INSERT INTO mdl_tmp_extuser (username,mnethostid) VALUES(?,?)
      [array (
        0 => 'moodleadmin',
        1 => '1',
      )]
      * line 397 of /lib/dml/moodle_database.php: dml_write_exception thrown
      * line 893 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
      * line 939 of /auth/ldap/auth.php: call to mysqli_native_moodle_database->insert_record_raw()
      * line 671 of /auth/ldap/auth.php: call to auth_plugin_ldap->ldap_bulk_insert()
      * line 65 of /auth/ldap/cli/sync_users.php: call to auth_plugin_ldap->sync_users()
       
      !!! Error writing to database !!!
      Potential coding error - existing temptables found when disposing database. Must be dropped!

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  25/Jun/12