WSUS 同步失败,SoapException

本文可帮助你修复以下问题: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 消息、WebResponse response、Stream responseStream、Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke (String methodName、Object[] 参数)
at Microsoft.UpdateServices.ServerSyncWebServices.ServerSync.ServerSyncProxy.GetUpdateData (Cookie 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 日志文件中记录了类似于以下内容的错误消息, (%ProgramFiles%\Update Services\LogFiles\SoftwareDistribution.log WSUS 服务器上的) :

<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=  
   at Microsoft.UpdateServices.Internal.SoapUtilities.LogException(SoapException e)
   at 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 executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext 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=  
   at 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 executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at 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?