question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ExtractFiles should allow overwriting destination

See original GitHub issue

Required Information

Entering this information will route you directly to the right team and expedite traction.

Question, Bug, or Feature?
bug

Enter Task Name: ExtractFiles

Environment

  • Server : Azure Pipelines

  • Agent : Private : Windows Server 2019

Issue Description

Task fails if “Clean destination folder before extracting” is not checked and destination folder is not empty.

Task logs

2019-10-19T12:13:02.9307087Z ##[section]Starting: Extract files 
2019-10-19T12:13:02.9446365Z ==============================================================================
2019-10-19T12:13:02.9446437Z Task         : Extract files
2019-10-19T12:13:02.9446466Z Description  : Extract a variety of archive and compression files such as .7z, .rar, .tar.gz, and .zip
2019-10-19T12:13:02.9446510Z Version      : 1.151.1
2019-10-19T12:13:02.9446551Z Author       : Microsoft Corporation
2019-10-19T12:13:02.9446577Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/extract-files
2019-10-19T12:13:02.9446604Z ==============================================================================
2019-10-19T12:13:03.2123419Z No path specified for search pattern: *.zip defaulting to: C:\azagent\A1\_work\r1\a
2019-10-19T12:13:03.2124863Z Searching for: *.zip under directory: C:\azagent\A1\_work\r1\a
2019-10-19T12:13:03.2200742Z Found: 1 files to extract:
2019-10-19T12:13:03.2200895Z C:\azagent\A1\_work\r1\a\Staging - CI\AssetToDeply\AssetToDeply.zip
2019-10-19T12:13:03.2207021Z Extracting file: C:\azagent\A1\_work\r1\a\Staging - CI\AssetToDeply\AssetToDeply.zip
2019-10-19T12:13:03.2219725Z [command]C:\azagent\A1\_work\_tasks\ExtractFiles_5e1e3830-fbfb-11e5-aab1-090c92bc4988\1.151.1\7zip\7z.exe x -oC:\Apps\AssetDest\dev C:\azagent\A1\_work\r1\a\Staging - CI\AssetToDeply\AssetToDeply.zip
2019-10-19T12:13:03.2435313Z 
2019-10-19T12:13:03.2435539Z 
2019-10-19T12:13:03.2435783Z ERROR: Can't allocate required memory!
2019-10-19T12:13:03.2435822Z 7-Zip [64] 16.00 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-10
2019-10-19T12:13:03.2435867Z 
2019-10-19T12:13:03.2435912Z Scanning the drive for archives:
2019-10-19T12:13:03.2435961Z 1 file, 35814372 bytes (35 MiB)
2019-10-19T12:13:03.2435994Z 
2019-10-19T12:13:03.2436042Z Extracting archive: C:\azagent\A1\_work\r1\a\Staging - CI\AssetToDeply\AssetToDeply.zip
2019-10-19T12:13:03.2436104Z --
2019-10-19T12:13:03.2436184Z Path = C:\azagent\A1\_work\r1\a\Staging - CI\AssetToDeply\AssetToDeply.zip
2019-10-19T12:13:03.2436216Z Type = zip
2019-10-19T12:13:03.2436292Z Physical Size = 35814372
2019-10-19T12:13:03.2436347Z 
2019-10-19T12:13:03.2436377Z 
2019-10-19T12:13:03.2436424Z Would you like to replace the existing file:
2019-10-19T12:13:03.2436475Z   Path:     C:\Apps\AssetDest\dev\Api.Abstractions.dll
2019-10-19T12:13:03.2436519Z   Size:     10240 bytes (10 KiB)
2019-10-19T12:13:03.2436548Z   Modified: 2019-10-19 10:16:40
2019-10-19T12:13:03.2436639Z with the file from archive:
2019-10-19T12:13:03.2436730Z   Path:     Api.Abstractions.dll
2019-10-19T12:13:03.2436761Z   Size:     10240 bytes (10 KiB)
2019-10-19T12:13:03.2436841Z   Modified: 2019-10-19 10:16:40
2019-10-19T12:13:03.2436915Z ? (Y)es / (N)o / (A)lways / (S)kip all / A(u)to rename all / (Q)uit? 
2019-10-19T12:13:03.2436981Z Archives with Errors: 1
2019-10-19T12:13:03.2437000Z 
2019-10-19T12:13:03.2438414Z code: 2

Troubleshooting

Need to add “-aoa” switch (Overwrite All existing files without prompt.) to 7zip command.

Related issues

  • ExtractFiles failing in Release pipeline with ERROR: Can’t allocate required memory! #11135
  • ExtractFiles to support override files on the target path #5522

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:7
  • Comments:28 (6 by maintainers)

github_iconTop GitHub Comments

4reactions
stephenmichaelfcommented, Apr 23, 2020

I will get this PR merged this week. Thanks!

2reactions
stephenmichaelfcommented, Apr 28, 2020

I was on call last week but I have time blocked on it today, I am going to open a new PR and will link to it here!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Extract Files task - Azure Pipelines | Microsoft Learn
Extract files from archives to a target folder using minimatch patterns on Azure Pipelines and Team ... Overwrite files in the destination directory....
Read more >
Extract Files Task Fails - Visual Studio Feedback
Looking at the logs the extract fails because there is no answer to the challenge of whether or not to override an existing...
Read more >
Extract and overwrite existing files - command line - Super User
I am trying to write a batch script to extract files out of an existing ZIP file, into another folder on ...
Read more >
Forcefully Replacing Existing Files during Extracting File using ...
You can extract files to some temp directory and than copy files with the "File.Copy" with the ovveride option true to your destination...
Read more >
Extract Zip File Action - VSoft Technologies Documentation Wiki
This action allows you to extract files from a zip archive file. You can choose ... Never: The file will not be extracted...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found