Domanda

I was running the /auth/ldap/cli/sync_users.php cron script, and I got this error: Debug: Duplicate entry '1-010' for key 'mdl_tmpextu_mneuse_uix'. What could be the cause(s)?

More information about the errors:

INSERT INTO mdl_tmp_extuser (username,mnethostid) VALUES(?,?)
[array (
  0 => '010',
  1 => '1',
)]
Error code: dmlwriteexception
* line 444 of /lib/dml/moodle_database.php: dml_write_exception thrown
* line 1080 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
* line 1043 of /auth/ldap/auth.php: call to mysqli_native_moodle_database->insert_record_raw()
* line 738 of /auth/ldap/auth.php: call to auth_plugin_ldap->ldap_bulk_insert()
* line 63 of /auth/ldap/cli/sync_users.php: call to auth_plugin_ldap->sync_users()
È stato utile?

Soluzione

It looks like there was more than one user with the same username returned by the LDAP system.

The code that is causing the error is the code that pulls all the usernames from the LDAP system and inserts them into a temporary table, before comparing this list with the existing users already registered with the Moodle site.

I suggest you check the LDAP system to see if there is more than one user with the username (according to the error message) of '010'.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top