Moodle
  1. Moodle
  2. MDL-29358

Error writing to database Debug: Duplicate entry for key 'user_mneuse_uix'

    Details

    • Database:
      MySQL
    • Affected Branches:
      MOODLE_21_STABLE
    • Rank:
      18884

      Description

      Hi

      I migrated from 1.9.4 moodle to 2.1.1+ and using Openldap to import users appears this error. It's more similar to other issue (number 24666) but it's closed.

      When I syncronize appears:
      Database transaction aborted automatically in /usr/share/moodle/auth/ldap/cli/sync_users.php
      Default exception handler: Error writing to database Debug: Duplicate entry '3-joan@admi.escola.es' for key 'user_mneuse_uix'
      INSERT INTO user (firstname,lastname,email,idnumber,username,confirmed,auth,mnethostid,lang) VALUES(?,?,?,?,?,?,?,?,?)
      [array (
      0 => 'Joan',
      1 => 'Escola',
      2 => 'joan@admi.escola.es',
      3 => '00265',
      4 => 'joan@admi.escola.es',
      5 => 1,
      6 => 'ldap',
      7 => '3',
      8 => 'en',
      )]

      • line 397 of /lib/dml/moodle_database.php: dml_write_exception thrown
      • line 878 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
      • line 920 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
      • line 853 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()

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

      Could be relation with:

      http://tracker.moodle.org/browse/MDL-24666

      My platform is debian squeeze with mysql 5.1.49 and php 5.3.3

      I used this guide but not appears values

      http://docs.moodle.org/20/en/DuplicateUsernames

        Issue Links

          Activity

          Hide
          Michael de Raadt added a comment -

          That does seem identical to the earlier report.

          I'm wondering if you have the latest version? Perhaps you could try updating and trying again.

          Show
          Michael de Raadt added a comment - That does seem identical to the earlier report. I'm wondering if you have the latest version? Perhaps you could try updating and trying again.
          Hide
          marcos added a comment -

          Yes, Moodle 2.1.1+ (Build: 20110831)

          Im not expert of Mysql, but friends mine says the error seams to be for a bad check of temporary hash. In the previous version of auth.php produced errors with the same database when users are incompleted, but this time the user is used everyday. I made different tests, deleting all users and uploading other time, and everytime blocks in the same user.

          Any idea will be apreciated

          Show
          marcos added a comment - Yes, Moodle 2.1.1+ (Build: 20110831) Im not expert of Mysql, but friends mine says the error seams to be for a bad check of temporary hash. In the previous version of auth.php produced errors with the same database when users are incompleted, but this time the user is used everyday. I made different tests, deleting all users and uploading other time, and everytime blocks in the same user. Any idea will be apreciated
          Hide
          Iñaki Arenaza added a comment -

          Hi Marcos,

          would you be able to patch your site to add a few debugging statements so we can trace the root of the problem?

          Also providing your LDAP configuration settings (obscuring passwords and other sensitive information) would help a lot

          Saludos.
          Iñaki.

          Show
          Iñaki Arenaza added a comment - Hi Marcos, would you be able to patch your site to add a few debugging statements so we can trace the root of the problem? Also providing your LDAP configuration settings (obscuring passwords and other sensitive information) would help a lot Saludos. Iñaki.
          Hide
          Michael de Raadt added a comment -

          There are a number of related issues here and I'm not sure if they have a root cause.

          Show
          Michael de Raadt added a comment - There are a number of related issues here and I'm not sure if they have a root cause.
          Hide
          marcos added a comment -

          Hi

          Finally I discover the problem. When I made the ldap upload I had two records with same value, but the information appeared refers the good value, not the duplicate. Really I discover a duplicate value inside 3=> 00265 appointing to and old value. I deleted this and finally appears all correctly

          For futurs problems can be very useful to appears the two values, not only one, if it's possible.

          Thanks for you time and apologies for the inconvenience

          Show
          marcos added a comment - Hi Finally I discover the problem. When I made the ldap upload I had two records with same value, but the information appeared refers the good value, not the duplicate. Really I discover a duplicate value inside 3=> 00265 appointing to and old value. I deleted this and finally appears all correctly For futurs problems can be very useful to appears the two values, not only one, if it's possible. Thanks for you time and apologies for the inconvenience

            People

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

              Dates

              • Created:
                Updated:
                Resolved: