azure-pipelines-tasks: ArchiveFiles (2.211.0) Task throws Error: Archive creation failed for archive file:

Required Information

Question, Bug, or Feature? Bug

Enter Task Name: ArchiveFiles (2.211.0)

Environment

  • Agent - ubuntu-latest Hosted

Issue Description

I have pipeline that builds a large Hugo Static Website. As part of this pipeline the ArchiveFiles task is used to ZIP up the pages.

This has been working without any issues, but when used today it failed with the error

##[error]Error: Archive creation failed for archive file: ...

I reverted the version of the ArchiveFiles task from 2.211.0 to 2.206.0 (the version that worked previously) and the pipeline completed without any errors.

Looks like there is an issue with the newer version

Task logs

...
  adding: sspencer/2011/01/06/creating-your-own-identity-provider-for-windows-azure-appfabric-access-control/ 
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/137827.zip 
code: 0 
stdout:   adding: .gitignore (stored 0%)
  adding: 404.html (deflated 60%)
...

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 4
  • Comments: 19 (1 by maintainers)

Most upvoted comments

@jabraham0301 in your yaml just specify the complete version number e.g

- task: ArchiveFiles@2.206.0

I only found this was an option recently. I previously thought you only specify the major number e.g @2, but that is not the case, full versions can be used

As to alternatives, not sure. There is always the option to call a bash script that wrappers some command line, or there might be something in the marketplace, but reverting seems easier and works for me

Fixed in 2.211.1

It’s not in the image, those tasks are dynamically downloaded from a repo in azure. Looks like someone rolled back the deployment for that task back to 2.206.0. I’m assuming the agent for the host it ran on is still 2.211.x?

When it was originally working it was Version: 2.206.0 When it started to fail it was Version: 2.211.0 And now that it is working again it has gone back to Version: 2.206.0 Obviously, someone has changed the configuration of the ubuntu-latest VM image.