WSUS console crashing on cleaning unused updates and updates revisions

Sarfraz Aslam 31 Reputation points
2023-11-06T08:20:16.4533333+00:00

Hello,

I have WSUS setup on Server 2019, On Server cleanup wizard, (unused updates and updates revisions) WSUS console crashes having below error in copy to clipboard and in GUI it is different error.

WSUS

The WSUS administration console was unable to connect to the WSUS Server Database.
    
Verify that SQL server is running on the WSUS Server. If the problem persists, try restarting SQL.
    

System.Data.SqlClient.SqlException -- Execution Timeout Expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

Source
.Net SqlClient Data Provider

Stack Trace:
   at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
   at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)
   at Microsoft.UpdateServices.UI.SnapIn.Wizards.ServerCleanup.ServerCleanupWizard.OnCleanupComplete(Object sender, PerformCleanupCompletedEventArgs e)
Microsoft Security | Intune | Configuration Manager | Updates
Windows for business | Windows Server | User experience | Other
0 comments No comments
{count} votes

5 answers

Sort by: Most helpful
  1. Sarfraz Aslam 31 Reputation points
    2023-11-16T05:23:59.9533333+00:00

    This SQL query resolves my issue.

    USE SUSDB
    DECLARE @var1 INT
    DECLARE @msg nvarchar(100)
    CREATE TABLE #results (Col1 INT) INSERT INTO #results(Col1)
    EXEC spGetObsoleteUpdatesToCleanup
    DECLARE WC Cursor FOR SELECT Col1 FROM #results
    OPEN WC
    FETCH NEXT FROM WC INTO @var1 WHILE (@@FETCH_STATUS > -1)
    BEGIN SET @msg = 'Deleting ' + CONVERT(varchar(10), @var1) RAISERROR(@msg,0,1) WITH NOWAIT
    EXEC spDeleteUpdate @localUpdateID=@var1
    FETCH NEXT FROM WC INTO @var1
    END
    CLOSE WC
    DEALLOCATE WC
    DROP TABLE #results

    • Run query to reindex WSUS DB,

    --Updated statistics,

    Use SUSDB
    Go
    exec sp_msforeachtable 'update statistics ? with fullscan'
    Go

    ---Rebuild Indexes,

    Use SUSDB
    Go
    Exec sp_MSForEachtable 'DBCC DBREINDEX (''?'')'
    Go
     

    1 person found this answer helpful.

  2. AllenLiu-MSFT 49,316 Reputation points Microsoft External Staff
    2023-11-07T02:47:21.5033333+00:00

    Hi, @Sarfraz Aslam

    Thank you for posting in Microsoft Q&A forum.

    This can occur if the application cache is corrupted. To resolve this issue, try to delete the WSUS application cache from the location below:

    C:\Documents and Settings<user profile>\application data\microsoft\mmc

    where <user profile> is the currently logged-in user profile.

    For your reference:

    https://learn.microsoft.com/en-us/troubleshoot/mem/configmgr/update-management/wsus-console-crashes#the-windows-server-update-services-console-crashes-when-browsing-for-updates


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Add comment".


  3. AllenLiu-MSFT 49,316 Reputation points Microsoft External Staff
    2023-11-16T08:15:12.38+00:00

    Thanks very much for your feedback. We're glad that the problem is solved by reindexing WSUS DB.

    0 comments No comments

  4. Pierre Auger 60 Reputation points
    2023-12-22T14:05:34.32+00:00

    Hello

    is the command is good if we use wid data base ?

    and i need to install sql management studio ?

    Thanks


  5. Pierre Auger 60 Reputation points
    2024-01-10T13:58:30.9666667+00:00

    also it runing for at least 6 days i forgot to stop the service should i restart over ?

    Thanks

    0 comments No comments

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.