PostSetupConfigurationTaskException was thrown when installing SP1

Last week we had to update our customer’s SharePoint 2013 environment to SP1. We first updated the development environement and the test environment and didn’t have any issues there. However, when updating the QA environment (multi-server), we ran into a strange error. The installation went fine, but the Product and Patch Configuration Wizard would continuously fail at step 9 ‘Upgrading SharePoint products’.
Naturally, we tried to get some detailed exception information from the logfile. However, the message below wasn’t exactly crystal clear:

SyncUpgradeTimerJob: sleeping for 10 seconds
04/15/2014 09:29:54 12 INF SyncUpgradeTimerJob: sleeping for 10 seconds
04/15/2014 09:30:04 12 INF SyncUpgradeTimerJob: Upgrade timer job failed. Return -1.
04/15/2014 09:30:04 12 ERR The exclusive inplace upgrader timer job failed.
04/15/2014 09:30:04 12 INF Entering function StringResourceManager.GetResourceString
04/15/2014 09:30:04 12 INF Resource id to be retrieved is UpgradeTaskFailConfigSyncDisplayLabel for language English (United States)
04/15/2014 09:30:04 12 INF Resource retrieved id UpgradeTaskFailConfigSyncDisplayLabel is Failed to upgrade SharePoint Products.
04/15/2014 09:30:04 12 INF Leaving function StringResourceManager.GetResourceString
04/15/2014 09:30:04 12 INF Entering function Common.BuildExceptionMessage
04/15/2014 09:30:04 12 INF Entering function StringResourceManager.GetResourceString
04/15/2014 09:30:04 12 INF Resource id to be retrieved is ExceptionInfo for language English (United States)
04/15/2014 09:30:04 12 INF Resource retrieved id ExceptionInfo is An exception of type {0} was thrown. Additional exception information: {1}
04/15/2014 09:30:04 12 INF Leaving function StringResourceManager.GetResourceString
04/15/2014 09:30:04 12 INF Leaving function Common.BuildExceptionMessage
04/15/2014 09:30:04 12 ERR Task upgrade has failed with a PostSetupConfigurationTaskException An exception of type Microsoft.SharePoint.PostSetupConfiguration.PostSetupConfigurationTaskException was thrown. Additional exception information: Failed to upgrade SharePoint Products.
04/15/2014 09:30:04 12 INF Entering function Common.BuildExceptionInformation
04/15/2014 09:30:04 12 INF Entering function Common.BuildExceptionMessage
04/15/2014 09:30:04 12 INF Entering function StringResourceManager.GetResourceString
04/15/2014 09:30:04 12 INF Resource id to be retrieved is ExceptionInfo for language English (United States)
04/15/2014 09:30:04 12 INF Resource retrieved id ExceptionInfo is An exception of type {0} was thrown. Additional exception information: {1}
04/15/2014 09:30:04 12 INF Leaving function StringResourceManager.GetResourceString
04/15/2014 09:30:04 12 INF Leaving function Common.BuildExceptionMessage
04/15/2014 09:30:04 12 INF Leaving function Common.BuildExceptionInformation
04/15/2014 09:30:04 12 ERR An exception of type Microsoft.SharePoint.PostSetupConfiguration.PostSetupConfigurationTaskException was thrown. Additional exception information: Failed to upgrade SharePoint Products.
Microsoft.SharePoint.PostSetupConfiguration.PostSetupConfigurationTaskException: Exception of type ‘Microsoft.SharePoint.PostSetupConfiguration.PostSetupConfigurationTaskException’ was thrown.
at Microsoft.SharePoint.PostSetupConfiguration.UpgradeTask.Run()
at Microsoft.SharePoint.PostSetupConfiguration.TaskThread.ExecuteTask()

After a few hours of making sure everything was set up correctly, we finally found out the cause for this strange issue. It turns out that SharePoint doesn’t want anyone other than SharePoint managed accounts to have dbowner permissions for the SharePoint databases. In our QA environment however, access to the SQL Server is heavily secured, and corporate policies enforce certain domain groups to automatically get dbowner permissions. After we removed these permissions and ran the configuration wizard again, it finally completed without any issues. Sometimes, SharePoint puzzles me…