Web管理服务随机失败

时间:2013-07-17 12:23:02

标签: .net iis iis-7.5 windows-server-2008 msdeploy

所以我们有一个类似于这个

的自定义部署脚本
    msdeploy.exe ^
      -source:manifest='path_to_manifest' ^
      -dest:auto,ComputerName="https://host:port/msdeploy.axd?site=sitename",UserName='domain\user',Password='muhpass',IncludeAcls='False',AuthType='Basic' ^
      -verb:sync ^
      -enableRule:DoNotDeleteRule ^
      -disableLink:AppPoolExtension ^
      -disableLink:ContentExtension ^
      -disableLink:CertificateExtension ^
      -setParamFile:"path_to_the_file" ^
      -allowUntrusted ^
      -useChecksum ^
      -retryAttempts=2 ^
      -preSync:runCommand="path_to_script",waitInterval=60000 ^
      -postSync:runCommand="path_to_script",waitInterval=60000

我删除了一些值,但您可能认为它们是正确的,因为脚本成功部署了应用程序,而不是每次都这样。这是失败的步骤:

    Performing '-preSync'...
    Info: Using ID '7bb88177-4329-4b66-a7b9-a563811edca3' for connections to the remote server.
    Error: (7/17/2013 2:27:00 PM) An error occurred when the request was processed on the remote computer.
    Error: An error occurred while communicating with the remote host. The error code is 0x80070006.
    Error: The handle is invalid. (Exception from HRESULT: 0x80070006 (E_HANDLE))
    Error count: 1.
    Error during '-preSync'.

它通常会在几秒钟内完成,但每隔一段时间就需要很长时间,最终我得到上面的错误。此时,我必须在生产服务器上重新启动Web管理服务,这通常会将其修复到下一次部署。但是,重新启动服务也会失败,但在此之后,您至少可以手动启动服务,就是这样。

如果我转到生产服务器上的事件查看器,它在Microsoft Web Deploy下会出现以下错误(错误的时间以及请求匹配的ID):

    User: 
    Client IP: muh_ip
    Content-Type: application/msdeploy
    Version: 9.0.0.0
    MSDeploy.VersionMin: 7.1.600.0
    MSDeploy.VersionMax: 9.0.1631.0
    MSDeploy.Method: Sync
    MSDeploy.RequestId: 7bb88177-4329-4b66-a7b9-a563811edca3
    MSDeploy.RequestCulture: en-US
    MSDeploy.RequestUICulture: en-US
    ServerVersion: 9.0.1631.0
    Skip: objectName="^configProtectedData$"
    Provider: auto, Path: 
    A tracing deployment agent exception occurred that was propagated to the client. Request ID '7bb88177-4329-4b66-a7b9-a563811edca3'. Request Timestamp: '7/17/2013 11:27:00 AM'. Error Details:
    System.Web.HttpException: An error occurred while communicating with the remote host. The error code is 0x80070006. ---> System.Runtime.InteropServices.COMException (0x80070006): The handle is invalid. (Exception from HRESULT: 0x80070006 (E_HANDLE))
       --- End of inner exception stack trace ---
       at System.Web.Hosting.IIS7WorkerRequest.RaiseCommunicationError(Int32 result, Boolean throwOnDisconnect)
       at System.Web.Hosting.IIS7WorkerRequest.ExplicitFlush()
       at System.Web.HttpResponse.Flush(Boolean finalFlush)
       at System.IO.BufferedStream.FlushWrite()
       at System.IO.BufferedStream.Flush()
       at System.IO.BufferedStream.Dispose(Boolean disposing)
       at System.IO.Stream.Close()
       at System.IO.StreamWriter.Dispose(Boolean disposing)
       at System.IO.StreamWriter.Close()
       at System.Xml.XmlTextWriter.Close()
       at Microsoft.Web.Deployment.TraceEventStreamSerializer.Dispose(Stream stream)
       at Microsoft.Web.Deployment.DeploymentAgent.HandleSync(DeploymentAgentAsyncData asyncData, Nullable`1 passId)
       at Microsoft.Web.Deployment.DeploymentAgent.HandleRequestWorker(DeploymentAgentAsyncData asyncData)
       at Microsoft.Web.Deployment.DeploymentAgent.HandleRequest(DeploymentAgentAsyncData asyncData)

对我而言,这项服务看起来确实存在问题,但我没有想法,所以我会感谢任何可能有助于解决此问题或至少收集更多信息的建议。这件事让我疯了。它最近变得越来越频繁 - 过去每周发生的次数不到一次,现在每次部署都会发生。 我意识到这篇文章的篇幅很长,但我希望包含所有相关信息。

服务器是带有IIS 7.5的Windows Server 2008 R2企业版v6.1 sp1。

tl; dr 部署脚本随机失败,重新启动Web管理服务会暂时修复它,但是呢?

0 个答案:

没有答案