Description
New issue checklist
- I searched for existing GitHub issuesI checked how to collect logs
Task name
ArchiveFiles@2
Task version
2.256.0
Issue Description
I suspect that in the latest version where task-lib has been update to the ;atest version in ArchiveFilesV2 task there is a bug.
https://github.com/microsoft/azure-pipelines-tasks/releases/tag/v256
In our case, we create a zip file and then add files or folders to it.
- task: ArchiveFiles@2
name: PackageFolder
displayName: 'Package Templates Folder'
inputs:
rootFolderOrFile: '$(packagePath)/templates'
includeRootFolder: true
archiveFile: '${zipFileName).zip'
replaceExistingArchive: false
- task: ArchiveFiles@2
name: PackageFile
displayName: 'Package Manifest File'
inputs:
rootFolderOrFile: '$(packagePath)/package-manifest.json'
includeRootFolder: false
archiveFile: '$(zipFileName).zip'
replaceExistingArchive: false
When rootFolderOrFile points to a folder everything works fine, but an error occurs when a single file needs to be added to the archive. Worth to check is there only issue with adding to archive or also with creating one from a single file.
Due to documentation rootFolderOrFile should support folder or single file:
https://learn.microsoft.com/pl-pl/azure/devops/pipelines/tasks/reference/archive-files-v2?view=azure-pipelines#inputs
I have reverted our pipelines to use version ArchiveFiles@2.254.1 and it's working fine now, but I would like to work on the latest version.
AC:
- ArchiveFiles@2 should work also when rootFolderOrFile variable is pointing to a single file.
Environment type (Please select at least one enviroment where you face this issue)
- Self-HostedMicrosoft HostedVMSS PoolContainer
Azure DevOps Server type
dev.azure.com (formerly visualstudio.com)
Azure DevOps Server Version (if applicable)
No response
Operation system
ubuntu-22.04
Relevant log output
2025-05-19T13:20:14.0589786Z ##[section]Starting: Package Manifest File
2025-05-19T13:20:14.0594411Z ==============================================================================
2025-05-19T13:20:14.0594540Z Task : Archive files
2025-05-19T13:20:14.0594618Z Description : Compress files into .7z, .tar.gz, or .zip
2025-05-19T13:20:14.0594718Z Version : 2.256.0
2025-05-19T13:20:14.0594790Z Author : Microsoft Corporation
2025-05-19T13:20:14.0594879Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/archive-files
2025-05-19T13:20:14.0594982Z ==============================================================================
2025-05-19T13:20:14.1708346Z Archive file: zipfile.zip already exists. Attempting to add files to it.
2025-05-19T13:20:14.1715334Z Found 1 files
2025-05-19T13:20:14.1715995Z Archiving file:
2025-05-19T13:20:14.1726063Z files=
2025-05-19T13:20:14.1730782Z [command]/usr/bin/zip -r -v zipfile.zip
2025-05-19T13:20:14.1819328Z
2025-05-19T13:20:14.1821544Z zip error: Nothing to do! (zipfile.zip)
2025-05-19T13:20:14.1824509Z ##[error]Error: Archive creation failed for archive file: zipfile.zip
code: 12
stdout:
zip error: Nothing to do! (zipfile.zip)
stderr:
error: undefined;
2025-05-19T13:20:14.1826046Z ##[error]Archive creation failed for archive file: zipfile.zip
code: 12
stdout:
zip error: Nothing to do! (zipfile.zip)
stderr:
error: undefined;
2025-05-19T13:20:14.1837545Z ##[section]Finishing: Package Manifest File
Full task logs with system.debug enabled
[REPLACE THIS WITH YOUR INFORMATION]
Activity
tracetechnical commentedon May 21, 2025
Same issue here.
IDH-GabrielR commentedon May 21, 2025
We are experiencing a similar issue with the same version, but just trying to create an archive from a file. Previous version 2.254.1 had no issues.
keisari-ch commentedon May 21, 2025
All our pipelines using the task are down due to the upgrade from 2.254.1 to 2.256.0. The change happened in the last few hours (< 8 hours)
sbabai commentedon May 21, 2025
We had the same experience since our last bump from 2.254.1 to 2.256.0.
albertino87 commentedon May 21, 2025
same here
ACshyamrahate commentedon May 21, 2025
Same issue here after upgrade to 2.256.0.
keisari-ch commentedon May 23, 2025
workaround : #21036 (comment)
insanity13 commentedon Jun 16, 2025
Same issue. I guess it's related to #21085 due to azure-pipelines-task-lib changes
UPD: Updating the agent to the latest 4.255.0 helped
KristofKuli commentedon Jun 17, 2025
Same issue here. Our agents are on version 4.255.0, but we are still experiencing the issue. Rollback to previous version is not possible, as the release pipelines are not YAML based.
insanity13 commentedon Jun 17, 2025
Hmm, it's weird we also using non-YAML pipeline. And after I used "Update Targets" on deployment group, it get working


May be the reason is not in the agent version, but the task cache cleaning when updating the agent.
Since error above is due to a change in azure-pipelines-task-lib.
You can try clearing the tasks cache on the agent (if you are using local-hosted)
Path like C:\azagent\A1_work_tasks (clear everything in this folder)
KristofKuli commentedon Jun 17, 2025
We are using self-hosted VMSS pool, hence the cache clearing is not applicable.