azure-pipelines-tasks: Download Jenkins artifacts fails with ExtractionFailed Error: Unsupported file type "undefined"

Required Information

Entering this information will route you directly to the right team and expedite traction.

Question, Bug, or Feature?
Bug

Enter Task Name: Jenkins download artifacts

Environment

  • Server - Azure Pipelines or TFS on-premises?

    Azure Pipelines: PG-CT/DIAC/ReleaseAndCiScripts Trigger

  • Agent - Hosted or Private: Private: Windows Server 2012 R2

Issue Description

We have moved our pipelines from one organization to another. after this move, the Jenkins download artifact task started to fail, when it is trying to extract the downloaded artifact:

2021-02-01T10:57:30.3729956Z ##[section]Starting: Download artifacts produced by DIAC/ReleaseAndCiScripts 2021-02-01T10:57:30.3866217Z ============================================================================== 2021-02-01T10:57:30.3866604Z Task : Jenkins download artifacts 2021-02-01T10:57:30.3866914Z Description : Download artifacts produced by a Jenkins job 2021-02-01T10:57:30.3867198Z Version : 1.175.0 2021-02-01T10:57:30.3867423Z Author : Microsoft 2021-02-01T10:57:30.3867876Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/jenkins-download-artifacts 2021-02-01T10:57:30.3868293Z ============================================================================== 2021-02-01T10:57:32.3462228Z Downloading content from Jenkins server:https://XXX/jenkins//job/DIAC/job/ReleaseAndCiScripts//api/json with strict SSL:false 2021-02-01T10:57:32.3683842Z Download artifacts from last successful build of DIAC/ReleaseAndCiScripts 2021-02-01T10:57:32.9371670Z Found job type org.jenkinsci.plugins.workflow.job.WorkflowJob 2021-02-01T10:57:32.9406506Z Downloading content from Jenkins server:https://XXX/jenkins//job/DIAC/job/ReleaseAndCiScripts//api/json?tree=lastSuccessfulBuild[id,displayname] with strict SSL:false 2021-02-01T10:57:33.4743316Z Found Jenkins job details jobName:DIAC/ReleaseAndCiScripts, jobType:org.jenkinsci.plugins.workflow.job.WorkflowJob, buildId:274, branchName:undefined 2021-02-01T10:57:34.0748456Z Downloading artifacts from: https://XXX/jenkins///job/DIAC/job/ReleaseAndCiScripts//274/artifact/*zip*/ 2021-02-01T10:57:34.7577721Z Downloading to C:\agent\_work\1\s\jenkinsArtifacts\archive.zip 2021-02-01T10:57:34.7918752Z Downloaded to C:\agent\_work\1\s\jenkinsArtifacts\archive.zip 2021-02-01T10:57:35.0867427Z Total Files: 1, Processed: 1, Skipped: 0, Failed: 0, Download time: 1.01 secs, Download size: 0Bytes 2021-02-01T10:57:35.1542149Z ##[warning]Can\'t find loc string for key: ExtractionFailed 2021-02-01T10:57:35.1558149Z ##[error]ExtractionFailed Error: Unsupported file type "undefined" at DecompressZip.extractFile (C:\agent\_work\_tasks\JenkinsDownloadArtifacts_86c37a92-59a7-444b-93c7-220fcf91e29c\1.175.0\node_modules\decompress-zip\lib\decompress-zip.js:309:11) at C:\agent\_work\_tasks\JenkinsDownloadArtifacts_86c37a92-59a7-444b-93c7-220fcf91e29c\1.175.0\node_modules\decompress-zip\lib\decompress-zip.js:242:28 at Array.forEach (native) at DecompressZip.extractFiles (C:\agent\_work\_tasks\JenkinsDownloadArtifacts_86c37a92-59a7-444b-93c7-220fcf91e29c\1.175.0\node_modules\decompress-zip\lib\decompress-zip.js:241:11) at C:\agent\_work\_tasks\JenkinsDownloadArtifacts_86c37a92-59a7-444b-93c7-220fcf91e29c\1.175.0\node_modules\decompress-zip\lib\decompress-zip.js:121:21 at _fulfilled (C:\agent\_work\_tasks\JenkinsDownloadArtifacts_86c37a92-59a7-444b-93c7-220fcf91e29c\1.175.0\node_modules\q\q.js:854:54)

Task logs

debugLogs.zip

Error logs

2021-02-01T10:57:35.1542149Z ##[warning]Can't find loc string for key: ExtractionFailed 2021-02-01T10:57:35.1558149Z ##[error]ExtractionFailed Error: Unsupported file type “undefined” at DecompressZip.extractFile (C:\agent_work_tasks\JenkinsDownloadArtifacts_86c37a92-59a7-444b-93c7-220fcf91e29c\1.175.0\node_modules\decompress-zip\lib\decompress-zip.js:309:11)

About this issue

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

Commits related to this issue

Most upvoted comments

I have located the bug. The OSS dependency "decompress-zip": "0.3.0" defaults to 'undefined' file type for directory entries in zip files if the zip file is labeled as created on UNIX. I made a small test program to extract the Jenkins generated zip in the same way as the task, and this bug causes the extraction failure with the same error message.

Solution is to update to "decompress-zip": "0.3.3"

I have not tested this in place, and the history for DownloadBuildArtifactsV0 implies this might need other dependencies to be updated.