UnauthorizedBlobOverwrite error even though the blob write is successful and no overwrite attempt is made.
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 3.5k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 60
Description
**Describe the bug**
Command
sudo az storage blob upload -f filename -c container -n path --account-name account-name --sas-token *******-**-*******************************-**-****************************************************************************** --no-progress;
Output
Client-Request-ID=cc820fe8-f9db-11eb-9bd8-000d3a0613b5 Retry policy did not allow for a retry: Server-Timestamp=Tue; 10 Aug 2021 13:06:38 GMT; Server-Request-ID=7556b92d-001e-005a-17e8-8df5ad000000; HTTP status code=403; Exception=This request is not authorized to perform blob overwrites. ErrorCode: UnauthorizedBlobOverwriteUnauthorizedBlobOverwriteThis request is not authorized to perform blob overwrites.RequestId:7556b92d-001e-005a-17e8-8df5ad000000Time:2021-08-10T13:06:39.0249485Z. ERROR: This request is not authorized to perform blob overwrites. ErrorCode: UnauthorizedBlobOverwrite UnauthorizedBlobOverwriteThis request is not authorized to perform blob overwrites. RequestId:7556b92d-001e-005a-17e8-8df5ad000000 Time:2021-08-10T13:06:39.0249485Z;
However, the blob did get uploaded to the container

Why are we getting this error then? Is there some kind of inbuilt retry that didnt get the response from the operation and retried to upload but since the blob was already uploaded successfully it fails with UnauthorizedBlobOverwrite exception.
**To Reproduce**
sudo az storage blob upload -f filename -c container -n path --account-name account-name --sas-token *******-**-*******************************-**-****************************************************************************** --no-progress;
**Expected behavior**
Expected the Az output to show it as a success, since the blob was uploaded successfully.
**Environment summary**
Az installed through - curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
Version -
az --version
azure-cli 2.27.0 *
OS version - Ubuntu 18.04.5 LTS
Shell type - bash
**Additional context**
This is not a consistent behavior, however the number of times this issue is occurring is alarming.
Contributor guide
Assessment
This issue has not been assessed yet.