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]: Exit 57005 StackOverflowException using AzureFileCopy@6 #20221

Open
1 of 7 tasks
directhex opened this issue Jul 29, 2024 · 11 comments
Open
1 of 7 tasks

[BUG]: Exit 57005 StackOverflowException using AzureFileCopy@6 #20221

directhex opened this issue Jul 29, 2024 · 11 comments

Comments

@directhex
Copy link

New issue checklist

Task name

AzureFileCopy

Task version

6.243.0

Issue Description

We've been experiencing intermittent issues with StackOverflowException in this task. It seems very likely to be related to #20156

We've experienced this failure on 6.243.0, 6.242.10, and 6.242.6 (I can't find it happening on older versions, but our job is only daily so that's not a guarantee)

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 Server 2022

Relevant log output

2024-07-29T12:05:44.3955659Z ##[section]Starting: Upload index to Azure Stroage
2024-07-29T12:05:44.3968038Z ==============================================================================
2024-07-29T12:05:44.3968174Z Task         : Azure file copy
2024-07-29T12:05:44.3968233Z Description  : Copy files to Azure Blob Storage or virtual machines
2024-07-29T12:05:44.3968327Z Version      : 6.243.0
2024-07-29T12:05:44.3968383Z Author       : Microsoft Corporation
2024-07-29T12:05:44.3968488Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/deploy/azure-file-copy
2024-07-29T12:05:44.3968585Z ==============================================================================
2024-07-29T12:05:45.8990841Z Added TLS 1.2 in session.
2024-07-29T12:05:46.2175009Z ##[command]Import-Module -Name C:\Modules\az_11.3.1\Az.Accounts\3.0.2\Az.Accounts.psd1 -Global
2024-07-29T12:05:49.7890152Z ##[command]Update-AzConfig -DisplayBreakingChangeWarning False -AppliesTo Az
2024-07-29T12:05:49.9407665Z 
2024-07-29T12:05:50.0271404Z ##[command]Enable-AzureRmAlias -Scope Process
2024-07-29T12:05:51.2715650Z 
2024-07-29T12:05:51.2716199Z Process is terminated due to StackOverflowException.
2024-07-29T12:06:11.1659556Z ##[error]Exit code 57005 returned from process: file name 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe', arguments '-NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command ". ([scriptblock]::Create('if ([Console]::InputEncoding -is [Text.UTF8Encoding] -and [Console]::InputEncoding.GetPreamble().Length -ne 0) { [Console]::InputEncoding = New-Object Text.UTF8Encoding $false } if (!$PSHOME) { $null = Get-Item -LiteralPath ''variable:PSHOME'' } else { Import-Module -Name ([System.IO.Path]::Combine($PSHOME, ''Modules\Microsoft.PowerShell.Management\Microsoft.PowerShell.Management.psd1'')) ; Import-Module -Name ([System.IO.Path]::Combine($PSHOME, ''Modules\Microsoft.PowerShell.Utility\Microsoft.PowerShell.Utility.psd1'')) }')) 2>&1 | ForEach-Object { Write-Verbose $_.Exception.Message -Verbose } ; Import-Module -Name 'D:\a\_work\_tasks\AzureFileCopy_eb72cb01-a7e5-427b-a8a1-1b31ccac8a43\6.243.0\ps_modules\VstsTaskSdk\VstsTaskSdk.psd1' -ArgumentList @{ NonInteractive = $true } -ErrorAction Stop ; $VerbosePreference = 'SilentlyContinue' ; $DebugPreference = 'SilentlyContinue' ; Invoke-VstsTaskScript -ScriptBlock ([scriptblock]::Create('. ''D:\a\_work\_tasks\AzureFileCopy_eb72cb01-a7e5-427b-a8a1-1b31ccac8a43\6.243.0\AzureFileCopy.ps1'''))"'.
2024-07-29T12:06:11.1674268Z ##[section]Finishing: Upload index to Azure Stroage

Full task logs with system.debug enabled

 [REPLACE THIS WITH YOUR INFORMATION] 

Repro steps

- task: AzureFileCopy@6
          displayName: Upload index to Azure Stroage
          inputs:
            azureSubscription: SourceDotNet-Deployment-ARM
            SourcePath: "bin/index/index/*"
            Destination: AzureBlob
            storage: $(storageAccount)
            ContainerName: $(NEW_CONTAINER_NAME)
@EshitaD
Copy link
Contributor

EshitaD commented Aug 26, 2024

Hi @directhex, is this issue still persists?

@directhex
Copy link
Author

Actually, I haven't seen this failure personally in August. Let me check in with a Teams chat w/ other people suffering from related issues.

@Schniefel
Copy link

The issue still exists

@v-schhabra v-schhabra reopened this Sep 20, 2024
@v-schhabra
Copy link
Contributor

