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

Intermittent error in Deliver step #528

Closed
AskeHolst opened this issue May 11, 2023 · 4 comments
Closed

Intermittent error in Deliver step #528

AskeHolst opened this issue May 11, 2023 · 4 comments

Comments

@AskeHolst
Copy link

I get the error below in the Deliver step, but when rerunning it delivers correctly. So there is some randomness to it.
The error given to the user "Error: StorageContext secret is malformed..." is a red herring, I guess you just catch all errors and assume it was a problem with the StorageContext.

Note the part "Error was: Cannot set percent because PercentComplete cannot be greater than 100. Parameter name: value Actual value was 101."

Not a big issue, we can just rerun if it happens again, more to let you know about a potential bug lurking somewhere, but maybe that is Az.Storage?

Run microsoft/AL-Go-Actions/Deliver@v3.0
Run try { D:\a\_actions\microsoft\AL-Go-Actions\v3.0\Deliver/Deliver.ps1 -actor $ENV:_actor -token $ENV:_token -parentTelemetryScopeJson $ENV:_parentTelemetryScopeJson -projects $ENV:_projects -deliveryTarget $ENV:_deliveryTarget -artifacts $ENV:_artifacts -type $ENV:_type -atypes $ENV:_atypes -goLive ($ENV:_goLive -eq 'Y') } catch { Write-Host "::Error::Unexpected error when running action ($($_.Exception.Message.Replace("`r",'').Replace("`n",' ')))"; exit 1 }
Downloading BcContainerHelper latest version from CDN
BcContainerHelper version 5.0.1
BC.HelperFunctions emits usage statistics telemetry to Microsoft
Artifacts .artifacts
Projects:
[REDACTED1]
[REDACTED2]
Using StorageContext
Project 'Intercompany.Main'
Artifacts:
- [REDACTED1]-main-Apps-1.0.27.6
- [REDACTED1]-main-BuildOutput-1.0.27.6
- [REDACTED1]-main-TestApps-1.0.27.6
- [REDACTED1]-main-TestResults-1.0.27.6
- [REDACTED2]-main-Apps-1.0.27.6
- [REDACTED2]-main-BuildOutput-1.0.27.6
- thisbuild-[REDACTED1]-Apps
- thisbuild-[REDACTED1]-TestApps
- thisbuild-[REDACTED1]-Apps
Azure.Storage Module is available in version 2.1.0
Using Azure.Storage version 2.1.0
Json OK
WARNING: Microsoft Azure PowerShell collects data about how users use PowerShell cmdlets and some problems they 
encounter.  Microsoft uses this information to improve our PowerShell cmdlets.  Participation is voluntary and when you
 choose to participate your device automatically sends information to Microsoft about how you use Azure PowerShell. 

If you choose to participate, you can stop at any time by using Azure PowerShell as follows:

1. Use the Disable-AzureDataCollection cmdlet to turn the feature Off. The cmdlet can be found in the 
AzureResourceManager module

To disable data collection: PS > Disable-AzureDataCollection

If you choose to not participate, you can enable at any time by using Azure PowerShell as follows:

1. Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can be found in the 
AzureResourceManager module

To enable data collection: PS > Enable-AzureDataCollection

Select Y to enable data collection [Y/N]:
Error: Deliver action failed. Error: StorageContext secret is malformed. Needs to be formatted as Json, containing StorageAccountName, containerName, blobName and sastoken or storageAccountKey, which points to an existing container in a storage account. Error was: Cannot set percent because PercentComplete cannot be greater than 100. Parameter name: value Actual value was 101. Stacktrace: at <ScriptBlock>, D:\a\_actions\microsoft\AL-Go-Actions\v3.0\Deliver\Deliver.ps1: line 349 at <ScriptBlock>, D:\a\_actions\microsoft\AL-Go-Actions\v3.0\Deliver\Deliver.ps1: line 99 at <ScriptBlock>, D:\a\_temp\70f8a265-2e2b-4cb5-a3e5-db9e0e543a7c.ps1: line 2 at <ScriptBlock>, <No file>: line 1
AL-Go action ran: Deliver Telemetry Correlation Id: ab9b8260-681f-41fd-b05d-6c1c9510c670
Removing BcContainerHelper
Error: Process completed with exit code 1.
@freddydk
Copy link
Contributor

You are right that the error is out of our hands, but I will improve the error message.
Also, I will set

$ProgressPreference = "SilentlyContinue"

Which might prevent the error message altogether.

@freddydk
Copy link
Contributor

The "funny" thing is that the function failing is New-AzStorageContext - why in earth would that need a percentage complete indicator????

@AskeHolst
Copy link
Author

Yeah, seems it was already found and fixed Azure/azure-powershell#20489 and here Azure/azure-powershell#17743
But if the old buggy version is used, that is of course still a problem.

@freddydk
Copy link
Contributor

In both of these bugs, it is setting the blob that makes the percentage go beyond 100.
In your sample, it was creating the context... - but I guess there is similar code behind...

freddydk added a commit that referenced this issue Jul 25, 2023
…eference to silently continue) (issue528) (#616)

Fix for issue #528
Set ProgressPereference to SilentlyContinue and strict-mode v2.0 in all
PowerShell scripts.
and give better error messages when uploading to storage accounts

---------

Co-authored-by: freddydk <freddydk@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants