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