Orchestrator Package Publish issue 0x80131904

Unable to publish the package to orchestrator getting error: An error occurred Below is the eventviewer log

System.Data.SqlClient.SqlException (0x80131904): The EXECUTE permission was denied on the object ‘sp_getapplock’, database ‘mssqlsystemresource’, schema ‘sys’.

While publishing the package to the orchestrator getting below error in the orchestrator eventviewer logs:

System.Data.SqlClient.SqlException (0x80131904): The EXECUTE permission was denied on the object 'sp_getapplock', database 'mssqlsystemresource', schema 'sys'.

at Task System.Data.SqlClient.SqlCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)+(Task result) => { }

It seems to be an issue with the database execution permission.

Take the database backup of master and UiPath before running the following command.

Login with sa user or admin user (which has full access) and run the below command.

USE master

GO

GRANT EXECUTE ON [sys].[sp_getapplock] to [orchestratorsqlloingusername]

if above not works use the below

USE master

GRANT EXECUTE on sp_getapplock to public;