SharePoint Views

PSConfig error at step 3 of 4. Cannot upgrade SharePoint database

PSConfig is failing at step 3 of 4, Cannot upgrade SharePoint database. It is failing to upgrade SharePointSearchAdmin database, throwing an Exception: User does not have permission to perform this action

Here is the complete error description found in logs

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.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)   

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

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

 at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)   

 at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()   

 at Microsoft.Office.Server.Data.SqlSession.ExecuteNonQuery(SqlCommand command)   

 at Microsoft.Office.Server.Data.SqlDatabaseManager.GrantAccess(String user)   

 at Microsoft.Office.Server.Search.Administration.SearchDatabase.GrantAccess(String username, String role)   

 at Microsoft.Office.Server.Search.Administration.SearchDatabase.SynchronizeAccessRules(SearchServiceApplication searchApp)   

 at Microsoft.Office.Server.Search.Administration.SearchServiceApplication.SynchronizeDatabases()   

 at Microsoft.Office.Server.Search.Upgrade.SearchAdminDatabaseSequence.PostUpgrade()   

 at Microsoft.SharePoint.Upgrade.SPUpgradeSession.Upgrade(Object o, Boolean bRecurse)

Farm Admin account has all the permissions configured properly. Search account and all the accounts are also configured properly.

Resolution:

Clearly it is evident from logs that issue is with Search Administration Database. To get past this error, stop the Windows SharePoint Search service through windows services console in all the servers in which search is running.

Then try running PSConfig or configuration wizard. Configuration wizard starts all the services which are supposed to be running after upgrading all the databases and components.