> For the complete documentation index, see [llms.txt](https://docs.mosip.io/1.2.0/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mosip.io/1.2.0/setup/upgrade/upgrade-runbook/mock-services/upgrade-handling-case-insensitive-duplicates.md).

# Handling Case Insensitive Duplicated User Details

In the registration processor, there was an issue where packets were failing at the supervisor validation stage when the username of the supervisor was entered in a different case than it appeared in the database. To resolve this issue, a case insensitive search will be implemented to retrieve the username of the supervisor during the validation stage.

In order for this fix to work properly, it is necessary for the `user_id` column of the `user_details` table in the master database to not contain any case insensitive duplicates.

If there are any duplicates in this table, packets will fail at the supervisor validation stage once again. Therefore, it is important to deactivate or delete these case insensitive duplicates. It should be noted that this action will not have any impact on other areas, as the mapping between keycloak users and the `user_id` of the `user_details` table is one-to-one and case insensitive.

## How can we identify case-insensitive duplicates in the `user_id` column of the `user_details` table?

Follow these steps:

1. Log in to the master schema of the `mosip_master` database.
2. Open a query tool.
3. Execute the following SQL command in the query tool:

   ```
   SELECT lowerid, cnt from (SELECT count(*) as cnt,LOWER(id) as lowerid FROM master.user_detail group by lowerid) t1 where cnt>1 ;
   ```

   Make sure to copy the output to a text file to manage the duplicate data effectively.

## How to deactivate/delete the case insensitive duplicates?

1. Login in to the [admin portal](https://docs.mosip.io/1.2.0/modules/administration/admin-portal-user-guide) with a user having `ZONAL_ADMIN` role.
2. On the left pane, click on `Resources` in the side-menu.

   ![](https://1836199994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4EyCrLbFom7vj7UcMIUZ%2Fuploads%2Fgit-blob-3fb7a9c1d671c50bb15505332ae931f89326e440%2Fupgrade-hcid1.jpg?alt=media)
3. Select `User Center Mapping` under Resources in the side-menu.

   ![](https://1836199994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4EyCrLbFom7vj7UcMIUZ%2Fuploads%2Fgit-blob-3934882cb659e820eaa89fe6e7ae2ae9d4439343%2Fupgrade-hcid2.jpg?alt=media)
4. Click **Filter** on the `User Center Mapping` page.

   ![](https://1836199994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4EyCrLbFom7vj7UcMIUZ%2Fuploads%2Fgit-blob-1f698533924bad9a6c3e21e9f4cf208b10315727%2Fupgrade-hcid3.jpg?alt=media)
5. Enter the `user_id` that was retrieved from the database and copied into the text file. After entering the `user_id`, click on the **Apply** button.

   ![](https://1836199994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4EyCrLbFom7vj7UcMIUZ%2Fuploads%2Fgit-blob-d1ce1b788ab7efc7b1598c6a0945327b23d43b81%2Fupgrade-hcid4.jpg?alt=media\&token=d171683c-a174-495b-a69d-ea9c4825cabb)

   * Now, on the `User Center Mapping` page, case insensitive duplicates of `user_id` would be displayed.
   * Based on the Center, choose the entry that can be deactivated/deleted.
   * Now click on the ellipsis of the selected entry.

   ![](https://1836199994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4EyCrLbFom7vj7UcMIUZ%2Fuploads%2Fgit-blob-01184284e85315864e4bf39098769f445a884d35%2Fupgrade-hcid5.jpg?alt=media)
6. Select the appropriate action (Delete/ Deactivate) on that entry.

   ![](https://1836199994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4EyCrLbFom7vj7UcMIUZ%2Fuploads%2Fgit-blob-cc96be5b34354c873b6eb381ed274d3fcc43072f%2Fupgrade-hcid6.jpg?alt=media)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.mosip.io/1.2.0/setup/upgrade/upgrade-runbook/mock-services/upgrade-handling-case-insensitive-duplicates.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
