-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Set-AzStorageBlobContent throws PSArgumentOutOfRangeException on small files #17743
Comments
Thank you for your feedback. This has been routed to the support team for assistance. |
@yvzn I have tried to repro the issue with latest Az.Storage 4.4.1, by running a similar script as yours 100 times. |
@blueww Could it make a difference ? Possibly in the way the code computes the file size ? We are using this cmdlet a lot every day, as part of our CI/CD build ; most of the time it runs ok, but we get the exception dozen times a day, approximately. The only workaround for now is to retry the faulty upload, until it eventually succeeds. I was wondering if adding an extra check to the |
From the Powershell code, it looks the "pr.PercentComplete" can't be bigger than 100, since finishedBytes should <= fileSize, until there are some SDK issue cause the finishedBytes is not accurate. However, to unblock you, we can add code to limit the "pr.PercentComplete" to <=100. |
@blueww |
@yvzn |
Description
From time to time
Set-AzStorageBlobContent
Cmdlet throws aPSArgumentOutOfRangeException
with message 'Cannot set percent because PercentComplete cannot be greater than 100', when uploading a small file to blob storage.It looks like the file is uploaded after all. However the thrown exception can be a blocker if
-ErrorAction
is set toStop
.Source code
https://github.com/Azure/azure-powershell/blob/main/src/Storage/Storage/Blob/Cmdlet/SetAzureStorageBlobContent.cs#L464
Issue script & Debug output
Environment data
Module versions
Error output
The text was updated successfully, but these errors were encountered: