18

我为 EC2 ( http://aws.amazon.com/amis/Microsoft/5147732567196848 )安装了一个全新的 AMI,并在其上安装了 Web deploy 2.1。

web deploy 2.1 服务正在运行

netstat -an

显示 8172 正在被 Web 部署代理服务监听。

但是,当我尝试使用 Project->right-click->Publish (via web deploy) 部署到该站点时,我收到以下错误消息

------ Build started: Project: Cir.Web, Configuration: Debug Any CPU ------
  Cir.Web -> C:\Projects\CrazyInsaneRobot\Source\Cir.Web\bin\Cir.Web.dll
------ Publish started: Project: Cir.Web, Configuration: Debug Any CPU ------
Transformed Web.config using Web.Debug.config into obj\Debug\TransformWebConfig\transformed\Web.config.
Auto ConnectionString Transformed Views\Web.config into obj\Debug\CSAutoParameterize\transformed\Views\Web.config.
Auto ConnectionString Transformed obj\Debug\TransformWebConfig\transformed\Web.config into obj\Debug\CSAutoParameterize\transformed\Web.config.
Copying all files to temporary location below for package/publish:
obj\Debug\Package\PackageTmp.
Start Web Deploy Publish the Application/package to https://ec2-175-41-170-198.ap-southeast-1.compute.amazonaws.com:8172/msdeploy.axd?site=Default%20Web%20Site ...
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(3847,5): Warning : Retrying the sync because a socket error (10054) occurred.  
Retrying operation 'Serialization' on object sitemanifest (sourcePath). Attempt 1 of 10.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(3847,5): Warning : Retrying the sync because a socket error (10054) occurred.  
Retrying operation 'Serialization' on object sitemanifest (sourcePath). Attempt 2 of 

...
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(3847,5): Warning : Retrying the sync because a socket error (10054) occurred.  
Retrying operation 'Serialization' on object sitemanifest (sourcePath). Attempt 10 of 10.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(3847,5): Error : Web deployment task failed.(Could not complete the request to remote agent URL 'https://ec2-175-41-170-198.ap-southeast-1.compute.amazonaws.com:8172/msdeploy.axd?site=Default Web Site'.)
This error indicates that you cannot connect to the server. Make sure the service URL is correct, firewall and network settings on this computer and on the server computer are configured properly, and the appropriate services have been started on the server.
Error details:
Could not complete the request to remote agent URL 'https://ec2-175-41-170-198.ap-southeast-1.compute.amazonaws.com:8172/msdeploy.axd?site=Default Web Site'.
The underlying connection was closed: An unexpected error occurred on a send.
Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
An existing connection was forcibly closed by the remote host
Publish failed to deploy.
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========

我在 EC2 实例上的防火墙已关闭。我的 AWS 防火墙设置是

http://dl.dropbox.com/u/7881451/ec2-firewall-settings.PNG

这是推荐的设置。

其他注释/想法:

  • Windows 错误日志中的我的 Web 部署错误日志完全为空
  • 在过去使用不同的 AMI 之前,我使用过 Web 部署并且成功地没有问题。

如果有人对如何调试有任何建议,我将不胜感激!

4

5 回答 5

35

我就这个问题直接联系了微软,他们立即给了我答案。

来自MS家伙:

看起来您的 Web 管理服务不可联系。我以前在服务证书无效时看到过这种情况。你能在你的服务器上运行附加的脚本吗?

  1. 启动提升的 PowerShell 提示符
  2. 运行 set-executionpolicy unrestricted –force
  3. 运行 .\00_Certificate.ps1
  4. 网络停止 wmsvc
  5. 网络启动 wmsvc

这能解决问题吗?


他所指的脚本可在此处获得

于 2011-06-05T12:06:21.687 回答
7

当您以错误的格式指定终点时,也会发生此错误。

For example when selecting to publish an application Visual Studio gives examples of the end point format such as https://RemoteServer:8172/MsDeploy.axd

原来它实际上想要这个没有 http 前缀,例如 0.0.0.0:8172/MsDeploy.axd

如果您在此之后收到有关证书的错误,您只需在发布屏幕中选中允许不受信任的证书框。

啊哈哈哈哈!

于 2012-03-01T05:43:28.220 回答
1

当 Web Platform Installer 安装 Web Deploy 时,我遇到了同样的问题。直接手动卸载并重新安装Web Deploy(不使用Web PI)后,它工作正常......

于 2011-06-03T01:01:18.790 回答
0

对于具有多种原因的错误消息的一些非常有用的答案。我遇到了这个错误,结果发现用于目标服务器的“IIS 网站/应用程序”名称是错误的。

因此,造成这种情况的原因可能包括:

  • 用户名或密码错误
  • 目标网站名称不正确(在 Visual Studio 中,这是在 Web 项目属性的“打包/发布 Web”选项卡上设置的)
  • 用于 Web 管理的 SSL 证书(例如,如果您的服务器在安装 IIS 后进行了系统准备)
于 2012-10-19T16:34:58.003 回答
0

当我尝试部署网站时,我得到了同样的错误。

在事件查看器(Windows 日志/系统)中,我有一个错误日志,无法创建 Web 管理服务的日志文件(“无法创建日志文件 D:\Logfiles\WMSVC\W3SVC1\u_ex131126.log。确保日志目录是正确的,并且这台计算机对该目录具有写访问权限。”。

我刚刚删除了日志文件夹的只读标志,并且一切正常。

于 2013-11-26T08:00:00.140 回答