azure-pipelines-tasks: [Question]: AzureFileCopy started to fail on 21st Aug @ just after 12:30 BST.

Task name

AzureFilecopy

Task version

5.0

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)

Windows 2019 Datacenter

Operation system

Windows 2019 Datacenter

Question

Hi, we have started seeing a problem resolving the Sanitizer module in the above task. The AzureFileCopy task copies a file from a Storage Account onto the C:\temp folder on an Azure Windows VM running Server 2019 Datacenter.

The log implies that the module has been loaded:

2023-08-23T14:15:20.7037529Z ##[debug]Loading module from path 'D:\a\_tasks\AzureFileCopy_eb72cb01-a7e5-427b-a8a1-1b31ccac8a43\5.227.0\ps_modules\Sanitizer\Sanitizer.psm1'.
2023-08-23T14:15:20.7118086Z ##[debug]Loading resource strings from: D:\a\_tasks\AzureFileCopy_eb72cb01-a7e5-427b-a8a1-1b31ccac8a43\5.227.0\ps_modules\Sanitizer/module.json

But when the script is attempting to run on the VM the following error is reported:

2023-08-23T14:16:43.6557692Z -ExecutionPolicy Unrestricted -Command ". 
2023-08-23T14:16:43.6558018Z 'C:\Users\adminuser\AppData\Local\Temp\e9f131e0-0904-4611-b60a-30f412e6b24b.ps1'"
2023-08-23T14:16:43.6558122Z 
2023-08-23T14:16:43.7348294Z Import-Module : The specified module 'C:\Users\adminuser\AppData\Local\Temp\ps_modules\Sanitizer' 
2023-08-23T14:16:43.7348885Z At line:1 char:1
2023-08-23T14:16:43.7349175Z + & 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe' -NoLogo ...
2023-08-23T14:16:43.7349583Z + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2023-08-23T14:16:43.7350327Z     + CategoryInfo          : NotSpecified: (Import-Module :...les\Sanitizer' :String) [], RemoteException
2023-08-23T14:16:43.7350704Z     + FullyQualifiedErrorId : NativeCommandError
2023-08-23T14:16:43.7350922Z  
2023-08-23T14:16:43.7351127Z 
2023-08-23T14:16:43.7455112Z ##[debug]Processed: ##vso[task.complete result=Failed]
2023-08-23T14:16:43.7455461Z 
2023-08-23T14:16:44.5304389Z was not loaded because no valid module file was found in any module directory.
2023-08-23T14:16:44.5304948Z 
2023-08-23T14:16:44.5307796Z ##[debug]Processed: ##vso[task.complete result=Failed]
2023-08-23T14:16:44.5308138Z 
2023-08-23T14:16:44.5308764Z At C:\Users\adminuser\AppData\Local\Temp\4cb675ed-e14c-457a-afc7-0a219eb60a0b.ps1:11 char:5
2023-08-23T14:16:44.5309112Z 
2023-08-23T14:16:44.5311649Z ##[debug]Processed: ##vso[task.complete result=Failed]
2023-08-23T14:16:44.5311802Z 
2023-08-23T14:16:44.5312085Z +     Import-Module $PSScriptRoot\ps_modules\Sanitizer
2023-08-23T14:16:44.5312166Z 
2023-08-23T14:16:44.5312943Z ##[debug]Processed: ##vso[task.complete result=Failed]
2023-08-23T14:16:44.5313071Z 
2023-08-23T14:16:44.5313211Z +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2023-08-23T14:16:44.5313283Z 
2023-08-23T14:16:44.5313848Z ##[debug]Processed: ##vso[task.complete result=Failed]
2023-08-23T14:16:44.5314121Z 
2023-08-23T14:16:44.5314302Z     + CategoryInfo          : ResourceUnavailable: (C:\Users\adminu...dules\Sanitizer:String) [Imp 
2023-08-23T14:16:44.5314404Z 
2023-08-23T14:16:44.5315085Z ##[debug]Processed: ##vso[task.complete result=Failed]
2023-08-23T14:16:44.5315202Z 
2023-08-23T14:16:44.5315430Z    ort-Module], FileNotFoundException
2023-08-23T14:16:44.5315497Z 
2023-08-23T14:16:44.5315880Z ##[debug]Processed: ##vso[task.complete result=Failed]
2023-08-23T14:16:44.5316004Z 
2023-08-23T14:16:44.5316182Z     + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

Any advice on how to resolve this problem? Thanks Andy

About this issue

  • Original URL
  • State: closed
  • Created 10 months ago
  • Comments: 34 (13 by maintainers)

Most upvoted comments

@LeftTwixWand Andrew and I are on the same team and its working our side. Thanks

Hello everyone, please check and try to run your pipelines now, and if your using Microsoft hosted agents, task should be able to fetch version 5.226.1 (previous working version) If your using self-hosted agent, please try to clear the cache of 5.227.0 and agents should be able to pick task version 5.226.1. If you’re using YAML pipeline, you can define the task version as 5.226.1 and try to run it.

Thanks!

We are having the exact same problem on all our pipelines, which are running as Microsoft-hosted agents. Highly critical as it is blocking our VM deployments.

5.227.0.

171377_logs_14.txt I have had to remove some security information so new upload

@marcusrichards going by the error message, this doesn’t look to be an issue from the task end, it’s something to do with your pipeline configuration.

Thank you. I upgraded the remote VM and everything is now running ok. Thanks for your super quick response 👍

I can confirm it now works @v-mohithgc using AzureFileCopy 5.226.1.

@v-mohithgc testing this now. Pipeline is running so will update once complete

171377_logs_14.txt

I have had to remove some security information so new upload

@marcusrichards going by the error message, this doesn’t look to be an issue from the task end, it’s something to do with your pipeline configuration.

@AndrewBates666 and others can you all confirm if the reverted version of 5.226.1 is showing a similar error or working fine for you all?

How do we change the classic pipeline task version from 5.* to 5.226.1 ? The drop down for task version only has 5., 4., 3* etc?

there is no need to change, if your using Microsoft hosted agent you can just re-run the pipeline and the agent should be able to automatically pick version 5.226.1. Once you re-run let me know if your agent is not able to pick task version 5.226.1. you can verify the task version in task logs only. for example: image

We’re using the standard Azure DevOps Microsoft-hosted agents and release pipeline. All tasks using AzureFilecopy are failing with the Sanitizer error. Yes, all of our VMs can’t currently be deployed so it is critical for us as well.