azure-pipelines-tasks: Build fails to download external dependencies because sync-request module is hopelessly out of date

For example, ArchiveFilesV2:

C:\Work\GitHub\IanKemp\azure-pipelines-tasks> node make.js build

<thousands of lines of output skipped>

------------------------------------------------------------
Building: ArchiveFilesV2
------------------------------------------------------------

> getting task externals
Downloading file: https://vstsagenttools.blob.core.windows.net/tools/7zip/1/7zip.zip
C:\Work\GitHub\IanKemp\azure-pipelines-tasks\node_modules\sync-request\index.js:27
    throw new Error(res.stderr.toString());
    ^

Error
    at doRequest (C:\Work\GitHub\IanKemp\azure-pipelines-tasks\node_modules\sync-request\index.js:27:11)
    at downloadFile (C:\Work\GitHub\IanKemp\azure-pipelines-tasks\make-util.js:384:22)
    at downloadArchive (C:\Work\GitHub\IanKemp\azure-pipelines-tasks\make-util.js:424:27)
    at C:\Work\GitHub\IanKemp\azure-pipelines-tasks\make-util.js:617:33
    at Array.forEach (<anonymous>)
    at getExternals (C:\Work\GitHub\IanKemp\azure-pipelines-tasks\make-util.js:612:25)
    at C:\Work\GitHub\IanKemp\azure-pipelines-tasks\make.js:189:13
    at Array.forEach (<anonymous>)
    at Function.target.build (C:\Work\GitHub\IanKemp\azure-pipelines-tasks\make.js:154:14)
    at Object.global.target.<computed> [as build] (C:\Work\GitHub\IanKemp\azure-pipelines-tasks\node_modules\shelljs\make.js:28:26)

Similar issue with AzureAppServiceManageV0, I didn’t check any others.

Important to note that manually downloading the specified ZIP files succeeds.

I am not behind a proxy.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 17 (4 by maintainers)

Commits related to this issue

Most upvoted comments

For some reason, package.json in this project uses version 3.0.1 of sync-request, which was released more than 3 years ago… the latest version of this module is 6.1.0.

The issue I’m encountering is documented in the sync-request repo: https://github.com/ForbesLindesay/sync-request/issues/81 and was fixed by them.

I attempted to upgrade the version of sync-request to 5.0.0 but this threw hundreds of TypeScript errors because, for equally inexplicable reasons, this project locks its version of TypeScript to the equally-ancient 2.3.4.

I then attempted to upgrade TypeScript to get around this, but that caused all sorts of errors further down the build pipeline. So I then used the nuclear option and updated every Node package to its latest version, but that also caused things to break.

Honestly this is an embarrassment of note. If you’re going to use Node and its ecosystem, do it properly and keep things updated! The situation of the build process in this repo is shocking and reflects extremely poorly on Azure itself, and honestly makes me wonder exactly how reliable Azure is.

Fix it.

It should be fixed yes; but the issue is somewhere in the combination of nodejs and sync-request. I encountered the same issue when trying to build the AzurePowerShellV5 task.

For me it started to work after I installed nodejs v8.17.0 and npm v6.9.0.

Hello @stephenmichaelf, is there an update on the ETA of this issue? Thanks!

I wanted to contribute a bit, but cannot build the PublishTestresultsV2 task due to this error. Failed on Nodejs v14.17.0 (Current LTS). Haven’t yet tried downgrading to older npm versions, but lets see.

Edit: At least node 8 seems to work, which is horribly old.