"Uncaught Error" During Database Configuration while Installing or Upgrading Test Manager

How to resolve the "Uncaught error" while running the MSI installer to set up Test Manager

Issue Description

You might encounter this error within the MSI installer while attempting to install or upgrade Test Manager.

As shown in the image, it is usually seen during the database configuration step, when the installer attempts to set up or modify the Test Manager DB at the backend.

Resolution

The "Uncaught Error" is a generic error, and the root cause may vary. To troubleshoot it, check the MSI logs.

You can find the MSI logs at %temp% (an environment variable that represents the temp directory). In the File Explorer, go to %temp% as location, after a failed install. The installer will be some random combination of numbers and ends with msi.log (i.e. c1235213msi.log).

Tackle the issue according to the error stack trace. Here are a few examples:

Error 1

Error code: 11000 ERR_UNCAUGHT, Message: No Tenant info found in appsettings file
Running migrations for tags
Uncaught exception: CREATE DATABASE permission denied in database 'master’."
Uncaught error.
Error code: 11000 ERR_UNCAUGHT, Message: Uncaught exception: Cannot create file 'XXXXX\XXXSQLSERVER\UiPathTestManager.mdf' because it already exists. Change the file path or the file name, and retry the operation.
CREATE DATABASE failed. Some file names listed could not be created. Check related errors..
Uncaught error.
"Error code: 11000 ERR_UNCAUGHT, Message: No Tenant info found in appsettings file Running migrations for tags
Uncaught exception: The EXECUTE permission was denied on the object 'xp_logevent', database 'mssqlsystemresource', schema 'sys'..
Uncaught error.

If you observe one or more of the following errors, check the following:

  • In case of a fresh Test Manager installation, check if the database being used is a brand-new one with no existing entries.
  • If the user running the installer has the "db_creator" permission within the SQL server, you can simply give a new DB name in the installer, and it will take care of creating the DB for you.
  • If unable to give the "db_creator" permission to the user, manually create a new DB that is empty and provide the database name during the installation.
    • After the database is created, the user who connects to the SQL database still needs the "db_owner" role.
  • Please read more about the SQL server configuration requirements here.

Error 2

Error code: 11000 ERR_UNCAUGHT, Message: Running migrations for tags
Uncaught exception: A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - The received certificate has expired.).
Uncaught error.
  • For this error, check the SQL server certificate; it usually occurs when the SQL server certificate has expired. Take the necessary steps to renew/replace the SQL server certificate and ensure that it is present on the machine where you intend to set up the Test Manager.
  • Read more at Certificate management (SQL Server Configuration Manager).

Error 3

Error code: 11000 ERR_UNCAUGHT, Message: No Tenant info found in appsettings file
Running migrations for tags
Uncaught exception: A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - The target principal name is incorrect.).
Uncaught error.
  • This error usually occurs when the SQL server host name has not been correctly configured.
  • Ensure that all requirements are met, as described in Configure SQL Server Instance for Test Manager.
  • Note that the default value of the "SQL Server Host" within the Test Manager installer will be set to ".". You would need to modify this to the appropriate value, in the format: "MyMachine\MyInstance".
  • See Step-7 here for more information on the SQL host configuration.


Error 4

Error code: 11000 ERR_UNCAUGHT, Message: !!! An error occured executing the following sql:
CREATE UNIQUE INDEX ON . ( ASC, ASC)
The error was The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'tmcore.Projects' and the index name 'IX_Projects_TenantId_ProjectPrefix'. The duplicate key value is (a3bbc576-b837-46ce-929c-c2b861111036, AAA).
The statement has been terminated.
Uncaught error.
Error code: 11000 ERR_UNCAUGHT, Message: !!! An error occured executing the following sql:
CREATE VIEW .
AS
SELECT
                 d., d., d., cd., cd.
FROM
                 .Defects d
                 LEFT OUTER JOIN .ConnectorDefects cd
                                   ON d. = cd.
 The error was There is already an object named 'DefectsView' in the database.
!!! +- There is already an object named 'DefectsView' in the database..
Uncaught error.
Error code: 11000 ERR_UNCAUGHT, Message: !!! An error occured executing the following sql:
ALTER TABLE . ADD CONSTRAINT FOREIGN KEY () REFERENCES . ()
The error was The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "FK_LinkedTestSets_Folders_FolderId". The conflict occurred in database "UiPathTestManager", table "tmorch.Folders", column 'Id'.
!!! +- The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "FK_LinkedTestSets_Folders_FolderId". The conflict occurred in database "UiPathTestManager", table "tmorch.Folders", column 'Id'..
Uncaught error.
  • The errors above usually occur during Test Manager upgrades, due to database conflicts.
  • To resolve these, the best and most robust solution would be to restore the Test Manager DB from a backup and re-attempt the upgrade.
  • Sometimes, some manual steps may help but these are not recommended and also, these depend on what table/schema is affected. Refer to this article for an example.

If the error in the MSI log is not covered here, please create a ticket with UiPath support here and include the MSI log.