为什么下载后我的Azure Devops Pipeline Artifact被另一个进程锁定? [英] Why is my Azure Devops Pipeline Artifact locked by another process after download?

查看:130
本文介绍了为什么下载后我的Azure Devops Pipeline Artifact被另一个进程锁定?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非常简单的发布管道,只需要做几件事:

I have a very simple release pipeline that only needs to do a few things:

  1. 下载要发布的工件.
  2. 使用在存档中标记化"步骤替换一些配置值.
  3. 部署Azure应用功能

我希望该工件以zip文件的形式下载. 当流水线进入第2步时,在存档中标记化"步骤我收到有关另一个已将文件锁定的进程的错误:

The artifact is downloaded as a zip file as I expect. When the pipeline gets to step 2, the Tokenize in Archive step I get an error about another process having the file locked:

2019-12-05T18:46:30.3959242Z ==============================================================================
2019-12-05T18:46:30.3959351Z Task         : Tokenize in Archive
2019-12-05T18:46:30.3959415Z Description  : Allows you to tokenize within an archive without unpacking.
2019-12-05T18:46:30.3959494Z Version      : 1.1.2
2019-12-05T18:46:30.3960010Z Author       : Solidify Labs
2019-12-05T18:46:30.3960106Z Help         : [More Information](https://github.com/solidify/vsts-task-tokenize-in-archive)
2019-12-05T18:46:30.3960203Z ==============================================================================
2019-12-05T18:46:33.9236236Z Searching for all My.Functions.App.zip files at d:\a\r1\a\dist
2019-12-05T18:46:33.9236804Z Searching for local.settings.json inside MyFunctions.App.zip files
2019-12-05T18:46:34.0743681Z 
2019-12-05T18:46:34.0755112Z GAC    Version        Location                                                                                         
2019-12-05T18:46:34.0755702Z ---    -------        --------                                                                                         
2019-12-05T18:46:34.0801996Z True   v4.0.30319     C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.IO.Compression.FileSystem\v4.0_4.0.0.0__b77a...
2019-12-05T18:46:34.0843963Z Matched zip: D:\a\r1\a\dist\MyFunctions.App.zip
2019-12-05T18:46:34.4714977Z ##[error]System.Management.Automation.RuntimeException: Another process has locked the 'D:\a\r1\a\dist\MyFunctions.App.zip' file.

我尝试将zip文件复制到另一个目录并在那里进行标记化. 我还编写了一些Powershell,以查看该文件是否为只读文件,并且看起来不是. 该管道在默认的Azure Pipelines托管代理中运行,因此我不确定还有哪些其他进程可以锁定该文件.

I have tried copying the zip file to another directory and doing the tokenize there. I also wrote some Powershell to see if the file was Read-only and it does not appear to be. The pipeline is running in the default Azure Pipelines Hosted Agent so I am not sure what other processes could be locking the file.

有人以前见过这种情况吗,或对此情况有解决方法?

Has anyone seen this before or has a workaround for this condition?

谢谢.

推荐答案

下载管道工件后,我通过运行一些PowerShell列出目录内容来解决这个问题.

I figured this out by running some PowerShell to list the contents of the directory after the Pipeline artifact is downloaded.

管道"工件在下载步骤中自动解压缩.错误消息指出另一个进程已锁定文件,这是令人误解的.它应显示无法解压缩目录"之类的内容.另一个令人困惑的部分是该目录仍然具有.zip文件扩展名,这使我认为我仍在处理zip文件而不是目录.

The Pipeline artifact is unzipped automatically by the download step. The error message saying that another process has locked the file is misleading. It should say something like "Unable to unzip a directory". The other confusing part was that the directory still has a .zip file extension which made me think that I was still dealing with a zip file rather than a directory.

这篇关于为什么下载后我的Azure Devops Pipeline Artifact被另一个进程锁定?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