Moodle
  1. Moodle
  2. MDL-24666

sync_users.php does not add new users

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0, 2.1, 2.2
    • Fix Version/s: 2.0.4, 2.1.1
    • Component/s: Authentication
    • Labels:
      None
    • Environment:
      LAMP and MS Active Directory
    • Database:
      MySQL
    • Testing Instructions:
      Hide

      Either setup a 1.9 Moodle site with LDAP authentication and configure a mixed case LDAP user attribute setting (e.g. sAMAccountName for MS Active Directory), then upgrade to Moodle 2.x and then run /auth/ldap/cli/sync_users.php (make sure you have 2+ moodle users in your LDAP server), or directly setup a 2.x Moodle site with LDAP authentication and modify the setting in the database to make it mixed case, then run /auth/ldap/cli/sync_users.php.

      Show
      Either setup a 1.9 Moodle site with LDAP authentication and configure a mixed case LDAP user attribute setting (e.g. sAMAccountName for MS Active Directory), then upgrade to Moodle 2.x and then run /auth/ldap/cli/sync_users.php (make sure you have 2+ moodle users in your LDAP server), or directly setup a 2.x Moodle site with LDAP authentication and modify the setting in the database to make it mixed case, then run /auth/ldap/cli/sync_users.php.
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      wip_MDL-24666_HEAD_sync_users.php
    • Rank:
      8112

      Description

      The "sync_users.php" script updates users fine, but it doesn't add new users via LDAP from AD.
      Here's the scripts error message (i only changed Name and E-Mail):
      ----------
      Database transaction aborted automatically in /var/www/moodle/web/auth/ldap/cli/sync_users.php
      Default exception handler: Error writing to database Debug: Duplicate entry '1-' for key 'user_mneuse_uix'
      INSERT INTO user (firstname,lastname,email,idnumber,department,confirmed,auth,mnethostid,username,lang) VALUES(?,?,?,?,?,?,?,?,?,?)
      [array (
      0 => 'Nils',
      1 => 'Holgerson',
      2 => 'Nils.Holgerson@uni-wh.de',
      3 => '54129',
      4 => '2010/10/13',
      5 => 1,
      6 => 'ldap',
      7 => '1',
      8 => '',
      9 => 'en',
      )]

      • line 394 of /lib/dml/moodle_database.php: dml_write_exception thrown
      • line 816 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
      • line 858 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
      • line 852 of /auth/ldap/auth.php: call to mysqli_native_moodle_database->insert_record()
      • line 65 of /auth/ldap/cli/sync_users.php: call to auth_plugin_ldap->sync_users()

      Potential coding error - existing temptables found when disposing database. Must be dropped!
      ----------

      As you can see the field "8" (username) is empty which probably leads to this error. It is mapped against sAMAccountName in AD. This mapping is working in updating users but not in creating new in the Moolde DB.

      Thanks for your help in advance!

      1. mdl-24666-20-debug.diff
        1 kB
        Iñaki Arenaza
      2. mdl-24666-20-debug-v2.diff
        2 kB
        Iñaki Arenaza
      3. mdl-24666-20-debug-v3.diff
        4 kB
        Iñaki Arenaza
      4. sync_users.out
        4 kB
        Paul Menchini

        Issue Links

          Activity

          Hide
          Petr Škoda added a comment -

          Weird, why is the username empty in that insert_record?

          Show
          Petr Škoda added a comment - Weird, why is the username empty in that insert_record?
          Hide
          Marc Malik added a comment -

          Yes it is weird. Yesterday it was a different user. So it must be a systematic issue. Look what the last lines of the logfile say (i only changed usernames which were updated):

          ----------
          ...
          Updating user zaller id 3286
          Updating user zeller id 2758
          Updating user ziller id 2759
          Updating user zoller id 2760
          User entries to be added: 10
          Inserted user id 3377

          ---------
          You can see that usernames are handled correctly in case of updates. The to be inserted user is empty.

          Show
          Marc Malik added a comment - Yes it is weird. Yesterday it was a different user. So it must be a systematic issue. Look what the last lines of the logfile say (i only changed usernames which were updated): ---------- ... Updating user zaller id 3286 Updating user zeller id 2758 Updating user ziller id 2759 Updating user zoller id 2760 User entries to be added: 10 Inserted user id 3377 --------- You can see that usernames are handled correctly in case of updates. The to be inserted user is empty.
          Hide
          Marc Malik added a comment -

          Unfortunately not much progress has been made on this issue.
          Can i help with further debugging? Any hint how to fix this issue? Please let me know...

          Show
          Marc Malik added a comment - Unfortunately not much progress has been made on this issue. Can i help with further debugging? Any hint how to fix this issue? Please let me know...
          Hide
          Iñaki Arenaza added a comment -

          Hi Mark,

          sorry for the dealy. I wasn't even aware that the bug was assigned to me

          I'm trying to reproduce the bug, but so far I've been unable to do it (using Moodle on LAMP and MS Active Directory running on W2003).

          Could you please apply the attached patch and see what you get? (error logs should appear in the standard ouput).

          Saludos.
          Iñaki.

          Show
          Iñaki Arenaza added a comment - Hi Mark, sorry for the dealy. I wasn't even aware that the bug was assigned to me I'm trying to reproduce the bug, but so far I've been unable to do it (using Moodle on LAMP and MS Active Directory running on W2003). Could you please apply the attached patch and see what you get? (error logs should appear in the standard ouput). Saludos. Iñaki.
          Hide
          Iñaki Arenaza added a comment -

          Hi Mark,

          sorry for the dealy. I wasn't aware that the bug was assigned to me

          I'm trying to reproduce the bug, but so far I've been unable to do it (using LAMP and MS Active Directory running on W2003).

          Could you please apply the attached patch and see what you get? (error logs should appear in the standard ouput).

          Saludos.
          Iñaki.

          Show
          Iñaki Arenaza added a comment - Hi Mark, sorry for the dealy. I wasn't aware that the bug was assigned to me I'm trying to reproduce the bug, but so far I've been unable to do it (using LAMP and MS Active Directory running on W2003). Could you please apply the attached patch and see what you get? (error logs should appear in the standard ouput). Saludos. Iñaki.
          Hide
          Marc Malik added a comment -

          Hi Iñaki!

          Thanks for your help. I use 2 Domain Controllers configured as ldap servers in Moodle (ldap://192.168.1.11;ldap://192.168.1.12). The first is w2003 and the second is w2008!! This setting was working fine on Moodle 1.9.9.
          Here is the debug output:

          ----------
          username before get_userinfo_asobj: gestrandeter-kapitaen
          username after get_userinfo_asobj:
          username after moodle_strtolower:
          username before get_userinfo_asobj: mfink
          username after get_userinfo_asobj:
          username after moodle_strtolower:
          Database transaction aborted automatically in /var/www/moodle/web/auth/ldap/cli/sync_users.php
          Default exception handler: Error writing to database Debug: Duplicate entry '1-' for key 'user_mneuse_uix'
          INSERT INTO user (firstname,lastname,email,idnumber,department,confirmed,auth,mnethostid,username,lang) VALUES(?,?,?,?,?,?,?,?,?,?)
          [array (
          0 => 'Michael',
          1 => 'Fink',
          2 => 'Michael.Fink@uni-wh.de',
          3 => '53949',
          4 => '2010/08/10',
          5 => 1,
          6 => 'ldap',
          7 => '1',
          8 => '',
          9 => 'en',
          )]

          • line 394 of /lib/dml/moodle_database.php: dml_write_exception thrown
          • line 843 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
          • line 885 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
          • line 855 of /auth/ldap/auth.php: call to mysqli_native_moodle_database->insert_record()
          • line 65 of /auth/ldap/cli/sync_users.php: call to auth_plugin_ldap->sync_users()

          Potential coding error - existing temptables found when disposing database. Must be dropped!
          ---------------

          You gave me a hint when you said it is working with your w2003 Server.
          So i deleted the w2008 Server from moodle ldap config resulting in a working sync. Users get added. On the one hand this helps me out but on the other hand it seems to be a incompatibility with Windows Server 2008. Well it is still strange why moodle tried the w2008 server first (because it is 2nd in config. list). Please let me know if i can further help you to debug this.

          Show
          Marc Malik added a comment - Hi Iñaki! Thanks for your help. I use 2 Domain Controllers configured as ldap servers in Moodle (ldap://192.168.1.11;ldap://192.168.1.12). The first is w2003 and the second is w2008!! This setting was working fine on Moodle 1.9.9. Here is the debug output: ---------- username before get_userinfo_asobj: gestrandeter-kapitaen username after get_userinfo_asobj: username after moodle_strtolower: username before get_userinfo_asobj: mfink username after get_userinfo_asobj: username after moodle_strtolower: Database transaction aborted automatically in /var/www/moodle/web/auth/ldap/cli/sync_users.php Default exception handler: Error writing to database Debug: Duplicate entry '1-' for key 'user_mneuse_uix' INSERT INTO user (firstname,lastname,email,idnumber,department,confirmed,auth,mnethostid,username,lang) VALUES(?,?,?,?,?,?,?,?,?,?) [array ( 0 => 'Michael', 1 => 'Fink', 2 => 'Michael.Fink@uni-wh.de', 3 => '53949', 4 => '2010/08/10', 5 => 1, 6 => 'ldap', 7 => '1', 8 => '', 9 => 'en', )] line 394 of /lib/dml/moodle_database.php: dml_write_exception thrown line 843 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end() line 885 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw() line 855 of /auth/ldap/auth.php: call to mysqli_native_moodle_database->insert_record() line 65 of /auth/ldap/cli/sync_users.php: call to auth_plugin_ldap->sync_users() Potential coding error - existing temptables found when disposing database. Must be dropped! --------------- You gave me a hint when you said it is working with your w2003 Server. So i deleted the w2008 Server from moodle ldap config resulting in a working sync. Users get added. On the one hand this helps me out but on the other hand it seems to be a incompatibility with Windows Server 2008. Well it is still strange why moodle tried the w2008 server first (because it is 2nd in config. list). Please let me know if i can further help you to debug this.
          Hide
          Iñaki Arenaza added a comment -

          Hi Marc,

          I have tried with my W2008 (not 2008R2) text box, and I can't reproduce it either !?!? Beware, this W2008 box is for a different domain than my W2003 text box, so this is not exactly the same setup you have (in case that matters).

          Could you please revert the previous patch and try this new one? (the v2 one). It's a bit strange that we can get all the other LDAP attributes but not the sAMAccountName. Either that or we are removing the attribute somewhere (that I can't see at first sight).

          Saludos.
          Iñaki

          Show
          Iñaki Arenaza added a comment - Hi Marc, I have tried with my W2008 ( not 2008R2) text box, and I can't reproduce it either !?!? Beware, this W2008 box is for a different domain than my W2003 text box, so this is not exactly the same setup you have (in case that matters). Could you please revert the previous patch and try this new one? (the v2 one). It's a bit strange that we can get all the other LDAP attributes but not the sAMAccountName. Either that or we are removing the attribute somewhere (that I can't see at first sight). Saludos. Iñaki
          Hide
          Marc Malik added a comment -

          Hi Iñaki,

          at the moment i can't reproduce the problem neither. It seems to be gone on a myserious way. I can't believe it...the problem existed for around 6 Weeks with errors like i reported above and all i have done to "solve" was syncing with the W2003 Server alone and now syncing with the W2008 (not R2) Server works aswell (same Domain). Strange windows world! I'm sorry for any inconvenience caused. Thanks a lot for your help!

          Regards,

          Marc

          Show
          Marc Malik added a comment - Hi Iñaki, at the moment i can't reproduce the problem neither. It seems to be gone on a myserious way. I can't believe it...the problem existed for around 6 Weeks with errors like i reported above and all i have done to "solve" was syncing with the W2003 Server alone and now syncing with the W2008 (not R2) Server works aswell (same Domain). Strange windows world! I'm sorry for any inconvenience caused. Thanks a lot for your help! Regards, Marc
          Hide
          Iñaki Arenaza added a comment -

          Thanks Marc for taking the time to try to reproduce it.

          I'm more than happy that the issue is not acctually a bug (because I suspect it would have been a hard one to track and fix )

          Saludos.
          Iñaki.

          Show
          Iñaki Arenaza added a comment - Thanks Marc for taking the time to try to reproduce it. I'm more than happy that the issue is not acctually a bug (because I suspect it would have been a hard one to track and fix ) Saludos. Iñaki.
          Hide
          Paul Menchini added a comment -

          I'd love to see this reopened. I upgraded from 1.9.12+ to 2.0.3+, and am seeing this error. We use two Windows Server 2008 R2 boxen for our AD controllers. I'm also seeing a blank username. Here's the exact error message (with personal data [redacted]).

          Database transaction aborted automatically in /vhosts/standalone-moodle/moodle/auth/ldap/cli/sync_users.php
          Default exception handler: Error writing to database Debug: ERROR: duplicate key value violates unique constraint "mdl_user_mneuse_uix"
          INSERT INTO mdl_user (firstname,lastname,email,confirmed,auth,mnethostid,username,lang) VALUES($1,$2,$3,$4,$5,$6,$7,$8) RETURNING id
          [array (
          'firstname' => '[redacted]',
          'lastname' => '[redacted]',
          'email' => '[redacted]',
          'confirmed' => 1,
          'auth' => 'ldap',
          'mnethostid' => '1',
          'username' => '',
          'lang' => 'en',
          )]

          • line 394 of /lib/dml/moodle_database.php: dml_write_exception thrown
          • line 232 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
          • line 781 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
          • line 833 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->insert_record_raw()
          • line 852 of /auth/ldap/auth.php: call to pgsql_native_moodle_database->insert_record()
          • 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!

          I'm happy to help debug!

          Show
          Paul Menchini added a comment - I'd love to see this reopened. I upgraded from 1.9.12+ to 2.0.3+, and am seeing this error. We use two Windows Server 2008 R2 boxen for our AD controllers. I'm also seeing a blank username. Here's the exact error message (with personal data [redacted] ). Database transaction aborted automatically in /vhosts/standalone-moodle/moodle/auth/ldap/cli/sync_users.php Default exception handler: Error writing to database Debug: ERROR: duplicate key value violates unique constraint "mdl_user_mneuse_uix" INSERT INTO mdl_user (firstname,lastname,email,confirmed,auth,mnethostid,username,lang) VALUES($1,$2,$3,$4,$5,$6,$7,$8) RETURNING id [array ( 'firstname' => ' [redacted] ', 'lastname' => ' [redacted] ', 'email' => ' [redacted] ', 'confirmed' => 1, 'auth' => 'ldap', 'mnethostid' => '1', 'username' => '', 'lang' => 'en', )] line 394 of /lib/dml/moodle_database.php: dml_write_exception thrown line 232 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end() line 781 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end() line 833 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->insert_record_raw() line 852 of /auth/ldap/auth.php: call to pgsql_native_moodle_database->insert_record() 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! I'm happy to help debug!
          Hide
          Paul Menchini added a comment -

          More info: Line 237 of auth/ldap/cli/sync_users.php:

          <code>
          $user = $this->get_userinfo_asobj($user->username);
          </code>

          Before this call, $user has id and username attributes. After the call, $user has firstname, lastname and email attributes, but no longer has the username attribute.

          A workaround copying the username attribute across this call works:

          <code>
          $temp_username = $user->username;
          $user = $this->get_userinfo_asobj($user->username);
          $user->username = $temp_username;
          </code>

          However, I look forward to the real fix....

          Show
          Paul Menchini added a comment - More info: Line 237 of auth/ldap/cli/sync_users.php: <code> $user = $this->get_userinfo_asobj($user->username); </code> Before this call, $user has id and username attributes. After the call, $user has firstname, lastname and email attributes, but no longer has the username attribute. A workaround copying the username attribute across this call works: <code> $temp_username = $user->username; $user = $this->get_userinfo_asobj($user->username); $user->username = $temp_username; </code> However, I look forward to the real fix....
          Hide
          Iñaki Arenaza added a comment - - edited

          Hi Paul, can you try the attached patch?

          It should output loads of debugging information. You can trim the output just for the problematic user and then sanitise sensitive data.

          Then either attach the information to the bug or send it directly to me (inaki DOT arenaza AT gmail DOT com).

          Saludos.
          Iñaki.

          Show
          Iñaki Arenaza added a comment - - edited Hi Paul, can you try the attached patch? It should output loads of debugging information. You can trim the output just for the problematic user and then sanitise sensitive data. Then either attach the information to the bug or send it directly to me (inaki DOT arenaza AT gmail DOT com). Saludos. Iñaki.
          Hide
          Paul Menchini added a comment -

          Iñaki,

          Patch applied and debugging output generated (see attachment sync_users.out). I've cut out everything prior to the 'User entries to be added section' and redacted user information.

          Hope this gives you what you need!

          Cheers,

          Paul

          Show
          Paul Menchini added a comment - Iñaki, Patch applied and debugging output generated (see attachment sync_users.out). I've cut out everything prior to the 'User entries to be added section' and redacted user information. Hope this gives you what you need! Cheers, Paul
          Hide
          Paul Menchini added a comment -

          Relevant output of mdl-24666-20-debug-v3.diff patch.

          Show
          Paul Menchini added a comment - Relevant output of mdl-24666-20-debug-v3.diff patch.
          Hide
          Iñaki Arenaza added a comment -

          After a private exchange with Paul Menchini, and with his kind help we've finally tracked down the issue. And it's actually a bug for sites migrated from 1.x. So I'm reopening this and will post a patch soon.

          Saludos.
          Iñaki.

          Show
          Iñaki Arenaza added a comment - After a private exchange with Paul Menchini, and with his kind help we've finally tracked down the issue. And it's actually a bug for sites migrated from 1.x. So I'm reopening this and will post a patch soon. Saludos. Iñaki.
          Show
          Iñaki Arenaza added a comment - Here are the patches: Moodle 2.0.x: https://github.com/iarenaza/moodle/compare/MOODLE_20_STABLE...wip_MDL-24666_2.0_sync_users.php Moodle 2.1.x: https://github.com/iarenaza/moodle/compare/MOODLE_21_STABLE...wip_MDL-24666_2.1_sync_users.php master: https://github.com/iarenaza/moodle/compare/master...wip_MDL-24666_HEAD_sync_users.php Saludos. Iñaki.
          Hide
          Iñaki Arenaza added a comment -

          As there are only fields for 2.0 and Master, here are the details for 2.1:

          Pull 2.1 brach: wip_MDL-24666_2.1_sync_users.php
          Pull 2.1 Diff URL: https://github.com/iarenaza/moodle/compare/MOODLE_21_STABLE...wip_MDL-24666_2.1_sync_users.php

          Saludos.
          Iñaki.

          Show
          Iñaki Arenaza added a comment - As there are only fields for 2.0 and Master, here are the details for 2.1: Pull 2.1 brach: wip_ MDL-24666 _2.1_sync_users.php Pull 2.1 Diff URL: https://github.com/iarenaza/moodle/compare/MOODLE_21_STABLE...wip_MDL-24666_2.1_sync_users.php Saludos. Iñaki.
          Hide
          Sam Hemelryk added a comment -

          Thanks Inaki - this has been integrated now on master, MOODLE_21_STABLE, and MOODLE_20_STABLE.

          Show
          Sam Hemelryk added a comment - Thanks Inaki - this has been integrated now on master, MOODLE_21_STABLE, and MOODLE_20_STABLE.
          Hide
          Aparup Banerjee added a comment -

          Paul,
          This is a rather difficult setup to test, is it possible for you to test (or have you already tested) Iñaki's fix?

          Show
          Aparup Banerjee added a comment - Paul, This is a rather difficult setup to test, is it possible for you to test (or have you already tested) Iñaki's fix?
          Hide
          Aparup Banerjee added a comment -

          trying to test, feel free to pass if you've tested this

          Show
          Aparup Banerjee added a comment - trying to test, feel free to pass if you've tested this
          Hide
          Aparup Banerjee added a comment -

          passing for now as its tested working with linux ldap setup. - so no regressions there (although code change is only for MS).

          Show
          Aparup Banerjee added a comment - passing for now as its tested working with linux ldap setup. - so no regressions there (although code change is only for MS) .
          Hide
          Paul Menchini added a comment - - edited

          Aparup,

          I tested Iñaki's proposed fix against my 203+ stable install. It worked perfectly. (This was prior to his release of the patches.)

          I looked at his 20 patch and it exactly matches the change that I made at Iñaki's suggestion, so I'd say 'fixed' (at least in 2.0).

          Regards,

          Paul

          Show
          Paul Menchini added a comment - - edited Aparup, I tested Iñaki's proposed fix against my 203+ stable install. It worked perfectly. (This was prior to his release of the patches.) I looked at his 20 patch and it exactly matches the change that I made at Iñaki's suggestion, so I'd say 'fixed' (at least in 2.0). Regards, Paul
          Hide
          Aparup Banerjee added a comment -

          Thanks for that Paul!
          That makes this a pass with distinctions! :-D

          Show
          Aparup Banerjee added a comment - Thanks for that Paul! That makes this a pass with distinctions! :-D
          Hide
          Eloy Lafuente (stronk7) added a comment -

          This has landed upstream, many thanks!

          Show
          Eloy Lafuente (stronk7) added a comment - This has landed upstream, many thanks!
          Hide
          Janet Smith added a comment -

          I'm running Moodle 2.2.3+ (Build: 20120624) and I'm experiencing this exact error. The site was upgraded from version 1.9. Was this fix incorporated into Moodle 2.2? Here is the error message I see:

          Default exception handler: Error writing to database Debug: Duplicate entry '3-rdoe' for key 'mdl_tmpextu_mneuse_uix'
          INSERT INTO mdl_tmp_extuser (username,mnethostid) VALUES(?,?)
          [array (
          0 => 'rdoe',
          1 => '3',
          )]

          • 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 942 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()

          Potential coding error - existing temptables found when disposing database. Must be dropped!

          Show
          Janet Smith added a comment - I'm running Moodle 2.2.3+ (Build: 20120624) and I'm experiencing this exact error. The site was upgraded from version 1.9. Was this fix incorporated into Moodle 2.2? Here is the error message I see: Default exception handler: Error writing to database Debug: Duplicate entry '3-rdoe' for key 'mdl_tmpextu_mneuse_uix' INSERT INTO mdl_tmp_extuser (username,mnethostid) VALUES(?,?) [array ( 0 => 'rdoe', 1 => '3', )] 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 942 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() Potential coding error - existing temptables found when disposing database. Must be dropped!
          Hide
          Iñaki Arenaza added a comment -

          Hi Janet,

          your problem is a different one. You get a duplicate entry for a given username ('rdoe' in your example). This has usually 2 different causes:

          • you have specified a non-unique attribute for your usernames (this is rather unusual, but certainly possible),
          • you have specified the same LDAP context more than once. You may have typed it twice, or you may have specified a subcontext of another context and have enabled searching for subcontexts.

          Saludos.
          Iñaki.

          Show
          Iñaki Arenaza added a comment - Hi Janet, your problem is a different one. You get a duplicate entry for a given username ('rdoe' in your example). This has usually 2 different causes: you have specified a non-unique attribute for your usernames (this is rather unusual, but certainly possible), you have specified the same LDAP context more than once. You may have typed it twice, or you may have specified a subcontext of another context and have enabled searching for subcontexts. Saludos. Iñaki.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: