Skip to content
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

[BUG]: Azure File Copy Task (Version 6) is breaking on pipeline using Self hosted agent with error 'The term 'azcopy' is not recognized. #20003

Open
1 of 7 tasks
Varaprasad91 opened this issue Jun 13, 2024 · 8 comments
Assignees

Comments

@Varaprasad91
Copy link

Varaprasad91 commented Jun 13, 2024

New issue checklist

Task name

Azure file copy

Task version

6.241.0

Issue Description

We recently upgraded the Azure DevOps (ADO) service connection from using an Azure Resource Manager service principal (automatic) to Azure Resource Manager using Workload Identity federation with OpenID Connect (automatic). But, we got an issue with Azure file copy task (Task version 6) when running it on pipeline with self-hosted agent. The error message received was: 'The term 'azcopy' is not recognized as the name of a cmdlet, function, script file, or operable program. Please check the spelling of the name, or verify that the path is correct and try again.' Also, the task works correctly when using an Azure agent, but fails on the self-hosted agent.

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

windows

Relevant log output

[debug]Script stack trace:
[debug]at ThrowError, C:\Agent\vsts-agent-win-x64-2.182.1\_work\_tasks\AzureFileCopy_eb72cb01-a7e5-427b-a8a1-1b31ccac8a43\6.241.0\Utility.ps1: line 121
[debug]at Upload-FilesToAzureContainer, C:\Agent\vsts-agent-win-x64-2.182.1\_work\_tasks\AzureFileCopy_eb72cb01-a7e5-427b-a8a1-1b31ccac8a43\6.241.0\Utility.ps1: line 272
[debug]at <ScriptBlock>, C:\Agent\vsts-agent-win-x64-2.182.1\_work\_tasks\AzureFileCopy_eb72cb01-a7e5-427b-a8a1-1b31ccac8a43\6.241.0\AzureFileCopy.ps1: line 181
[debug]at <ScriptBlock>, <No file>: line 1
[debug]at <ScriptBlock>, <No file>: line 22
[debug]at <ScriptBlock>, <No file>: line 18
[debug]at <ScriptBlock>, <No file>: line 1
[debug]Exception:
System.Management.Automation.RuntimeException: Upload to container: 'sitemap-generator' in storage account: 'sitemapextractor' with blob prefix: '' failed with error: 'AzCopy.exe exited with non-zero exit code while uploading files to blob storage.' For more info please refer to https://aka.ms/azurefilecopyreadme
2024-06-13T07:48:44.0282744Z ##[error]Upload to container: 'sitemap-generator' in storage account: 'sitemapextractor' with blob prefix: '' failed with error: 'AzCopy.exe exited with non-zero exit code while uploading files to blob storage.' For more info please refer to https://aka.ms/azurefilecopyreadme
[debug]Processed: ##vso[task.logissue type=error;source=TaskInternal]Upload to container: 'sitemap-generator' in storage account: 'sitemapextractor' with blob prefix: '' failed with error: 'AzCopy.exe exited with non-zero exit code while uploading files to blob storage.' For more info please refer to https://aka.ms/azurefilecopyreadme
[debug]Processed: ##vso[task.complete result=Failed]
[section]Finishing: AzureBlob File Copy

Full task logs with system.debug enabled

 [REPLACE THIS WITH YOUR INFORMATION] 

Repro steps

No response

Tasks

No tasks being tracked yet.
@v-schhabra
Copy link
Contributor

Hi @Varaprasad91
Could you please share us the complete logs of the pipeline by adding variable system.debug to "true".

@Varaprasad91
Copy link
Author

Varaprasad91 commented Jun 13, 2024

error logs1.txt
@v-schhabra could you please check this

@v-schhabra
Copy link
Contributor

Hi @Varaprasad91
Thanks for sharing the logs. I hope @v-snalawade already connected with you reg this issue and she has started investigation.

@tomaeda
Copy link

tomaeda commented Jun 20, 2024

Hi, @v-snalawade
I'm having trouble with the same issue. Are there any updates?
Auto-login appears to fail because azcopy.exe isn't available for the oauth token task has retrieved, even though task has running Connect-AzAccount.
Same issue as #19910 ?

@v-schhabra
Copy link
Contributor

v-schhabra commented Jun 20, 2024

Hi, @v-snalawade I'm having trouble with the same issue. Are there any updates? Auto-login appears to fail because azcopy.exe isn't available for the oauth token task has retrieved, even though task has running Connect-AzAccount. Same issue as #19910 ?

We are already investigating on this issue. Will share the latest updates here.
Could you please share us the complete logs of the pipeline by adding variable system.debug to "true".

@v-snalawade
Copy link
Contributor

@tomaeda - Can you check if this suggestion resolves the issue

@tomaeda
Copy link

tomaeda commented Jun 21, 2024

Thank you for your response.

@v-schhabra
I'm sorry, the logs I'm seeing are provided by the end user. I can't share it here.
I haven't been able to reproduce this issue, so I don't have my own logs.
However, the information from line 5599 onwards in the error.logs1.txt shared by Varaprasad91 is consistent with the logs I am seeing, except for specific information such as the storage account name.

@v-snalawade
End user can work around the issue with a different pool.
The issue only occurs with the Self-hosted agent pool, not with MS-hosted pool.
But end user wants to use Self-hosted, so I'd like to know how to resolve the inconsistency between powershell and pwsh. (If this is same issue)

@v-schhabra
Copy link
Contributor

Thank you for your response.

@v-schhabra I'm sorry, the logs I'm seeing are provided by the end user. I can't share it here. I haven't been able to reproduce this issue, so I don't have my own logs. However, the information from line 5599 onwards in the error.logs1.txt shared by Varaprasad91 is consistent with the logs I am seeing, except for specific information such as the storage account name.

@v-snalawade End user can work around the issue with a different pool. The issue only occurs with the Self-hosted agent pool, not with MS-hosted pool. But end user wants to use Self-hosted, so I'd like to know how to resolve the inconsistency between powershell and pwsh. (If this is same issue)

If it is fine for you please share the logs at v-schhabra@microsoft.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants