Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Build Pipeline Failed

Need help figuring why we are getting the below error when trying to perform a build:

    stderr:  
error: Error: spawnSync /usr/bin/zip ENOBUFS
    at Object.spawnSync (node:internal/child_process:1111:20)
    at Object.spawnSync (node:child_process:814:24)
    at ToolRunner.execSync (/home/vsts/work/_tasks/ArchiveFiles_d8b84976-e99a-4b86-b885-4849694435b0/2.211.0/node_modules/azure-pipelines-task-lib/toolrunner.js:879:23)
    at zipArchive (/home/vsts/work/_tasks/ArchiveFiles_d8b84976-e99a-4b86-b885-4849694435b0/2.211.0/archivefiles.js:152:33)
    at createArchive (/home/vsts/work/_tasks/ArchiveFiles_d8b84976-e99a-4b86-b885-4849694435b0/2.211.0/archivefiles.js:278:13)
    at doWork (/home/vsts/work/_tasks/ArchiveFiles_d8b84976-e99a-4b86-b885-4849694435b0/2.211.0/archivefiles.js:338:9)
    at Object.<anonymous> (/home/vsts/work/_tasks/ArchiveFiles_d8b84976-e99a-4b86-b885-4849694435b0/2.211.0/archivefiles.js:347:1)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32) {
  errno: -105,
  code: 'ENOBUFS',
  syscall: 'spawnSync /usr/bin/zip',
  path: '/usr/bin/zip',
  spawnargs: [Array]
};
##[error]Error: Archive creation failed for archive file: /home/vsts/work/1/a/release/53059.zip 

The above is from the ArchiveFiles@2 task within our Azure DevOps build pipeline. Here's the task:

- task: ArchiveFiles@2
  condition: eq(variables.IS_AFFECTED, 'true')
  inputs:
    rootFolderOrFile: $(Pipeline.Workspace)/dist/${{ folder }}
    includeRootFolder: false
    archiveType: zip
    archiveFile: $(Build.ArtifactStagingDirectory)/release/$(Build.BuildId).zip
    replaceExistingArchive: true
like image 412
Ultra GC Avatar asked Oct 18 '25 21:10

Ultra GC


1 Answers

I had the same issue with both ArchiveFiles@2 and ExtractFiles@1 tasks.

In my case it appeared to be the volume of files being archived and extracted. As a temp fix for the ArchiveFiles I set the properties "quiet: true" and "verbose: false" and it was fine. Unfortunately for the ExtractFiles I had to look at why I had so many files in the archive and trimmed it down to get that working.

like image 185
Adam Welch Avatar answered Oct 20 '25 23:10

Adam Welch