Can't get my EC2 Windows Server 2008 (Web stack) instance to receive publishings of my website
Asked Answered
C

5

18

I installed a fresh AMI for EC2 (http://aws.amazon.com/amis/Microsoft/5147732567196848) and have installed Web deploy 2.1 on it.

The web deploy 2.1 service is running for real as

netstat -an

Shows 8172 is being listened on by the Web Deployment Agent Service.

But, when I try to deploy to this site using Project->right-click->Publish (via web deploy) I receive the following error message

------ 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 ==========

My firewall on the EC2 instance has been turned off. And my AWS firewall settings are

https://static.mcmap.net/file/mcmap/ZG-Ab5ovKR-sKm-wa1Bia1gQWRft/u/7881451/ec2-firewall-settings.PNG

which are the recommended settings.

Other notes/thoughts:

  • My Web Deploy Error log in the windows error log is completely empty
  • I've used web deploy before using a different AMI in the past and succeeded without problems.

If anyone has any suggestions about how to debug this, I would be so ever grateful!

Campos answered 30/4, 2011 at 11:11 Comment(3)
try telnet (myip) 8172 Do you get a response?Albata
@hamlin11 yup. I'm able to connect w/ telnet. Please see the accepted answer for what worked for me. I wouldn't have guessed that problemCampos
My problem was I forgot to open the EC2 firewall D__D. Thanks for your question, it solved my problem!Housing
C
35

I contact Microsoft directly about this problem and they had an immediate answer for me.

From MS guy:

It looks like your Web Management Service not contactable. I have seen this before when the certificate for the service is invalid. Can you run the attached script on your server?

  1. Start a PowerShell prompt elevated
  2. Run set-executionpolicy unrestricted –force
  3. Run .\00_Certificate.ps1
  4. Net stop wmsvc
  5. Net start wmsvc

Does this fix the problem?


The script he is referring to is available here

Campos answered 5/6, 2011 at 12:6 Comment(7)
I was searching for hours after a web server rebuild. THANK YOU.Ellipsis
I've tried this on two servers now and still get the same error from Visual Studio. I think you've given me something to look in to / think about though. If I come up with something else I'll add an answer / comment.Adriell
This worked for me as well. In my case, the new destination server was a clone of a base VM image, which may have invalidated its SSL cert somehow.Brighton
Thanks! Works like a charm. I believe step 4 and 5 isn't necessary though as it's included in the script.Gerena
@Campos The script is no longer available... do you or anyone want to copy/paste the code in the answer??Mat
@PrestonM Thanks. I've updated the link. Can you please retest the link?Campos
how do you do this against an app service in azure? you can't run these commandsRutland
E
7

This error can also occur when you specify the end point in the wrong format.

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

Turns out it actually wanted this without the http prefix e.g. 0.0.0.0:8172/MsDeploy.axd

If you get an error about certificates after this you just need to check the box allow untrusted certificates in the publish screen.

Agrahahah!

Epirus answered 1/3, 2012 at 5:43 Comment(0)
G
1

I had this same problem with Web Deploy when it was installed by the Web Platform Installer. After manually uninstalling and reinstalling Web Deploy directly (NOT using Web PI) it worked fine...

Gotama answered 3/6, 2011 at 1:1 Comment(1)
This could have worked, but your answer came after I got an official response from MSCampos
K
0

Some very helpful answers for an error message with many causes. I had this error and it turned out that the "IIS Web site/application" name used for the destination server was wrong.

So, causes for this could include:

  • Bad username or password
  • Incorrect web site name for destination (In Visual Studio, this is set on the Package/Publish Web tab of a web project's properties)
  • SSL cert for web management (for example if your server was sysprepped after IIS was installed)
Kussell answered 19/10, 2012 at 16:34 Comment(0)
S
0

I get the same error when i tried to deploy a website.

In the EventViewer (Windows Logs/System) i had an error log, that the log file of the Web Management Service could not be created ("Unable to create log file D:\Logfiles\WMSVC\W3SVC1\u_ex131126.log. Make sure that the logging directory is correct and this computer has write access to that directory.".

I just removed the readonly flag of the log folder and all worked fine again.

Selfassured answered 26/11, 2013 at 8:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.