Migration failed Init Update Server CREATE DATABASE permission denied in database master

Cannot perform the Orchestrator upgrade to 2021.10 version because the installation was rolled back.

During the upgrade the following error is thrown in the installer:

System.Exception: Migration failed: Init Update Server: CREATE DATABASE permission denied in database 'master'.

System.Exception: Init Update Server: CREATE DATABASE permission denied in database 'master'.

at UiPath.Orchestrator.Setup.DatabaseMigration.Helpers.DatabaseMigratorBase`3.InstallOrUpdateDatabase() in C:\or-bld-ag-ccd44bc3-we\_work\1\s\src\Setup\DatabaseMigration\Helpers\DatabaseMigratorBase.cs:line 27

at UiPath.Orchestrator.Cli.Database.DatabaseOperationsManager.UpdateToLatestAsync(String hostAdminPass, Nullable`1 changeHostAdminPass, String tenantAdminPass, Nullable`1 changeTenantAdminPass) in C:\or-bld-ag-ccd44bc3-we\_work\1\s\src\Setup\Cli\Database\DatabaseOperationsManager.cs:line 57

at UiPath.Orchestrator.Cli.Database.DatabaseCommandHandler.HandleDatabaseUpgradeAsync(DatabaseUpgradeOptions options) in C:\or-bld-ag-ccd44bc3-we\_work\1\s\src\Setup\Cli\Database\DatabaseCommandHandler.cs:line 50

at UiPath.Orchestrator.Cli.Database.DatabaseCommandHandler.HandleAsync(Parser parser, String[] args) in C:\or-bld-ag-ccd44bc3-we\_work\1\s\src\Setup\Cli\Database\DatabaseCommandHandler.cs:line 16 at UiPath.Configuration.Database.DatabaseMigrationToolWrapper.RunTool()

at UiPath.Configuration.Database.DatabaseMigrationToolWrapper.InstallOrUpdateDatabase()

at UiPath.OrchestratorCAs.UpdateServerDatabaseManager.ApplyDbMigrations()

at UiPath.OrchestratorCAs.CustomActions.Deferred.UpdateConfigurationAndDatabasesAction.Execute()

at UiPath.OrchestratorCAs.CustomActions.Base.BaseCustomAction.InternalExecute()

After the rollback, when trying to access the orchestrator we get in Event Viewer the Following Errors:

System.Data.Entity.Core.EntityCommandExecutionException: An error occurred while executing the command definition. See the inner exception for details. ---> System.Data.SqlClient.SqlException: Invalid object name 'dbo.BackgroundJobs'.

at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)

at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)

at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)

at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()

at System.Data.SqlClient.SqlDataReader.get_MetaData()

at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)

at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)

at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)and

System.ArgumentNullException: Value cannot be null.

Parameter name: value

at object Newtonsoft.Json.JsonConvert.DeserializeObject(string value, Type type, JsonSerializerSettings settings)

at T Newtonsoft.Json.JsonConvert.DeserializeObject<T>(string value, JsonSerializerSettings settings)

at async Task<MaintenanceSetting> UiPath.Orchestrator.Core.Settings.MaintenanceSettingManager.GetMaintenanceAsync()

at async Task<bool> UiPath.Orchestrator.Core.Settings.MaintenanceSettingManager.IsActiveAsync()

at async Task<BackgroundJobResultAction> UiPath.Orchestrator.Core.BackgroundJobs.System.BaseSystemJob.ExecuteAsync(string args)

at async Task UiPath.Orchestrator.Scheduling.Jobs.QuartzBackgroundJob.Execute(IJobExecutionContext context)


To solve these errors:

  1. Check the SQL user Server Roles, make sure it has db creator rights or sysadmin

5:42

  1. And run the upgrade again.

We can specify the existing DB name as well instead of UiPathUpdateServer DB for the new tables. If DB permissions are not allowed, specifying the existing DB will fix the issue and new tables will get added to the current UiPath DB.

Just an added information. Worked for me since create permission was not given.