Azure Devops IIS Web Deploy stopped working on one server. What did I break?

266 Views Asked by At

I've been using the IIS Web Deploy task successfully in several release pipelines to deploy .Net Core apps to one staging server (Server A). I recently added an additional bare-bones server to the deployment group (Server B) and added only what seemed to be necessary to run .Net apps in IIS.

The releases seemed to be working fine on both servers, but then I made other changes to Server B (installed ColdFusion 2023) that may have caused my problem, or may be a red herring.

I now get this error on Server B finding MSDeploy in the registry from msdeployutility.js, but the deployment proceeds after the error and deploys the files using the MSDeploy that comes with the task ('C:\azagent\A3_work_tasks\IISWebAppDeploymentOnMachineGroup_1b467810-6725-4b6d-accd-886174c09bba\0.229.1\node_modules\azure-pipelines-tasks-webdeployment-common\MSDeploy3.6\MSDeploy3.6\msdeploy.exe').

2023-11-06T18:32:02.0306228Z ##[debug]task result: Failed
2023-11-06T18:32:02.0306520Z ##[error]Unhandled: read ENOTCONN
2023-11-06T18:32:02.0307034Z ##[debug]Processed: ##vso[task.issue type=error;]Unhandled: read ENOTCONN
2023-11-06T18:32:02.0307841Z ##[debug]Processed: ##vso[task.complete result=Failed;]Unhandled: read ENOTCONN
2023-11-06T18:32:02.0314542Z ##[error]Error: read ENOTCONN
    at Socket._read (net.js:539:20)
    at Socket.Readable.read (_stream_readable.js:471:10)
    at new Socket (net.js:318:12)
    at Object.Socket (net.js:226:41)
    at createSocket (internal/child_process.js:280:14)
    at ChildProcess.spawn (internal/child_process.js:383:23)
    at spawn (child_process.js:551:9)
    at Registry.keys (C:\azagent\A3\_work\_tasks\IISWebAppDeploymentOnMachineGroup_1b467810-6725-4b6d-accd-886174c09bba\0.229.1\node_modules\winreg\lib\registry.js:539:14)
    at getMSDeployLatestRegKey (C:\azagent\A3\_work\_tasks\IISWebAppDeploymentOnMachineGroup_1b467810-6725-4b6d-accd-886174c09bba\0.229.1\node_modules\azure-pipelines-tasks-webdeployment-common\msdeployutility.js:133:12)
    at Object.<anonymous> (C:\azagent\A3\_work\_tasks\IISWebAppDeploymentOnMachineGroup_1b467810-6725-4b6d-accd-886174c09bba\0.229.1\node_modules\azure-pipelines-tasks-webdeployment-common\msdeployutility.js:115:50)
2023-11-06T18:32:02.0321488Z ##[debug]Processed: ##vso[task.issue type=error;]Error: read ENOTCONN
    at Socket._read (net.js:539:20)
    at Socket.Readable.read (_stream_readable.js:471:10)
    at new Socket (net.js:318:12)
    at Object.Socket (net.js:226:41)
    at createSocket (internal/child_process.js:280:14)
    at ChildProcess.spawn (internal/child_process.js:383:23)
    at spawn (child_process.js:551:9)
    at Registry.keys (C:\azagent\A3\_work\_tasks\IISWebAppDeploymentOnMachineGroup_1b467810-6725-4b6d-accd-886174c09bba\0.229.1\node_modules\winreg\lib\registry.js:539:14)
    at getMSDeployLatestRegKey (C:\azagent\A3\_work\_tasks\IISWebAppDeploymentOnMachineGroup_1b467810-6725-4b6d-accd-886174c09bba\0.229.1\node_modules\azure-pipelines-tasks-webdeployment-common\msdeployutility.js:133:12)
    at Object.<anonymous> (C:\azagent\A3\_work\_tasks\IISWebAppDeploymentOnMachineGroup_1b467810-6725-4b6d-accd-886174c09bba\0.229.1\node_modules\azure-pipelines-tasks-webdeployment-common\msdeployutility.js:115:50)
2023-11-06T18:32:02.0325368Z ##[debug]Unable to find the location of MS Deploy from registry on machine (Error : Error: spawn C:\Windows\system32\reg.exe ENOENT)

I tried installing MSDeploy 3.6 on Server B so that the key would be in the registry, but that didn't change the error. Everything still works the same on Server A, which is using the installed MSDeploy ('C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe'), not the bundled version. The logs from when the release was working on Server B show that it used the bundled version then, but didn't throw an error trying to find MSDeploy in the registry.

What on earth could I have changed that caused this issue? Permissions? Registry values? Software bundled with the ColdFusion 2023 installation?

1

There are 1 best solutions below

2
Dou Xu-MSFT On

Please check if MSDeploy key exist in your Registry Editor on Server B. If it does not exist, please re-download web deploy from this page and install again. If it exists, please check if you have permission to access it.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\3

UPDATE

If you set the agent as a service, you can go into Windows Services and check the identity of related Build service (service name is " Azure Pipelines Agent").Then open the registry editor to check if the user(Network service) has the read permission to the key.

enter image description here

Hope it can help.