Azure-pipelines-tasks: DownloadGitHubRelease broken due to incorrect host

Created on 29 Jan 2021  路  5Comments  路  Source: microsoft/azure-pipelines-tasks

Question, Bug, or Feature?
Type: Bug

https://github.com/microsoft/azure-pipelines-tasks/tree/master/Tasks/DownloadGitHubReleaseV0

Environment

  • Server - Azure Pipelines
  • Agent - Hosted: ubuntu-latest

Issue Description

[Include task name(s), screenshots and any other relevant details]

Task logs

Retrying download of reference-architecture.zip, retry count: 4
##vso[task.debug]Nothing to process currently, respawing worker 2 after 1 sec.
##vso[task.debug]Nothing to process currently, respawing worker 3 after 1 sec.
##vso[task.debug]Nothing to process currently, respawing worker 4 after 1 sec.
##vso[task.debug]Nothing to process currently, respawing worker 2 after 1 sec.
##vso[task.debug]Nothing to process currently, respawing worker 3 after 1 sec.
##vso[task.debug]Nothing to process currently, respawing worker 4 after 1 sec.
##vso[task.debug]Nothing to process currently, respawing worker 2 after 1 sec.
##vso[task.debug]Nothing to process currently, respawing worker 3 after 1 sec.
##vso[task.debug]Nothing to process currently, respawing worker 4 after 1 sec.
##vso[task.debug]Nothing to process currently, respawing worker 2 after 1 sec.
##vso[task.debug]Nothing to process currently, respawing worker 3 after 1 sec.
##vso[task.debug]Nothing to process currently, respawing worker 4 after 1 sec.
##vso[task.debug]Nothing to process currently, respawing worker 2 after 1 sec.
##vso[task.debug]Nothing to process currently, respawing worker 3 after 1 sec.
##vso[task.debug]Nothing to process currently, respawing worker 4 after 1 sec.
##vso[task.debug]patternRoot: 'null'
##vso[task.debug]matchOptions.debug: 'false'
##vso[task.debug]matchOptions.nobrace: 'true'
##vso[task.debug]matchOptions.noglobstar: 'false'
##vso[task.debug]matchOptions.dot: 'true'
##vso[task.debug]matchOptions.noext: 'false'
##vso[task.debug]matchOptions.nocase: 'false'
##vso[task.debug]matchOptions.nonull: 'false'
##vso[task.debug]matchOptions.matchBase: 'false'
##vso[task.debug]matchOptions.nocomment: 'false'
##vso[task.debug]matchOptions.nonegate: 'false'
##vso[task.debug]matchOptions.flipNegate: 'false'
##vso[task.debug]pattern: '**'
##vso[task.debug]applying include pattern against original list
##vso[task.debug]1 matches
##vso[task.debug]1 final results
##vso[task.debug]Processing reference-architecture.zip
##vso[task.debug]Nothing to process currently, respawing worker 2 after 1 sec.
##vso[task.debug]Nothing to process currently, respawing worker 3 after 1 sec.
##vso[task.debug]Nothing to process currently, respawing worker 4 after 1 sec.
##vso[task.debug]Error getting file reference-architecture.zip: Error: Failed request: (statusCode) 400
##vso[task.debug]Agent.Version=undefined
##vso[task.logissue type=error;code=error;agentVersion=undefined;taskId=artifact-engine-0.1.26;]{"stack":"Error: Failed request: (statusCode) 400\n    at WebClient.<anonymous> (/mnt/f/workspace/other/git-download-task/node_modules/artifact-engine/Providers/webClient.js:41:23)\n    at Generator.next (<anonymous>)\n    at /mnt/f/workspace/other/git-download-task/node_modules/artifact-engine/Providers/webClient.js:7:65\n    at new Promise (<anonymous>)\n    at __awaiter (/mnt/f/workspace/other/git-download-task/node_modules/artifact-engine/Providers/webClient.js:3:12)\n    at WebClient.processResponse (/mnt/f/workspace/other/git-download-task/node_modules/artifact-engine/Providers/webClient.js:35:16)\n    at /mnt/f/workspace/other/git-download-task/node_modules/artifact-engine/Providers/webClient.js:20:22\n    at processTicksAndRejections (node:internal/process/task_queues:93:5)","message":"Failed request: (statusCode) 400","statusCode":400,"result":"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error><Code>InvalidArgument</Code><Message>Only one auth mechanism allowed; only the X-Amz-Algorithm query parameter, Signature query string parameter or the Authorization header should be specified</Message><ArgumentName>Authorization</ArgumentName><ArgumentValue>Bearer 728516f08e622e33ca511ec19150ee6436031fac</ArgumentValue><RequestId>F0AC121E095AEC0D</RequestId><HostId>LMJzb/KFP0Em5bwpRm0PCRS1xvduJ7Q04UvfoJzBp2fPQR4Io9k2ChTxsj/BIR5t2m4RXXMN2HM=</HostId></Error>"}
##vso[task.debug]task result: Failed
##vso[task.issue type=error;]Error: Failed request: (statusCode) 400
##vso[task.complete result=Failed;]Error: Failed request: (statusCode) 400
##vso[task.debug]Aborting respawning worker, as download failed for some file(s).
##vso[task.debug]Aborting respawning worker, as download failed for some file(s).
##vso[task.debug]Aborting respawning worker, as download failed for some file(s).

Troubleshooting

Use the task and see how it crashes.

bug route

Most helpful comment

I did test it.
The thing is that once you try to download the file you get redirected (302 Found) from github.com to github-releases.githubusercontent.com.
My understanding is that previously it was redirecting to AWS S3 native URL directly.
S3 headers are still present though.

All 5 comments

Having the same issue. By digging through the task code a bit i could properly get the reqeusted release and fetch the asset list via api, but then failed to download them via ArtifactEngine and/or webProvider.

This Issue started yesterday around 16:25 MEZ btw, since i had pipelines prior going throug and one at that time failing

I've already prepared a PR fixing this issue: https://github.com/microsoft/azure-pipelines-tasks/pull/14310

@JakubWojtowicz-TomTom did you test whether that fixes the issue?
Because i think its strange that the calls up to, including the one getting the list of assets via https://api.github.com/repos/OWNER/REPO/releases/RELEASE_ID/assets succeed and only the download itself seems to fail. and those requests seem to be limited to api.github.com and github.com for the download? (by using the download link given by manually querying the assets api call)
And all those requests (including the succeeding api ones) use the same handler.
Granted: the change here would still add the auth header to the api ones, so these should still work. does the ArtifactEngine download the assets from github-releases.githubusercontent?

I did test it.
The thing is that once you try to download the file you get redirected (302 Found) from github.com to github-releases.githubusercontent.com.
My understanding is that previously it was redirecting to AWS S3 native URL directly.
S3 headers are still present though.

Ah, thanks for that info! That PR was blazing fast too :)

Was this page helpful?
0 / 5 - 0 ratings