Had another interesting one today whilst trying to deploy locally during a CI build using MSDeploy, I kept getting the error:

Exception calling "SyncTo" with "4" argument(s): "Connected to the destination computer ("localhost") using the Web Management Service, but could not authorize. Make sure that you are using the correct user name and password, that the site you are connecting to exists, and that the credentials represent a user who has permissions to access the site."

I wanted to use integrated security but the Web Management service just wasn't playing.  So I found that you just need to enable NTLM in the registry:

  • Navigate to HKEY_LOCAL_MACHINE\Software\Microsoft\WebManagement\Server
  • Create a new DWord key called "WindowsAuthenticationEnabled"
  • Set it's value to 1
  • Restart the Web Management Service


Admin posted on November 14, 2011 08:50

 

MSDeploy is really good for deploying websites and syncing up websites but it can be a real pain to configure and get going intially.  The MSDeploy documentation is a bit poor as well and quite often you'll get a very strange error which can be quite cryptic.  Here's a good example that had me stumped for a little while:

Info: Using ID '0204878c-dbb9-4ac8-8d38-1ed9f6f91e0b' for connections to the remote server. Error Code: ERROR_DESTINATION_NOT_REACHABLE More Information: Could not connect to the destination computer ("X.X.X.X"). On the destination computer, make sure that Web Deploy is installed and that the required process ("The Web Management Service") is started.
Error: The remote server returned an error: (404) Not Found.
Error count: 1.

The error message isn't actually too bad in this case, it's saying either the Web Management Service isn't running OR it can't find MSDeploy.  Ok so checklist for this problem:

- Web Management Service (WMSVC) is running on the target server
- Port 8172 is open (checked with Telnet for good measure)
- I can connect to https://servername:8172/msdeploy.axd
- MSDeploy is installed (c:\program files\IIS\MSDeploy\Microsoft Web Deploy V2\msdeploy.exe)

After running through all of this I still received the ERROR_DESTINATION_NOT_REACHABLE message.  So after a while of head scratching I looked at the msdeploy version numbers and noticed that my package was created on the build server using msdeploy version 7.1.1046.1 but on the target servers it was runing the latest version of MSDeploy which at the time of writing is 7.1.1070.1.  Something suspicious perhaps!!  

The Fix

I installed MSDeploy version 7.1.1046.1 on the target servers and bingo no more nasty error messages!  I don't know if this is just a coincidence and I will try and test by upgrading the build server version to the latest MSDepply version but for now this fixed the issue.

 

 


I came across an interesting problem today with MSDeploy whilst trying to recycle the application pool from a custom manifest.

Here's the manifest:

<?xml version="1.0" encoding="utf-8"?>

<sitemanifest>

  <RecycleApp path="SiteName" recycleMode="StopAppPool" />

  <IisApp path="c:\projects\test\app1" managedRuntimeVersion="v4.0" />

  <RecycleApp path="SiteName" recycleMode="StartAppPool" />

</sitemanifest>

and here's the error:

 

EXEC : error : Object of type 'manifest' and path 'c:\projects\app1\DeployManifests\DeployManifest.xml' cannot be created. [c:\projects\app1\Build.proj]
EXEC : error : One or more entries in the manifest 'sitemanifest' are not valid. [c:\projects\app1\Build.proj]
EXEC : error Code: ERROR_SITE_DOES_NOT_EXIST [c:\projects\app1\Build.proj]

The error is actually helpful in that it's telling us what is wrong (the site is missing) and to fix the problem you just need to make suire the site exists but for me this runs on our build server so the sites don't exist!

This is pretty useless and I haven't found a workaround for it so I've been finding that whilst MSDeploy is really good for some thing like file copying it's rather bad at other things so my adive is to use remote powershell to do anything "slightly complicated".

 

 


Posted in: IIS7 , MSDeploy  Tags:

Calendar

«  May 2012  »
MoTuWeThFrSaSu
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910
View posts in large calendar

Recent Comments

Banners

Theme Grabber
Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2012 Dan Gibbons .Net Developer