WSUS Post Installation Fails on Secondary Software Update Point

Chris Cornish 1 Reputation point
2021-10-21T19:24:22.777+00:00

This configuration was working previously but we were trying to troubleshoot an issue deploying apps to sites without DP's and our remote (VPN) users.

We are currently running Configuration Manager Current branch (2107) on server 2016. We have our SQL server on server 1, a SUP and our Primary WSUS server on server 2 and server 3 was originally set up as a replica server and a SUP as well.

The SUP role has been removed from server 3 and I've removed the WSUS role from the server. Re-installing WSUS fails on the post installation with the following error;

Fatal Error: ALTER DATABASE failed because a lock could not be placed on database 'SUSDB'. Try again later.
ALTER DATABASE statement failed.

The log shows;

2021-10-21 13:55:24 System.Data.SqlClient.SqlException (0x80131904): ALTER DATABASE failed because a lock could not be placed on database 'SUSDB'. Try again later.
ALTER DATABASE statement failed.
at Microsoft.UpdateServices.DatabaseAccess.DBConnection.DrainObsoleteConnections(SqlException e)
at Microsoft.UpdateServices.DatabaseAccess.DBConnection.ExecuteCommandNoResult()
at Microsoft.UpdateServices.Administration.ConfigureDB.ExecuteQueryNoResults(String query)
at Microsoft.UpdateServices.Administration.ConfigureDB.ConnectToDB()
at Microsoft.UpdateServices.Administration.ConfigureDB.Configure()
at Microsoft.UpdateServices.Administration.ConfigureDB.Run(String instanceName, Action`1 logWriter, Boolean contentLocal)
at Microsoft.UpdateServices.Administration.PostInstall.Run()
at Microsoft.UpdateServices.Administration.PostInstall.Execute(String[] arguments)
ClientConnectionId:267aa928-9db1-4f22-b67b-8a22f431f48f
Error Number:5061,State:1,Class:16

I've checked the permissions on the SQL database. I've shutdown the primary WSUS server to remove any locks on the SQL database and confirmed in SQL Management Studio. I've manually run the alter database command to confirm the database is in multi user mode, etc.

Any other suggestions?

Microsoft Security | Intune | Configuration Manager | Other
SQL Server | Other
{count} votes

4 answers

Sort by: Most helpful
  1. Erland Sommarskog 122.7K Reputation points MVP Volunteer Moderator
    2021-10-21T21:43:30.493+00:00

    I believe the tags for Endpoint Manager starts with mem. Then again, this certainly looks like an SQL problem. Apparently there is a different process in the database.

    Connect to the database with SSMS or SQLCMD and run:

    ALTER DATABASE SUSDB SET SINGLE_USER WITH ROLLBACK IMMEDIATE
    ALTER DATABASE SUSDB SET MULTI_USER
    

    and try again.

    Although, you may want to wait to try this, until you have added a mem tag, and gotten response people who know Endpoint Manager and WSUS. I am not familiar with these myself; I only know SQL Server.


  2. AllenLiu-MSFT 49,316 Reputation points Microsoft External Staff
    2021-10-22T08:06:20.53+00:00

    Hi, @Chris Cornish
    Thank you for posting in Microsoft Q&A forum.

    It seems the issue is more related to SQL Server, here is an article you may refer to find the locks and kill all locks, check it to see if it helps:
    https://www.butsch.ch/post/WSUS-Unable-to-Take-WSUS-SQL-DB-offline-or-Dettach-(SQL-Locks).aspx
    (Please note: Information posted in the given link is hosted by a third party. Microsoft does not guarantee the accuracy and effectiveness of information.)


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


    0 comments No comments

  3. Chris Cornish 1 Reputation point
    2021-10-22T14:28:53.893+00:00

    Followed the steps outlined in the URL and I get a different error;

    2021-10-22 09:41:13 Synchronization in progress. Please cancel synchronization and rerun postinstall again. Exception: System.Net.WebException: The request failed with HTTP status 401: Unauthorized.
    at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
    at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
    at Microsoft.UpdateServices.Internal.ApiRemoting.GetServerVersion()
    at Microsoft.UpdateServices.Internal.DatabaseAccess.AdminDataAccessProxy.GetServerVersion()
    at Microsoft.UpdateServices.Internal.BaseApi.UpdateServer.CreateUpdateServer(String serverName, Boolean useSecureConnection, Int32 portNumber)
    at Microsoft.UpdateServices.Internal.BaseApi.UpdateServer..ctor(Boolean bypassApiRemoting)
    at Microsoft.UpdateServices.Setup.StartServer.StartServer.FixSubscriptionCategories()
    2021-10-22 09:41:13 StartServer encountered errors. Exception=Synchronization in progress. Please cancel synchronization and run postinstall again.
    2021-10-22 09:41:13 Microsoft.UpdateServices.Administration.CommandException: Failed to start and configure the WSUS service
    at Microsoft.UpdateServices.Administration.PostInstall.Run()
    at Microsoft.UpdateServices.Administration.PostInstall.Execute(String[] arguments)
    Fatal Error: Failed to start and configure the WSUS service

    0 comments No comments

  4. AllenLiu-MSFT 49,316 Reputation points Microsoft External Staff
    2021-10-25T08:39:25.457+00:00

    Hi, @Chris Cornish

    Please try to open IIS console, delete the WSUS site, then try post installation task again.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.