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

database authentication plugin intermittently turns usernames lowercase

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 2.1.1
    • Fix Version/s: None
    • Component/s: Authentication
    • Labels:
    • Environment:
      ubuntu 10.04 lts
    • Database:
      MySQL
    • Workaround:
      Hide

      deleting the user from mdl_user solves the problem and lets the sync continue.

      Show
      deleting the user from mdl_user solves the problem and lets the sync continue.
    • Affected Branches:
      MOODLE_21_STABLE

      Description

      The database authentication plugin intermittently turns usernames lowercase when it creates a user.

      We have usernames of the form 'FirstL' with L being the first letter of the last name, and occasionally followed by more lowercase letters to disambiguate users. We have a table in mysql with columns 'username', 'password', &c.

      We run the sync_users script using cron as specified in the documentation.

      Approximately 3% of the time, a user gets created with a lowercase username. The system then starts failing with a duplicate index error. I've X'd out the names for privacy reasons, but the case is consistent.

      Database transaction aborted automatically in /var/www/sites/unifiedschool.gc/auth/db/cli/sync_users.php
      Default exception handler: Error writing to database Debug: Duplicate entry '1-XxxxX' for key 'mdl_user_mneuse_uix'
      INSERT INTO mdl_user (firstname,lastname,email,username,confirmed,auth,mnethostid,lang) VALUES(?,?,?,?,?,?,?,?) [array (
      0 => 'Xxxx',
      1 => 'Xxxxx',
      2 => 'xxxxx@student.giantcampus.com',
      3 => 'XxxxX',
      4 => 1,
      5 => 'db',
      6 => '1',
      7 => '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 361 of /auth/db/auth.php: call to mysqli_native_moodle_database->insert_record()
      • line 66 of /auth/db/cli/sync_users.php: call to auth_plugin_db->sync_users()

      Replication steps:
      set up database auth plugin user syncing using mysql and mixed case users

      what is expected: user accounts
      what actually happens: cron job fails with message above

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              corprewr corprew reed
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: