WSUS Hangs on "Unused updates and update revisions" RRS feed

  • Question

  • In our environment we have not cleaned up WSUS updates in a while, probably about a year. I have been tasked with cleaning it up and optimizing it. When I attempt to run the WSUS Server Cleanup Wizard, it hangs on "Unused updates and update revisions" and doesn't do anything. The wizard then disappears and I am taken back to the WSUS Console where I see the following:

    Error: Database Error

    When I click copy error to clipboard, this is what is copied:

    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 -- Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
    .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)

    In my research, I have found several solutions, and have tried a few of my own. Below I will list the ones I have tried: 

    1. Run each item individually. IE, run superseded updates, then run expired updates after that finishes, then run unneeded update files after that finishes, etc. This did not work

    2. Stop the WSUS IIS service and run "wsusutil.exe removeunneededupdates" this also did not work

    The solutions I have found, but am hesitant to try (due to the fact that we are in a live production environment) are the following:

    1. Re-Index the WSUS Database according to the following link: 


    2. Deleting the files in the WSUS folder and running "wsusutil.exe reset" from the following link: 


    I would like to know what, if any, impact either of these solutions will have on our environment, and which one would be the preferred method. I feel like I should use the first one, and if I still don't have any luck then try the second. My only concern with the second method is that it might break something (not sure what, except updates). 

    A little about our environment - 8,000 computers, WSUS and SCCM are on the same Server 2008 R2 server, we only have the one WSUS and SCCM server, so nothing downstream as far as WSUS is concerned. 

    Thanks everyone!

    Tuesday, April 7, 2015 8:00 PM

All replies

  • Hi Scionic,

    Re-Indexing the DB might help a bit, it can have a degrading effect on performance on the DB while it's being run, but shouldn't cause any huge issues. IMHO "resetting" the WSUS is a bit overkill. 

    You may need to re-run the cleanup wizard several times, the most important thing is that each time it runs it makes progress. Out of curiosity, how many updates are on that server?

    See the below set of articles, these go through multiple steps you can take.


    If you find the answer of assistance please "Vote as Helpful"and/or "Mark as Answer" where applicable. This helps others to find solutions for there issues, and recognises contributions made to the community :)

    Wednesday, April 8, 2015 6:47 AM
  • Michael, 

    Thanks for the input. So just to be clear, Re-Indexing can be done while everything is running? That would be great.

    It doesn't appear that any progress is being made when it times out, it happens very quickly, within 5 minutes.

     We currently have 13311 updates in WSUS, so I think that's part of the problem. I will go through the multiple steps and see how that goes, and report back.

    Thank you!

    Wednesday, April 8, 2015 2:06 PM
  • Well, no such luck. There is still no progress being made no matter how many times I run server cleanup wizard. I did not try the disk defrag yet. I did not try declining or approving updates yet, since that seems to be a very daunting task, and I am not sure that would help overly much (of course I could be wrong). 

    The re-indexing did take about a half an hour to run, and says that it completed successfully, but still no result when running the Server Cleanup Wizard. Am I missing something here?

    On a side note, I did notice an update from windows XP in the mix, so this task hasn't been performed since sometime last year.

    Wednesday, April 8, 2015 6:37 PM
  • Re-indexing is a database operation, essentially it's re-organising the data making it faster for the database to find relevant information. It's unlikely  it would have resolved the issue, but would be a best practice that would be run on a regular basis. 

    But working through the approvals/declines is a much bigger factor in this. 13k+ is a HUGE number of updates to have on a server, do you have multiple different languages selected? As a starting point I would go through the languages and poducts that have been selected, remove any you don't need, and then begin declining any updates that you know for sure aren't required. 

    You will probably experience timeouts through this, but once the number of updates on the server comes down you should get back to a stable state. 

    If you find the answer of assistance please "Vote as Helpful"and/or "Mark as Answer" where applicable. This helps others to find solutions for there issues, and recognises contributions made to the community :)

    Thursday, April 9, 2015 8:14 AM

    I have started going through and declining updates, and then going through SCCM and removing any expired updates from the SCCM side as well. I am now down to 3822 unapproved updates in WSUS, with a total of 13304 updates.

    At this point I am STILL UNABLE to run the cleanup wizard to clean up any of these. It still hangs when it runs, and only on Unused Updates and update revisions. I have even tried running powershell scripts and command line utilities to clean WSUS up, and still just hangs. I am pretty much at a loss, so any other advice would be appreciated.

    One more question, should it resort to this: What impact does resetting WSUS have on a live environment, with 7000 plus computers? Should I have to resort to it, is this something that is going to cause any major issues? 

    We do plan on preventing this in the future by running the database defrag once a month, and running the WSUS Server Cleanup Wizard once per quarter, but getting there sure is proving to be quite the challenge.

    Thanks again!

    Monday, April 13, 2015 1:31 PM