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

Error writing to database (any user login)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.7.1
    • Fix Version/s: None
    • Component/s: Authentication
    • Labels:
      None
    • Affected Branches:
      MOODLE_37_STABLE

      Description

      After successful update  from 3.3.9 to 3.7.1 try to login and get error:

      Default exception handler: Error writing to database Debug: Duplicate entry '1-22' for key 'user_mneuse_uix'
      INSERT INTO mdl_user (city,auth,username,lang,confirmed,lastip,timecreated,timemodified,mnethostid,calendartype,maildisplay,mailformat,maildigest,autosubscribe,trackforums) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
      [array (
      0 => '',
      1 => 'manual',
      2 => '22',
      3 => 'ru',
      4 => 1,
      5 => '127.0.0.1',
      6 => 1562840811,
      7 => 1562840811,
      8 => '1',
      9 => 'gregorian',
      10 => '0',
      11 => '1',
      12 => '2',
      13 => '1',
      14 => '1',
      )]
      Error code: dmlwriteexception

      • line 489 of \lib\dml\moodle_database.php: dml_write_exception thrown
      • line 1329 of \lib\dml\mysqli_native_moodle_database.php: call to moodle_database->query_end()
      • line 1375 of \lib\dml\mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
      • line 111 of \user\lib.php: call to mysqli_native_moodle_database->insert_record()
      • line 4007 of \lib\moodlelib.php: call to user_create_user()
      • line 4497 of \lib\moodlelib.php: call to create_user_record()
      • line 143 of \login\index.php: call to authenticate_user_login()

       

      The website uses the authentication through the LDAP server (OpenLDAP), user "22" already exist and it is not clear why the system is trying to create a new record in  table instead of updating it.

      We get the same error if try to log in with admin (user #1) created manualy.

      Server configuration: Apache/2.4.39 (Win64) OpenSSL/1.1.1b PHP/7.2.17 MySQL/5.7.26

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              evolik Eugene Volik
              Participants:
              Component watchers:
              Jake Dallimore, Jun Pataleta, Ryan Wyllie
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: