Skip to content

[BUG]: Newest ArchiveFilesV2 is failing on adding single file to existing archive - rollback to previous version helped #21033

Open
@damiankleczko

Description

@damiankleczko

New issue checklist

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-Hosted
    Microsoft Hosted
    VMSS Pool
    Container

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] 

Repro steps

Activity

tracetechnical

tracetechnical commented on May 21, 2025

@tracetechnical

Same issue here.

IDH-GabrielR

IDH-GabrielR commented on May 21, 2025

@IDH-GabrielR

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

keisari-ch commented on May 21, 2025

@keisari-ch

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

sbabai commented on May 21, 2025

@sbabai

We had the same experience since our last bump from 2.254.1 to 2.256.0.

albertino87

albertino87 commented on May 21, 2025

@albertino87

same here

ACshyamrahate

ACshyamrahate commented on May 21, 2025

@ACshyamrahate

Same issue here after upgrade to 2.256.0.

added
Area: ABTTAkvelon Build Tasks Team area of work
and removed on May 23, 2025
keisari-ch

keisari-ch commented on May 23, 2025

@keisari-ch

workaround : #21036 (comment)

insanity13

insanity13 commented on Jun 16, 2025

@insanity13

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

KristofKuli commented on Jun 17, 2025

@KristofKuli

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

insanity13 commented on Jun 17, 2025

@insanity13

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.

Hmm, it's weird we also using non-YAML pipeline. And after I used "Update Targets" on deployment group, it get working
Image
Image

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

KristofKuli commented on Jun 17, 2025

@KristofKuli

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.

Hmm, it's weird we also using non-YAML pipeline. And after I used "Update Targets" on deployment group, it get working Image Image

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)

We are using self-hosted VMSS pool, hence the cache clearing is not applicable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Participants

    @insanity13@tracetechnical@keisari-ch@albertino87@ACshyamrahate

    Issue actions

      [BUG]: Newest ArchiveFilesV2 is failing on adding single file to existing archive - rollback to previous version helped · Issue #21033 · microsoft/azure-pipelines-tasks