使用 SoapException 时 WSUS 同步失败

本文可帮助你修复 Windows Server Update Services (WSUS) 由于停用终结点而失败的问题。

原始产品版本:   WSUS - 所有版本、Windows Server 2016、Windows Server 2012 R2、Windows Server 2012
原始 KB 编号:   4482416

症状

WSUS 同步失败,您将收到以下错误消息:

SoapException:发生故障
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse (SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke (String methodName, Object[] parameters)
at Microsoft.UpdateServices.ServerSyncWebServices.ServerSync.ServerSyncProxy.GetUpdateData (Cookie, UpdateIdentity[] updateIds)
at Microsoft.UpdateServices.ServerSync.CatalogSyncAgentCore.WebserviceGetUpdateData (UpdateIdentity[] updateIds, List ` 1 allMetadata, List ` 1 allFileUrls, Boolean isForConfig)
at Microsoft.UpdateServices.ServerSync.CatalogSyncAgentCore.GetUpdateDataInChunksAndImport (List ` 1 neededUpdates, List ` 1 allMetadata, List ` 1 allFileUrls, Boolean isConfigData)
at Microsoft.UpdateServices.ServerSync.Cat

此外,WSUS 服务器上 WSUS 日志文件 () %ProgramFiles%\Update Services\LogFiles\SoftwareDistribution.log 如下所示的错误消息:

<Date><Time>错误 WsusService.25 SoapUtilities.LogException USS ThrowException: Actor = https://fe2.update.microsoft.com/v6 /ServerSyncWebService/ServerSyncWebService.asmx, Method = " http://www.microsoft.com/SoftwareDistribution/GetUpdateData ", ID= <ID> , ErrorCode=InternalServerError, Message=
位于 Microsoft.UpdateServices.Internal.SoapUtilities.LogException (SoapException e)
位于 Microsoft.UpdateServices.Internal.WebServiceCommunicationHelper。 ProcessWebServiceProxyException (SoapHttpClientProtocol& webServiceObject, Exception exceptionInfo)
at Microsoft.UpdateServices.ServerSync.CatalogSyncAgentCore.WebserviceGetUpdateData (UpdateIdentity[] updateIds, List ` 1 allMetadata, List ` 1 allFileUrls, List ` 1& updatesWithSecureFileData, Boolean isForConfig)
at Microsoft.UpdateServices.ServerSync.CatalogSyncAgentCore.GetUpdateDataInChunksAndImport (List ` 1 neededUpdates, List ` 1 allMetadata, List ` 1 allFileUrls, Boolean isConfigData)
at Microsoft.UpdateServices.ServerSync.CatalogSyncAgentCore.GetAndSaveUpdateMetadata (List ` 1 updates)
at Microsoft.UpdateServices.ServerSync.CatalogSyncAgentCore.ExecuteSyncProtocol (Boolean allowRedirect)
at Microsoft.UpdateServices.ServerSync.CatalogSyncAgentCore.CatalogSyncThreadProcess ()
at System.Threading.ExecutionContext.RunInternal (ExecutionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run (ExecutionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run (ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart () <Date> <Time> Error WsusService.25 SoapUtilities.LogException USS ThrowException: Actor = https://fe2.update.microsoft.com/v6 /ServerSyncWebService/ServerSyncWebService.asmx, Method = " http://www.microsoft.com/SoftwareDistribution/GetUpdateData ", ID= <ID> , ErrorCode=InternalServerError, Message=
位于 Microsoft.UpdateServices.Internal.SoapUtilities.LogException (SoapException e)
at Microsoft.UpdateServices.ServerSync.CatalogSyncAgentCore.ExecuteSyncProtocol (Boolean allowRedirect)
at Microsoft.UpdateServices.ServerSync.CatalogSyncAgentCore.CatalogSyncThreadProcess ()
at System.Threading.ExecutionContext.RunInternal (ExecutionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run (ExecutionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run (ExecutionContext executionContext, ContextCallback callback, Object state)
位于 System.Threading.ThreadHelper.ThreadStart ()

原因

如果将 WSUS 服务器配置为使用旧的同步终结点,则会出现此问题 https://fe2.update.microsoft.com/v6 。 此终结点已完全停用,在 2019 年 7 月 8 日之后不再可用。

解决方案

若要解决此问题,将 WSUS 配置中的同步终结点更改为 https://sws.update.microsoft.com

为此,请按照直接连接到 Microsoft 更新的最顶层 WSUS 服务器(如 WSUS 层次结构中的根 WSUS 服务器)上的以下步骤操作:

  1. 关闭所有 WSUS 控制台。

  2. 在提升的 PowerShell 命令提示符下,运行以下 PowerShell 脚本。

    备注

    不要在非最顶层服务器的 WSUS 服务器上运行脚本。 如果服务器未连接到 Internet,同步可能会失败。

    对于 WSUS 版本 3.x:

    [void][reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration")
    $server = [Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer()
    $config = $server.GetConfiguration()
    # Check current settings before you change them
    $config.MUUrl
    $config.RedirectorChangeNumber
    # Update the settings if MUUrl is https://fe2.update.microsoft.com/v6
    $config.MUUrl = "https://sws.update.microsoft.com"
    $config.RedirectorChangeNumber = 4002
    $config.Save();
    iisreset
    Restart-Service *Wsus* -v
    

    运行 Windows Server 2008 的 WSUS (没有最新更新) 或早期版本可能正在使用 https://update.microsoft.com/v6https://www.update.microsoft.com 同步终结点。 由于这些版本的 Windows 不支持 SHA256 证书身份验证,因此请使用 PowerShell 脚本中的以下设置:

    $config.MUUrl = " https://sws1.update.microsoft.com"
    $config.RedirectorChangeNumber = 3011
    

    对于适用于 Windows Server 2012 及更高版本的 WSUS:

    $server = Get-WsusServer
    $config = $server.GetConfiguration()
    # Check current settings before you change them 
    $config.MUUrl
    $config.RedirectorChangeNumber
    # Update the settings if MUUrl is https://fe2.update.microsoft.com/v6
    $config.MUUrl = "https://sws.update.microsoft.com"
    $config.RedirectorChangeNumber = 4002
    $config.Save()
    iisreset
    Restart-Service *Wsus* -v
    
  3. 验证 WSUS 同步是否成功。

更多信息

若要详细了解如何运行 PowerShell 脚本,请参阅什么是 PowerShell?。