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

database authentication plugin intermittently turns usernames lowercase

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • None
    • 2.1.1
    • Authentication
    • ubuntu 10.04 lts
    • MySQL
    • MOODLE_21_STABLE
    • 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.

      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

            Unassigned Unassigned
            corprewr corprew reed (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.