This error is mostly raised when a Windows client hasn’t been updated for a long time or when the software distribution store is cleaned and need to build up again. The default round trip value is capped to a maximum of 200KB per client each request, while the metadata XML file can grow to a larger file.
Contents
There are 2 possible solutions for this problem.
- The good old reboot. Just reboot, retry a couple of times and everything magically starting to work.
- Remove the maximum XML file size limit. This is one is more difficult, but way more efficient because you don’t have to troubleshoot each failing client. Will discuss this one below.
How to run queries against the WSUS Database?
The first thing, you need to know which database type is running for your WSUS instance. It can be the (default) Windows WID Database or SQL (express). To find out which database, navigate to the following registry key or run this PowerShell script on your WSUS server:
1 |
(Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Update Services\Server\Setup" -name "SqlServerName").sqlservername |
The manual method, navigate to: HKLM:\SOFTWARE\Microsoft\Update Services\Server\Setup
Query the WSUS WID Database
PowerShell Script Example to change the MaxXMLPerRequest value.
1 2 3 4 5 6 7 |
$ConnectionString = 'server=\\.\pipe\MICROSOFT##WID\tsql\query;database=SUSDB;trusted_connection=true;' $SQLConnection= New-Object System.Data.SQLClient.SQLConnection($ConnectionString) $SQLConnection.Open() $SQLCommand = $SQLConnection.CreateCommand() $SQLCommand.CommandText = 'UPDATE tbConfigurationC SET MaxXMLPerRequest = 0' $SqlDataReader = $SQLCommand.ExecuteReader() $SQLConnection.Close() |
Query the WSUS SQL Express Database
PowerShell Script Example to change the MaxXMLPerRequest value.
1 2 3 |
$DBType = 'localhost\sqlexpress' Invoke-Sqlcmd -Query "UPDATE tbConfigurationC SET MaxXMLPerRequest = 0" -ServerInstance $DBType -Database "SUSDB" $SQLDataResult = Invoke-Sqlcmd -Query "SELECT MaxXMLPerRequest FROM tbConfigurationC" -ServerInstance $DBType -Database "SUSDB" |
The final script
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
$DBType = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Update Services\Server\Setup" -name "SqlServerName").sqlservername If($DBType -match "WID"){ $ConnectionString = 'server=\\.\pipe\MICROSOFT##WID\tsql\query;database=SUSDB;trusted_connection=true;' $SQLConnection= New-Object System.Data.SQLClient.SQLConnection($ConnectionString) $SQLConnection.Open() $SQLCommand = $SQLConnection.CreateCommand() $SQLCommand.CommandText = 'UPDATE tbConfigurationC SET MaxXMLPerRequest = 0' $SqlDataReader = $SQLCommand.ExecuteReader() $SQLConnection.Close() $SQLConnection.Open() $SQLCommand = $SQLConnection.CreateCommand() $SQLCommand.CommandText = 'SELECT MaxXMLPerRequest FROM tbConfigurationC' $SqlDataReader2 = $SQLCommand.ExecuteReader() $SQLDataResult = New-Object System.Data.DataTable $SQLDataResult.Load($SqlDataReader2) $SQLConnection.Close() IF($SQLDataResult.maxxmlperrequest -eq 0){ Write-host "Succesfully changed the XML Maximum value" } Else { write-host "Something went wrong.. cannot change the DB Value" } } ElseIf($DBType -match "SQL"){ Invoke-Sqlcmd -Query "UPDATE tbConfigurationC SET MaxXMLPerRequest = 0" -ServerInstance $DBType -Database "SUSDB" $SQLDataResult = Invoke-Sqlcmd -Query "SELECT MaxXMLPerRequest FROM tbConfigurationC" -ServerInstance $DBType -Database "SUSDB" IF($SQLDataResult.maxxmlperrequest -eq 0){ Write-host "Succesfully changed the XML Maximum value" } Else { write-host "Something went wrong.. cannot change the DB Value" } } |