locked
WSUS on Windows Server 2016: unable to cleanup RRS feed

  • Question

  • I did a fresh install of both Windows Server 2016 and WSUS no longer than 5 months ago, in an existing domain.

    Now I'm unable to launch WSUS Cleanup Wizard: it fails with "Error: Database Error"

    This is the output of "Copy error to clipboard":

            

    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 -- @errorMessage
    spDeleteUpdate got error from spDeleteRevision

    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)

    How can I solve it ?

    Wednesday, August 9, 2017 11:52 AM

All replies

  • Hi Adam, and thank you for the great script. I will use it with other WSUSes too in the future :)
    Please note that making it useable was a bit painful: not only character conversion was needed, but the published files had problem at lines 457 and 459 because " (ascii code 34dec) have been converted into unicode left/right quotation mark. After saving in ANSI and fixing quotation marks, I executed the script in my server, but after some time (1 hour?), it hanged with the same error from spDelete Revision:

    Yesterday a colleague told me that this server (windows is installed inside a vmware ESXi) had a couple of power loss in the past two months, so I think the database is in some way corrupted.

    I'm almost ready to uninstall wsus, delete the database and reinstall it: the configuration is quite simple and the number of PC connected is low (less than 40). So it will not be a big problem to reinstall WSUS.

    But if you are interested in improving your script on my specific problem, just let me know and I will send you my email address.

    Thursday, August 10, 2017 2:50 PM
  • Yes please - contact me through my website and reference this thread.

    I don't know how to deal with the ANSI issues. I copy/paste my script into Spicework's code block and hit submit.

    I've reviewed both my code, and the Spiceworks website, and my code had the proper double quotes, but Spiceworks had the curly quotes. I've fixed Spiceworks website, and just for the sake, I re-typed my source code's double quotes for future. Thanks for the investigation and line fixes.

    As for the issue, It's up to you what you want to do and how long you want to try troubleshooting. My script may clean the issue up after a few days on ScheduledRun, or it may not.

    Try running -FirstRun a bunch of times (10-15 times) see if it clears it.

    Also check out https://social.technet.microsoft.com/Forums/windowsserver/en-US/bf97da17-3e46-4fff-8482-0e64731015ef/wsus-cleanup-error-spdeleterevision-cannot-delete-revisionid-xxxxxx-because-it-is-still-deployed?forum=winserverwsus

    If you get it fixed by way of some SQL Queries, please share them so I can improve my script.


    Adam Marshall, MCSE: Security
    http://www.adamj.org

    Thursday, August 10, 2017 4:01 PM
  • Also look at me helping someone else with this issue. I never got a result, but... it may help.

    https://community.spiceworks.com/topic/1975607-adamj-clean-wsus-update-error


    Adam Marshall, MCSE: Security
    http://www.adamj.org

    • Proposed as answer by Elton_Ji Friday, September 15, 2017 8:44 AM
    Thursday, August 10, 2017 4:02 PM