Common Web Deploy connection errors (and recipes for fixing them)
Note: this is a cross-post from bilalaslam.com
Because Web Deploy is a client-server product, unless it is set up correctly, chances are you will hit a wall pretty quickly at the point where a connection is made. In this blog post, I will show you common solutions for common errors.
Read on for general tips and recipes for fixing common connectivity errors.
General Tips
- Web Deploy sometimes returns different information in errors messages if you provide administrator credentials vs. non-administrator credentials. If you hit an error, try to run the command as administrator.
- Web Deploy sometimes returns different information if source and destination machine are the same vs. destination machine is remote. If you hit an error, try to run it on the remote machine.
- Run the command with –verbose and –debug switches. These will make Web Deploy spit out more information which can be useful in debugging.
Error: 503 Server Unavailable
Error Trace:
msdeploy.exe -verb:dump -source:apphostconfig,computerName=demo-host
Error: Object of type 'appHostConfig' and path '' cannot be created.
Error: Remote agent (URL http://demo-host/MSDEPLOYAGENTSERVICE) could not be contacted. Make sure the remote agent service is installed and started on the target computer.
Error: An unsupported response was received. The response header 'MSDeploy.Response' was '' but 'v1' was expected.
Error: The remote server returned an error: (503) Server Unavailable.
Error count: 1.
Why it happens:
- Incorrect destination name or host unreachable.
- Remote Agent Service not installed on destination.
How to fix it:
- Make sure you can ping the remote computer.
- Run this command on the destination in an elevated command prompt: “net start msdepsvc”. This will start the Remote Agent Service on the destination, which allows administrator deployments.
Error: Default credentials cannot be supplied for the basic authentication scheme
Error Trace:
msdeploy.exe -verb:dump -source:apphostconfig,wmsvc=demo-host
Error: Object of type 'appHostConfig' and path '' cannot be created.
Error: The specified credentials cannot be used with the authentication scheme 'basic'.
Error: Default credentials cannot be supplied for the basic authentication scheme.
Parameter name: authType
Error count: 1.
Why it happens:
- You are telling Web Deploy to connect to the Web Management Service on the destination. By default, Web Deploy will connect using HTTP Basic Authentication.
- When using HTTP Basic Authentication, specific credentials must be supplied, which is not true in the command shown above.
How to fix it:
Change the command to:
msdeploy.exe -verb:dump -source:apphostconfig,wmsvc=demo-host,authType:basic,username=someuser,password=somepassword
Error: The remote certificate is invalid according to the validation procedure.
Error Trace:
msdeploy.exe -verb:dump -source:apphostconfig,wmsvc=demo-host,authType=basic,username=someuser,password=somepassword
Error: Object of type 'appHostConfig' and path '' cannot be created.
Error: Could not complete the request to remote agent URL 'https://demo-host:8172/msdeploy.axd?Site='.
Error: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
Error: The remote certificate is invalid according to the validation procedure.
Error count: 1.
Why it happens:
- You are connecting to the destination using the Web Management Service (wmsvc), which creates an HTTPS connection.
- The certificate on the destination is invalid, so you see this error.
How to fix it:
- Install a valid wmsvc certificate on the destination
- OR add the –allowUntrusted flag on the command
msdeploy.exe -verb:dump -source:apphostconfig,wmsvc=demo-host,authType=basic,username=someuser,password=somepassword –allowUntrusted