none
WSUS Cleanup wizard keeps crashing/timing out, result: Reset Server Node RRS feed

  • Question

  • Hi all,

    Everytime I try to run the cleanup wizard WSUS crashes and I need to press Reset Server Node to get it up again.

    The server  is a replica server. I tried everything, I am on the newest version as far as I know. I also ran the WsusDBMaintenance script multiple times and I tried to run the wizard from powershell by a script; but that also timed out/crashes WSUS. The wizard seems to crash on these two catagories:

    - Unused updates

    - Expired updates

    When i run it for the other catagories it runs fine and actually finishes the process.

    I am on version 3.2.7600.274. OS is Server 2008 R2. I hope someone can come up with a solution...

    Best regards,

    Dylan


    • Edited by DylanStr Tuesday, November 22, 2016 1:22 PM
    Tuesday, November 22, 2016 1:21 PM

Answers

  • Hi DylanStr,

    Generally, this issue may due to multiple updates in the database.

    Check if the following method could work:

    Please set the sync to manual on the downstream server which you are running this

    Step1

    Connect to SQL management studio and connect to SUSDB
    \\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query
    Copy below script and change the adminname parameter to your user name and parameter (@adminName=N'domain\user)


    --Decline Superseded
    DECLARE @var1 uniqueidentifier
    DECLARE @msg nvarchar(100)
    declare DU Cursor
    For
    Select UpdateID from vwMinimalUpdate where IsSuperseded =1
    Open DU
    Fetch next From DU
    into @var1
    WHILE (@@FETCH_STATUS > -1)
    BEGIN
    --SET @msg = 'Declining ' + CONVERT(varchar(100), @var1)
    --print @msg
    RAISERROR(@msg,0,1) WITH NOWAIT exec spDeclineUpdate @updateID=@var1,@adminName=N'domain\user',@failIfReplica=1
    FETCH NEXT FROM DU INTO @var1 END
    CLOSE DU
    DEALLOCATE DU

    Step2
    After this finishes, Run the re-indexing query below
    https://gallery.technet.microsoft.com/scriptcenter/6f8cde49-5c52-4abd-9820-f1d270ddea61


    Step3
    Run below
    -------------------------------------------------------------
    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

    Step4
    Run the reindex script you have

    Best Regards,

    Anne


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    • Marked as answer by DylanStr Tuesday, November 29, 2016 9:22 AM
    Wednesday, November 23, 2016 3:19 AM
    Moderator

All replies

  • Hi DylanStr,

    Generally, this issue may due to multiple updates in the database.

    Check if the following method could work:

    Please set the sync to manual on the downstream server which you are running this

    Step1

    Connect to SQL management studio and connect to SUSDB
    \\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query
    Copy below script and change the adminname parameter to your user name and parameter (@adminName=N'domain\user)


    --Decline Superseded
    DECLARE @var1 uniqueidentifier
    DECLARE @msg nvarchar(100)
    declare DU Cursor
    For
    Select UpdateID from vwMinimalUpdate where IsSuperseded =1
    Open DU
    Fetch next From DU
    into @var1
    WHILE (@@FETCH_STATUS > -1)
    BEGIN
    --SET @msg = 'Declining ' + CONVERT(varchar(100), @var1)
    --print @msg
    RAISERROR(@msg,0,1) WITH NOWAIT exec spDeclineUpdate @updateID=@var1,@adminName=N'domain\user',@failIfReplica=1
    FETCH NEXT FROM DU INTO @var1 END
    CLOSE DU
    DEALLOCATE DU

    Step2
    After this finishes, Run the re-indexing query below
    https://gallery.technet.microsoft.com/scriptcenter/6f8cde49-5c52-4abd-9820-f1d270ddea61


    Step3
    Run below
    -------------------------------------------------------------
    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

    Step4
    Run the reindex script you have

    Best Regards,

    Anne


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    • Marked as answer by DylanStr Tuesday, November 29, 2016 9:22 AM
    Wednesday, November 23, 2016 3:19 AM
    Moderator
  • Hi Anne,

    I was able to run through the server cleanup wizard after the running the scripts you provided :)

    Thank you for your help. I will mark your reply as answer.

    Best regards,

    Dylan

    Tuesday, November 29, 2016 9:22 AM
  • Hi Anne,

    I forgot to ask one more thing. Is it good practice to run the cleanup wizard every now and then? And what about scripts? How do I keep my WSUS server in good shape?

    Best regards,

    Dylan

    Wednesday, November 30, 2016 8:31 AM
  • Hi DylanStr,

    Yeah, reindex WSUS database and run server cleanup wizard are recommended to do frequently. Generally, we may run them monthly.

    Best Regards,

    Anne


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Thursday, December 1, 2016 1:53 AM
    Moderator
  • Can this query be used for Primary WSUS Server too? What syntax should be used if used on Primary WSUS?
    Wednesday, September 19, 2018 4:39 PM
  • Re-indexing and the Server Cleanup Wizard (SCW) are only 2 of many things that should be done on a regular basis for maintaining WSUS. See part 8 of my 8 part blog series for more information on it.

    https://www.ajtek.ca/wsus/how-to-setup-manage-and-maintain-wsus-part-8-wsus-server-maintenance/


    Adam Marshall, MCSE: Security
    https://www.ajtek.ca
    Microsoft MVP - Windows and Devices for IT

    Saturday, September 22, 2018 4:24 AM
  • Hi Anne!

    After performing Step 1, 2 and now 3, I am getting the following errors - note I only included a handful.:

    (316 rows affected)
    Deleting 486347
    Msg 50000, Level 16, State 1, Procedure spDeleteRevision, Line 33 [Batch Start Line 0]
    @errorMessage
    Msg 50000, Level 16, State 1, Procedure spDeleteUpdate, Line 72 [Batch Start Line 0]
    spDeleteUpdate got error from spDeleteRevision
    Deleting 483071
    Msg 50000, Level 16, State 1, Procedure spDeleteRevision, Line 33 [Batch Start Line 0]
    @errorMessage
    Msg 50000, Level 16, State 1, Procedure spDeleteUpdate, Line 72 [Batch Start Line 0]
    spDeleteUpdate got error from spDeleteRevision
    Deleting 478944
    Msg 50000, Level 16, State 1, Procedure spDeleteRevision, Line 33 [Batch Start Line 0]
    @errorMessage
    Msg 50000, Level 16, State 1, Procedure spDeleteUpdate, Line 72 [Batch Start Line 0]
    spDeleteUpdate got error from spDeleteRevision

    Where do I go from here?

    Thanks!Dustin

    Tuesday, October 23, 2018 8:55 PM