moov2 / npm-msdeploy

This is a wrapper around Microsoft msdeploy that can be used in npm scripts
MIT License
1 stars 2 forks source link

Error Code: ERROR_USER_UNAUTHORIZED #4

Open theYasirRehman opened 5 years ago

theYasirRehman commented 5 years ago

I had configured NPM-MSDeploy as following:

Installation: npm install msdeploy --save

Added script in the package.json as: "deploy": "msdeploy --verb sync --allowUntrusted true --source package=dist.zip --dest auto,ComputerName=https://hostname:8172/msdeploy.axd?site=site-name,UserName=domain\username,Password=password,AuthType=Basic,includeAcls=False"

and tried it by running "npm run deploy".

I had also tried it with same script and added config in package.json as: "config": { "ComputerName": "https://hostname:8172/msdeploy.axd?site=site-name", "UserName": "domain\username", "Password": "password", "dest": "auto"

It gives error "ERROR_USER_UNAUTHORIZED" everytime.

FYI, the target server is on different domain and network.

Here is the screenshot of the error:

image

theYasirRehman commented 5 years ago

The target server is Windows Server 2012 with IIS 7.x

mobinzk commented 5 years ago

This is not an issue with the script and if you run the MSDeploy command you probably gonna get the same error. Here are some suggestions that could help you debug the issue.

theYasirRehman commented 5 years ago

I had tried multiple time on the various target servers with different username and password. I think there is no issue with the username and password.

I haven't tried "publishProfile" binding with msdeploy yet. Is it something related to "publishProfile"?

mobinzk commented 5 years ago

By publishProfile I meant the username and password in the publishProfile xml tag in your PublishSettings file.

theYasirRehman commented 5 years ago

You can see in the above image that it shows "Connected to the remote computer" which shows there are no issues with the username and password. As for as, I know MSDeploy deploy those packages are created by itself that contains three xmls (archive, parameters, and systeminfo) and specifically organized content. Will this be able to deploy an ordinary zip file?

Actually, I have built the application with some build scripts to a folder and then archive it with WinRAR .

peterkeating commented 5 years ago

@YasiRehman MSDeploy can always be fiddly to get set up. I would suggest using msdeploy.exe directly without using this npm package to make sure there are no issues with the configuration of your server environment. If you can get that working and then the npm package still doesn't work then it will be a case of trying to find the difference between the command ran directly with msdeploy.exe against the one that this npm package runs. After all, this package is simply taking the parameters from an npm script and passing them to msdeploy.exe.