Getting a 404 from WMSvc via MSDeploy.exe
Asked Answered
B

13

135

From Windows 8 to Windows Server 2012 (IIS 8) with Web Management Services installed and working, I can use IIS Manager on W8 box to manage the remote server but I get a 404.7 from WMSvc when I execute the following command:

msdeploy.exe" -verb:dump -source:contentPath=c:\InetPub\wwwroot,computerName=https://uktnws01:8172/MsDeploy.axd,userName=corp\administrator,password=WMSvcIsCrap,authType=Basic -allowUntrusted

I've tried all sorts of combinations and parameters. I can telnet to that port, I know its open.

I'm just removing the Management Service feature from Windows and restarting. I will pour myself a scotch and make some snacks. In the meantime, if you have any ideas, please share.

Join my live blog below and follow the action.

Update 1

With Management Service removed, I now get

Error: Unable to connect to the remote server Error: No connection could be made because the target machine actively refused it 192.168.2.22:8172 Error count: 1.

Where the 2nd line is a new message! Woohoo.

Update 2

Okay, so things are going from bad to worse now. Since reinstalling, the remote IIS console will alert on the certificate and then say,

The server is not accepting remote connections.

But I think this is because I probably didn't re-enable Remote Management, on top of installing the damned thing.

Update 3

With Remote Management enabled, the remote IIS works again but the 404 has returned. Just in the interests of SEO, here's the full error:

Error Code: ERROR_DESTINATION_NOT_REACHABLE More Information: Could not connect to the remote computer ("uktnws01"). On the remote computer, make sure that Web Deploy is installed and that the required process ("Web Management Service") is started.  Learn more at http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_DESTINATION_NOT_REACHABLE.
Error: The remote server returned an error: (404) Not Found.
Error count: 1.

Update 4

Tried the same command against another web server over a VPN to a client and that works a charm! Looks like IIS is fubar'ed on my absolutely spanking new 2012 build.

Update 5

I enabled failed request tracing for WMSvc and have seen that the 404.7 comes from the RequestFilteringModule module. 404.7 is 'File Extension Denied' according to the documentation.

http://www.iis.net/configreference/system.webserver/security/requestfiltering

Adding an explicit server rule for .axd files does not help though. Interesting to see this module though since it imposes restrictions on URL length and content sizes. Can you imagine troubleshooting this in an IIS hosted WCF app! Haha. I'm crying really.

Update 6

I'm removing Request Filtering which means removing ASP.NET and various other things also. They need a Reinstall Windows Features & Dependencies All In One Hit Because We Write Unreliable Software option.

Update 7

I reinstall everything and then some Aussie named Richard appears out of nowhere and totally explains that Web Deploy isn't actually a part of WMSvc as standard, even on IIS 8, and that I need to install Web Deploy.

So I do. Then I disable MsDepSvc which is the other part it installs (which I thought was the entirety of Web Deploy) because it sucks on port 80 and stops load balancers from seeing a downed IIS service.

And it works. I can go to bed.

Brindabrindell answered 13/12, 2012 at 23:46 Comment(6)
+1 for the hilarious passwordFarming
How much productivity are we all losing to this mess? I am running into a similar issue but I'm running into a case where IIS crashes when looking up usernames.Waiwaif
On Windows 2012, it was install order for me, I had to first install the Web Management Service feature, then install web deploy 3.5.Bend
Installing web deploy is not enough!. I had web deploy installed, it was the first thing I did. I had to go to add/remove programs and change installation settings to include the handler. I wish love, happiness and prosperity to the MS dev who thought it was a sensible default to not include the handler which lets the service do it's job.Chirrup
I had all sorts of problems trying the to get Web Deploy 3.6 working, so followed Sinned Lolwut's comment and uninstalled 3.6, and installed 3.5 instead - worked first pop. I used Web Platform Installer (microsoft.com/web/downloads/platform.aspx) to install Web Deploy 3.5. Restarted Web Management Service afterwards, and was able to validate the connection in the Visual Studio Web Deploy profile. (I would have replied in a comment above but don't have enough reputation yet).Milden
I can confirm what worked for me: - Web Management Service must be installed & set up before Web Deploy -Make sure Web Management Service allows Remote Connections & valid certificate bound -Then install/reinstall web deploy. I used the latest Web Deploy 3.6 (x64)Clannish
L
93

