VSTS 提取 zip 失败并显示“EPERM:不允许操作,stat 'D:\MyFilePathHere'

VSTS Extract zip fails with 'EPERM: operation not permitted, stat 'D:\MyFilePathHere'

在我的发布定义中将 'Extract Files' 任务与“在提取之前清理目标文件夹”选项一起使用时,我经常但不总是 运行 进入 EPERM: operation not permitted, stat 'D:\MyFilePathHere。它发生在多台机器上,但已通过重新部署自行解决。将来防止这种情况的建议?

编辑:我将本地代理配置为 运行 作为网络服务,并且我已将提取文件所在的文件夹完全控制给网络服务。我有发布定义 运行 在两台不同的机器上。发布将在一个上成功而在另一个上失败。

Found: 1 files to extract: C:\agent\_work\r2\a\App-CI\App\App.zip Cleaning destination folder before extraction: D:\FilePathHere Error: EPERM: operation not permitted, stat 'D:\FilePathHere' ##[error]EPERM: operation not permitted, stat 'D:\FilePathHere ##[section]Finishing: Install New UI Files

原来这是 GitHub 上的未决问题:https://github.com/Microsoft/vsts-tasks/issues/5472

这似乎是代理与anti-virus/security软件之间的冲突。解决方法是在提取任务之前使用删除 File/Folder 任务,而不使用清除目标文件夹选项。