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

[REGRESSION]: Azure File Copy task states successful completion when copy task cancelled #20911

Closed
4 of 7 tasks
davidb1101 opened this issue Mar 7, 2025 · 5 comments
Closed
4 of 7 tasks

Comments

@davidb1101
Copy link

New issue checklist

Task name

Azure file copy

Breaking task version

6.0

Last working task version

3.0

Regression Description

When the task tries to copy the files to the storage account, it fails stating it is unauthorized to perform the request, cancels the upload but then proceeds to label the task as completed successfully.

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-latest

Relevant log output

2025-03-07T20:35:53.9577354Z  mime: D:\a\_tasks\AzureFileCopy_eb72cb01-a7e5-427b-a8a1-1b31ccac8a43\6.252.0\MimeMapping.json
2025-03-07T20:35:53.9643198Z Uploading files from source path: 'D:\a\r1\a\********\********\********.sfpkg' to storage account: '********' in container: '********' with blob prefix: ''
2025-03-07T20:35:53.9754279Z ##[command] & "AzCopy\AzCopy.exe" copy "D:\a\r1\a\********\********\********.sfpkg" "https://********.blob.core.windows.net/********/"  --log-level=INFO --recursive
2025-03-07T20:35:54.1236237Z INFO: Scanning...
2025-03-07T20:35:58.9826674Z INFO: Login with Powershell context succeeded
2025-03-07T20:35:58.9827263Z INFO: Authenticating to destination using Azure AD
2025-03-07T20:35:58.9827960Z INFO: Any empty folders will not be processed, because source and/or destination doesn't have full folder support
2025-03-07T20:35:59.2981569Z 
2025-03-07T20:35:59.3269620Z Job 300ad5e3-5852-c044-754b-0b031e4b2c6a has started
2025-03-07T20:35:59.3362068Z Log file is located at: C:\Users\VssAdministrator\.azcopy\300ad5e3-5852-c044-754b-0b031e4b2c6a.log
2025-03-07T20:35:59.3381497Z 
2025-03-07T20:36:01.0038992Z 
2025-03-07T20:36:01.4056852Z 0.0 %, 0 Done, 0 Failed, 1 Pending, 0 Skipped, 1 Total, 
2025-03-07T20:36:01.4057966Z INFO: Authentication failed, it is either not correct, or expired, or does not have the correct permission PUT https://********.blob.core.windows.net/********/********.sfpkg
2025-03-07T20:36:01.4058960Z --------------------------------------------------------------------------------
2025-03-07T20:36:01.4062779Z RESPONSE 403: 403 This request is not authorized to perform this operation using this permission.
2025-03-07T20:36:01.4063659Z ERROR CODE: AuthorizationPermissionMismatch
2025-03-07T20:36:01.4064009Z --------------------------------------------------------------------------------
2025-03-07T20:36:01.5959468Z <?xml version="1.0" encoding="utf-8"?><Error><Code>AuthorizationPermissionMismatch</Code><Message>This request is not authorized to perform this operation using this permission.
2025-03-07T20:36:01.5960435Z RequestId:f103dd22-301e-005f-77a0-8fa6af000000
2025-03-07T20:36:01.5960660Z Time:2025-03-07T20:36:01.3474848Z</Message></Error>
2025-03-07T20:36:01.5960896Z --------------------------------------------------------------------------------
2025-03-07T20:36:01.5961007Z 
2025-03-07T20:36:03.0135907Z 0.0 %, 0 Done, 0 Failed, 1 Pending, 0 Skipped, 1 Total, 
2025-03-07T20:36:03.0138951Z 0.0 %, 0 Done, 0 Failed, 1 Pending, 0 Skipped, 1 Total, 2-sec Throughput (Mb/s): 23.6119
2025-03-07T20:36:03.0139274Z 
2025-03-07T20:36:03.0139455Z 
2025-03-07T20:36:03.0139740Z Job 300ad5e3-5852-c044-754b-0b031e4b2c6a summary
2025-03-07T20:36:03.0140135Z Elapsed Time (Minutes): 0.0671
2025-03-07T20:36:03.0141050Z Number of File Transfers: 1
2025-03-07T20:36:03.0142524Z Number of Folder Property Transfers: 0
2025-03-07T20:36:03.0142931Z Number of Symlink Transfers: 0
2025-03-07T20:36:03.0144549Z Total Number of Transfers: 1
2025-03-07T20:36:03.0145255Z Number of File Transfers Completed: 0
2025-03-07T20:36:03.0145780Z Number of Folder Transfers Completed: 0
2025-03-07T20:36:03.0146135Z Number of File Transfers Failed: 0
2025-03-07T20:36:03.0147006Z Number of Folder Transfers Failed: 0
2025-03-07T20:36:03.0147390Z Number of File Transfers Skipped: 0
2025-03-07T20:36:03.0148067Z Number of Folder Transfers Skipped: 0
2025-03-07T20:36:03.0148357Z Total Number of Bytes Transferred: 0
2025-03-07T20:36:03.0148619Z Final Job Status: Cancelled
2025-03-07T20:36:03.0148782Z 
2025-03-07T20:36:03.0572277Z Uploaded files successfully from source path: 'D:\a\r1\a\********\********\********.sfpkg' to storage account: '********' in container: '********' with blob prefix: ''

Full task logs with system.debug enabled

No response

Repro steps

@davidb1101 davidb1101 added bug regression This used to work, but a change in the service/tasks broke it. labels Mar 7, 2025
@v-schhabra v-schhabra removed the regression This used to work, but a change in the service/tasks broke it. label Mar 10, 2025
@simonfanz
Copy link

I'm seeing the same issue, both the initial 403, then the pipeline thinks it has succeeded.

@simonfanz
Copy link

simonfanz commented Mar 10, 2025

Task version 5 correctly fails at least (though I'm unsure why it's getting a 403 doing a PUT to storage account - as far as I can see service principal\service connection has necessary permissions)

EDIT: And I can confirm as per original report that Task version 3 correctly authenticates to storage account and correctly copies the files.

@v-schhabra
Copy link
Contributor

Hi @davidb1101 @simonfanz
Could you please follow the steps and let us know if you are still getting any issues in the task.

Image

@simonfanz
Copy link

simonfanz commented Mar 11, 2025

@v-schhabra - I do not have a "manage service principal" link on this service connection. Only "Manage service connection roles" which takes me to the IAM page, but with multiple service principles showing which all seem to be related to devops and as you say it's confusing\hard to tell which is the relevant one.

Assigning "Storage Blob Data Contributor" to all of them did fix the 403 so a big thanks for that! :)

Though IMO the more pressing issue is that version ~6 of this task doesn't seem to detect when the file copy fails, and happily reports that every is OK, making it hard to detect an issue.

@v-schhabra
Copy link
Contributor

Hi @simonfanz
Thanks for sharing the feedback!.
Will check on this issue and try to fix it.

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

3 participants