Have you installed Web Deploy on the server? Web Deploy registers a handler (/msdeploy.axd) with WMSVC, so a 404 would be the expected status code if it weren't installed.

Legislative answered 14/12, 2012 at 0:41 Comment(9)
No I haven't. I didn't know I needed to! I thought that the whole deployment thing was part of WMSvc? OMG, I reckon you're right, they are that stupid. I have recently been so confused with all this and thought Web Deploy the thing you install was just the agent, for hosting companies and the like. Check out my other question #13603002Brindabrindell
WMSVC is for remotely configuring IIS. MSDeploy was created long afterwards so can't be integrated into the core. If installing MSDeploy is not a possibility, you can use a temp agent which will install a handler for the duration of the deploy (you'll need admin access, obviously).Legislative
More on temp agents here: technet.microsoft.com/en-us/library/ee517345(v=ws.10).aspx - But I assume Web Deploy must installed on the 'master' server in a synch operation for it to get the binaries from. They could just have all this already registered in WMSvc out the box. Thanks Richard, awesome.Brindabrindell
I had to uninstall Web Deploy 3 and then reinstall it again to get it working. Somehow my IIS8 was messed up.Pitchstone
Same issue, just went into Control Panel and changed the "Web Deploy" install to include the Handler. Restarted The WMSVC Service and all was good!Flower
If you installed Web Deploy before you installed the Web Management Service you will need to follow the procedures described aboveSowell
Yes, apparently the "Typical" install recommended by the msi does not have this - another facepalm moment brought to you by microsoftNereus
When I installed web deploy, I forgot to install Management Service along with it. I installed it later and set it to start automatically, but still was getting the 404 error. I uninstalled web deploy and reinstalled and it started working. I guess management service needs to be installed before web deploy. Also make sure that your installed ASP.Net version on IIS is same as that of your application before installing web deploy.Findley
@RohitJain That's correct, the /msdeploy.axd handler won't install if Management Service isn't already installed. You did the right thing by uninstall/reinstalling (though you might also have been able to do a repair)Legislative
P
203

In case someone else is having the same issues than what I am having, I also got the same 404 error. The quickest way I found to check was to go on the server itself, and open up "https://<servername>:8172/MsDeploy.axd". Chrome & Firefox just showed a blank page, so I had to use the Network tab of the developer tools (F12) to see the actual 404 error message.

Somehow, while installing Web Deploy 3.0 from the Web Platform Installer, the IIS 7 Deployment Handler didn't get installed, even though the IIS Manager UI Module did. In my case, I downloaded the Web Deployment Tool Installation .msi from the following link: Web Deployment Tool Installation. Then I had to go back to IIS Admin Tool (Start -> Run -> inetmgr.exe) > {server name} > click on Management Service icon, and restart the management service before the MsDeploy.axd handler started working.

Enabling IIS Deployment Handler + Remote Agent Service

enter image description here

Prestige answered 22/2, 2013 at 14:21 Comment(9)
I was able to go to Control Panel > Programs and Features. Right-click "Microsoft Web Deploy 3.5" and select "Change". From the installer select "Change" and "IIS Deployment Handler" was available as an option (was disabled at first. Also "Configure for Non-Administrator Deployments" and "Management Service Delegation UI" were additional options.) My very first request to MSDeploy.axd still had the 404 but the next request received a login prompt.Westbrook
And if you're forgetful like me, remember that you must have already installed the Management Service (Add/Remove Windows Features > Web Server (IIS) > Management Tools > Management Service) before the "IIS Deployment Handler" is visible while changing the Web Deploy 3.5 install.Westbrook
@DGDev Web Deployment Tool 2.1 is the precedecessor of Web Deploy 3.0Adequacy
Hey Carl G, your comment was the only useful thing I found for this problem. I wish it could be a part of answer instead of a simple comment here. (Admin please put it as a right answer if possible)Doby
@CarlG - great catch! I added a screen capture for reference.Canfield
Thank you, thats exactly what I was missing. I was visiting the URL and it spend minutes loading the page to say no data received.Potash
been struggling about this since I believed I had done everything right. Thanks so much.Bartholomeo
I had to install from the website to see these options for my Windows Server 2012 box : The URL is here iis.net/downloads/microsoft/web-deploy Just choose change and you can then follow the instructions in this answer. ( I could not see it from Control Panel on Server 2012)Pleasant
For the love of god . . . Microsoft, stop doing stuff like this!Deanedeaner
L
93

Have you installed Web Deploy on the server? Web Deploy registers a handler (/msdeploy.axd) with WMSVC, so a 404 would be the expected status code if it weren't installed.

Legislative answered 14/12, 2012 at 0:41 Comment(9)
No I haven't. I didn't know I needed to! I thought that the whole deployment thing was part of WMSvc? OMG, I reckon you're right, they are that stupid. I have recently been so confused with all this and thought Web Deploy the thing you install was just the agent, for hosting companies and the like. Check out my other question #13603002Brindabrindell
WMSVC is for remotely configuring IIS. MSDeploy was created long afterwards so can't be integrated into the core. If installing MSDeploy is not a possibility, you can use a temp agent which will install a handler for the duration of the deploy (you'll need admin access, obviously).Legislative
More on temp agents here: technet.microsoft.com/en-us/library/ee517345(v=ws.10).aspx - But I assume Web Deploy must installed on the 'master' server in a synch operation for it to get the binaries from. They could just have all this already registered in WMSvc out the box. Thanks Richard, awesome.Brindabrindell
I had to uninstall Web Deploy 3 and then reinstall it again to get it working. Somehow my IIS8 was messed up.Pitchstone
Same issue, just went into Control Panel and changed the "Web Deploy" install to include the Handler. Restarted The WMSVC Service and all was good!Flower
If you installed Web Deploy before you installed the Web Management Service you will need to follow the procedures described aboveSowell
Yes, apparently the "Typical" install recommended by the msi does not have this - another facepalm moment brought to you by microsoftNereus
When I installed web deploy, I forgot to install Management Service along with it. I installed it later and set it to start automatically, but still was getting the 404 error. I uninstalled web deploy and reinstalled and it started working. I guess management service needs to be installed before web deploy. Also make sure that your installed ASP.Net version on IIS is same as that of your application before installing web deploy.Findley
@RohitJain That's correct, the /msdeploy.axd handler won't install if Management Service isn't already installed. You did the right thing by uninstall/reinstalling (though you might also have been able to do a repair)Legislative
G
69

On Windows 2012 R2 Server I followed mga911's advice.

I was stuck getting deploys working. Had installed Web Deploy 3.5 -> Enabled Management Service Delegation -> Ensured Services were started. The problem was the IIS Deployment handler had not been installed. Going through Web PI 4.6 I was not given the opportunity to install the IIS deployment handler. You need to go into the control panel -> Programs and Features Change Web Deploy 3.5's installation. Please note my instructions. In the change process it indicates all the sub packages will be installed but the text message says 0 of 3 sub components will be installed. One of those components is the IIS handler. Read carefully because I didn't and was frustrated :)

  • Control Panel > Programs and Features
  • Right Click on Microsoft Web Deploy 3.5
    • Select Change > click next > click change
    • You'll notice when Web Deployment Framework is selected you'll see in the message "It has 0 of 3 subfeatures selected"
    • Click on drop down select "Entire feature will be installed on local hard drive"
    • Next > Change >Finish
Gibbons answered 24/11, 2013 at 0:4 Comment(2)
Tried this trick with Web Deploy 3.6 on Win 2012 R2. Didn't work with the following error "Error: "The configuration section 'system.webServer/management/delegation' cannot be read because it is missing schema"... Uninstalled Web Deploy 3.6 and got Web Deploy 3.5 off of iis.net/downloads/microsoft/web-deploy Worked.Pejoration
This very help me! Thank's. Win2012 r iis 8Gunwale
D
19

One important point I think is that you have to turn on the Management service first and then install Web Deploy.

I did it the other way around and it didn't work.

Only by reinstalling Web deploy did it start working.

Die answered 21/6, 2013 at 14:53 Comment(2)
Same thing happened to me. What a nightmare!Brendonbrenk
I guess most of the people here (including myself) had the same issue but they didn't realize it because uninstalling web deploy, reinstalling it again and then restarting the Management Service is pretty much the same thing :)Equitable
M
14

After hours of searching, doing your solution below worked for me !!

Control Panel > Programs and Features

Right Click on Microsoft Web Deploy 3.5

Select Change > click next > click change

You'll notice when Web Deployment Framework is selected you'll see in the message

 "It has 0 of 3 subfeatures selected"

Click on drop down select "Entire feature will be installed on local hard drive"

Next > Change >Finish

Maurya answered 18/7, 2014 at 8:51 Comment(0)
E
13

When I installed Web Deploy via the web platform installer the Handler was not selected. I had to manually install Web Deploy 3.0, click"change" and then select the Handler to be installed.

Egocentrism answered 5/6, 2013 at 19:41 Comment(0)
B
8

In my case, when installing the web deploy 3.0 package through the web pi i never got the Management Service Delegation option in IIS /home .. reinstalling it rectified the issue however, thus resolving Resolved my 404.7 error.

This was under Microsoft Server 2012 and IIS8

Edit: I just recently tried the very same thing on Windows 8 and would like to point out that the microsoft website states:

You cannot set up remote publishing using Web Deploy for a site that is hosted in IIS on Windows 8.0 or 8.1. The reason is that the client SKUs for Windows do not come with the Web Management Service that is required for remote connections. As a result, on Windows 8.0 or 8.1, the IIS Manager Permissions icon and the Configure Web Deploy Publishing deployment option that are required to configure remote publishing are not available in the IIS Manager. http://www.iis.net/learn/install/installing-publishing-technologies/installing-and-configuring-web-deploy-on-iis-80-or-later#00

(Yes i realize the target is Server 2012 in the question but this could save a lot of people from having the same headache as me, since this worked just fine on my old dev machine i wanted to let people know.)

Bottomless answered 27/8, 2013 at 12:50 Comment(0)
E
4

Rather than using Web Platform Installer. Download the WebDeploy.exe from the website and install it on server with Complete package option.

It will fix the issue.

Evyn answered 30/6, 2016 at 11:53 Comment(0)
S
1

Additionally you might need to grant access for the Web Management Service

I also had the problem of Visual Studio (2013) couldn't update the app on my server (Windows 2012 R2 IIS 8.5). I added the components manually as described above, but that didn't solve the problem. Then I found this article.

It basically says that the Web Management Service is logged on as Local Service which doesn't have access rights to the Inetpub directory. Granting permissions for Local Service solved the problem for me.

Simmons answered 27/5, 2016 at 5:40 Comment(0)
P
1

I have got the same issue. I resolved this by "Restart-Service wmsvc".

Peculiarize answered 11/3, 2020 at 10:53 Comment(1)
Hey, upvoted your question as it seems to help, as this is your first answer here, would be great if you could write a tiny litle bit more next time. Just a few more words, full sentences are really appreciated :)Appurtenance
G
0

This issue still exists in server 2019 as well. Need to install web deployed in the correct sequence

  • first, start the service - web management service
  • then install the web deploy (download from Microsoft web site)
Ghent answered 24/2, 2021 at 16:58 Comment(0)
W
0

In my case, using http://<server_address> instead of https://<server_address> in Server field (1st item in publish settings dialog) worked.

Wendy answered 19/1, 2023 at 10:13 Comment(0)
H
-1

Used only windows auth. Web deploy 3.5. And only the WMSVC certificate which is set in the Management Service icon of the top level server icon.

Headman answered 6/10, 2015 at 5:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.