v-schhabra commented Sep 24, 2024

Hi @directhex

  1. What kind of ARM service endpoint are you using in AzureFileCopy tasks?
  2. Where is the build agent running?
  3. How does the whole pipeline definition looks like?
  4. Share the complete debug logs?

Please share these details in order to investigate further.

@directhex
Copy link
Author

I haven't had the issues since July 29th, on a daily job. I can't guarantee I haven't just been very lucky, but from my perspective, I'm no longer experiencing an issue.

@v-schhabra
Copy link
Contributor

v-schhabra commented Sep 25, 2024

Hi @directhex

  1. What kind of ARM service endpoint are you using in AzureFileCopy tasks?
  2. Where is the build agent running?
  3. How does the whole pipeline definition looks like?
  4. Share the complete debug logs?

Please share these details in order to investigate further.

@Schniefel Could you pls let us know if you are still facing this issue or not? If yes then pls do share the details.

@mrlioncub
Copy link

mrlioncub commented Sep 25, 2024

  • Self-Hosted

I upload big files. After every ~56m:

2024-09-25T05:25:23.9194509Z Task         : Azure file copy
2024-09-25T05:25:23.9194562Z Description  : Copy files to Azure Blob Storage or virtual machines
2024-09-25T05:25:23.9194630Z Version      : 6.245.1
...
2024-09-25T05:25:36.8413980Z ##[command] & "AzCopy\AzCopy.exe" copy "\\sqlbackups\Backup\diff\db_*" "https://xxx.blob.core.windows.net/sqlbackups/db"  --overwrite ifSourceNewer --log-level=DEBUG
2024-09-25T05:25:36.9402275Z INFO: Scanning...
2024-09-25T05:25:36.9404400Z INFO: AzCopy.exe 10.25.1: A newer version 10.26.0 is available to download
...
2024-09-25T06:20:42.5350255Z 89.7 %, 4 Done, 0 Failed, 1 Pending, 1 Skipped, 6 Total, 2-sec Throughput (Mb/s): 1107.1694 (Disk may be limiting speed)
2024-09-25T06:20:42.9203413Z ##[error]Exit code 2 returned from process: file name 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe', arguments '-NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command ". ([scriptblock]::Create('if ([Console]::InputEncoding -is [Text.UTF8Encoding] -and [Console]::InputEncoding.GetPreamble().Length -ne 0) { [Console]::InputEncoding = New-Object Text.UTF8Encoding $false } if (!$PSHOME) { $null = Get-Item -LiteralPath ''variable:PSHOME'' } else { Import-Module -Name ([System.IO.Path]::Combine($PSHOME, ''Modules\Microsoft.PowerShell.Management\Microsoft.PowerShell.Management.psd1'')) ; Import-Module -Name ([System.IO.Path]::Combine($PSHOME, ''Modules\Microsoft.PowerShell.Utility\Microsoft.PowerShell.Utility.psd1'')) }')) 2>&1 | ForEach-Object { Write-Verbose $_.Exception.Message -Verbose } ; Import-Module -Name 'C:\azagent\A1\_work\_tasks\AzureFileCopy_eb72cb01-a7e5-427b-a8a1-1b31ccac8a43\6.245.1\ps_modules\VstsTaskSdk\VstsTaskSdk.psd1' -ArgumentList @{ NonInteractive = $true } -ErrorAction Stop ; $VerbosePreference = 'SilentlyContinue' ; $DebugPreference = 'SilentlyContinue' ; Invoke-VstsTaskScript -ScriptBlock ([scriptblock]::Create('. ''C:\azagent\A1\_work\_tasks\AzureFileCopy_eb72cb01-a7e5-427b-a8a1-1b31ccac8a43\6.245.1\AzureFileCopy.ps1'''))"'.

@Rudresh-Infy
Copy link

@directhex , @onetocny By any chance do you guys have any solution to this? Because I am also facing the same issue when running my release pipeline via 1ES.

  • task: AzureFileCopy@6

@v-schhabra v-schhabra added the Area:RM RM task team label Nov 10, 2024
@onetocny
Copy link
Contributor

onetocny commented Nov 11, 2024

@Rudresh-Infy The issue was probably fixed by #20575. We will start releasing fixed version next week. In the mean time it should be possible to mitigate the issue by prepending following task in your pipeline:

 - task: PowerShell@2
        inputs:
          targetType: 'inline'
          script: |
            Install-Module Az.Accounts -Force -AllowClobber -ErrorAction Stop -SkipPublisherCheck
            Import-Module Az.Accounts -Global -PassThru -Force
            Update-AzConfig -CheckForUpgrade $false

@Rudresh-Infy
Copy link

Rudresh-Infy commented Nov 14, 2024 via email

@Rudresh-Infy
Copy link

Rudresh-Infy commented Nov 14, 2024 via email

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

7 participants