Why during the upgrade from UiPath Orchestrator, the database seeder fails due to a DbUpdateException triggered by an attempt to insert a row with a duplicate key (ClientId=, RedirectUri=https://orchestrator_url)open_in_new into ClientPostLogoutRedirectUris?
Issue Description
While upgrading Orchestrator, the process can fail due to a DbUpdateException triggered by an attempt to insert a row with a duplicate key (ClientId=, RedirectUri=https://orchestrator_url) into ClientPostLogoutRedirectUris.
Root Cause
In the database tables that host the URL, [identity].[ClientPostLogoutRedirectUris] and [identity].[ClientRedirectUris], the URL entries can have a different format than the DNS entry from the Certificate Details, Subject and Subject Alternative Name or the config files (UiPath.Orchestrator.dll.config, Identity and ResourceCatalog appsettings.Production.json).
In the database, the URL can be https://Upperletter.com, and in the config files, https://Lowerletter.com or vice versa.
The error is thrown as the upgrade process is rewriting the database entries during the upgrade, and since both locations host a different URL format, it will try to add the URL under the format from the config file again, but will fail since the entry exists under a different format.
Resolution
Note: We recommend that before making any changes into the database, to take a full backup.
The solution to this upgrade problem is to change the URL entries from the database to match the details of the Certificate (Subject \ Subject Alternative Name) and the config files, as the process is case sensitive and both database, certificate and config files must host the DNS under the same format (Lower Letters\ Lower Letters or Upper Letters \ Upper Letters).
To update the database entries, follow the public documentation here, where the new entries are set to match the format from the certificate details.