Error Debug info: Duplicate entry

Error Debug info: Duplicate entry

by Austin Redmond -
Number of replies: 2

Hello – we are running into an error with a new user. She was added to Moodle using our SSO provisioning and she is receiving an error that states:


Debug info: Duplicate entry '1-caylee.croft@cleardata.com' for key 'mdl_user_mneuse_uix' 


I have a screenshot of it. We've tried incognito window, removing her from the SSO group and adding her back but we currently need assistance fixing this so she can access our Moodle instance.


Attachment image001.png
Average of ratings: -
In reply to Austin Redmond

Re: Error Debug info: Duplicate entry

by Ken Task -
Picture of Particularly helpful Moodlers

Before trying below, make sure you have a DB backup! smile

mdl_user_mneuse_uix is Moodle Networking.   Even if your site isn't using Moodle MNet, every user account does have an mnethostID number.   That value should be 1:

mysql> select firstname,lastname,mnethostid from mdl_user;

change query above to add users email address and match that email address to get just that users info ... or user id.

Experienced something similar in past when a DB/tables/*somecolumns* weren't utf8mb4 compliant.

Using scripts in admin/cli/ fixed that issue.

However, you are reporting an index issue.

So ... might also check this out:

Version of Moodle?

In 4.0.4+ Site Admin Development XMLDB Editor Check Indexes tab
Says:
"This functionality will search for potential missing indexes in your Moodle server, generating (but not executing!) automatically the needed SQL statements to keep everything updated. Once generated you can copy such statements and execute them safely with your favourite SQL interface (don't forget to backup your data before doing that). It's highly recommended to be running the latest (+ version) available of your Moodle release before executing the search of missing indexes. This functionality doesn't perform any action against the DB (just reads from it), so can be safely executed at any moment."

running it shows the following:

Search results

Missing indexes found: 0

Extra indexes found: 0

No missing or extra indexes have been found, so no further action is required.

(see the complete log of the search below)

The complete log not included here as it is rather long, but does have many many user related items.

Also see SAMIL - that's authentication right?   So moodle's user table gets info from SAMIL.    If that is like LDAP there are settings for what to check/copy to Moodle and when ... like on every login.  SAMIL have such a mapping/settings?

What does that users info look like in whatever SAMIL uses for DB?

Fingers crossed!

'SoS', Ken

Average of ratings: Useful (1)
In reply to Ken Task

Re: Error Debug info: Duplicate entry

by Austin Redmond -
It was the SAML authentication. When we added them to the SSO group it created an empty entry in the list of users and once I updated the user it was good to go.