curl was not found in the path Visual Studio Team

2019-02-24 02:19发布

问题:

I'm using the Hosted Agent for release management in Visual Studio Team Services. I have a cURL Upload Files task on my release definition which was working last week and I've had several successful deployments over the past weeks.

Today I created a new release from the same release definition and I am receiving the following error on the cURL Upload Files task.

2016-03-31T08:56:43.4253012Z ##[debug]curl=null
2016-03-31T08:56:43.4263027Z ##[error]curl was not found in the path.
2016-03-31T08:56:43.4303022Z ##[debug]task result: Failed
2016-03-31T08:56:43.4313025Z Return code: 1

I have checked the System Capabilities on the Hosted Agent and it lists curl C:\Program Files (x86)\Git\bin\curl.exe as one of them.

Any one have any ideas why this has suddenly started failing?

回答1:

First, sorry about this. I'm with the product team and we’ve confirmed this is a regression on our side. cURL is still on the box but it is no longer in the path. We’re working on getting this fixed on our end but it’ll likely take a day or two. In the meantime, we’d recommend doing the following:

  1. Before your curl task, create a new powershell task
  2. Change the type of the task to be an “Inline Script”
  3. Change the Inline Script input to be the following:

echo "##vso[task.setvariable variable=PATH;]$env:PATH;C:\Program Files\Git\usr\bin"

  1. Save and queue a new build.

UPDATE: We've fixed this issue now. The workaround should be no longer necessary.