Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
4 of 7 tasks
damiankleczko opened this issue May 19, 2025 · 7 comments · May be fixed by #21036
Assignees
Labels
Area: ABTT Akvelon Build Tasks Team area of work bug triage

Comments

@damiankleczko
Copy link

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 [email protected] 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

@tracetechnical
Copy link

Same issue here.

@IDH-GabrielR
Copy link

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
Copy link

keisari-ch commented 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
Copy link

sbabai commented May 21, 2025

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

@albertino87
Copy link

same here

@ACshyamrahate
Copy link

Same issue here after upgrade to 2.256.0.

@v-schhabra v-schhabra added Area: ABTT Akvelon Build Tasks Team area of work and removed Area: Release labels May 23, 2025
@keisari-ch
Copy link

workaround : #21036 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: ABTT Akvelon Build Tasks Team area of work bug triage
Projects
None yet
8 participants