question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Microsoft.Azure.Storage.StorageException: Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.

See original GitHub issue

Which service(blob, file) does this issue concern?

azure blob

Which version of the SDK was used?

0.11.0

On which platform were you using? (.Net Framework version or .Net Core version, and OS version)

.netframework

How can the problem be reproduced? It’d be better if the code caused the problem can be shared.

this is intermittent in nature, some times happens even after multiple retries, code used as below happening when using the code from azure batch

`DownloadOptions options = new DownloadOptions(); options.DisableContentMD5Validation = true;

        SingleTransferContext sharedTransferContext = new SingleTransferContext();


        TransferManager.DownloadAsync(blob, path + Path.DirectorySeparatorChar + name, options, sharedTransferContext).Wait();`

What problem was encountered?

Unhandled Exception: System.AggregateException: One or more errors occurred. —> Microsoft.Azure.Storage.DataMovement.TransferException: The transfer failed. —> Microsoft.Azure.Storage.StorageException: Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.

Have you found a mitigation/solution?

No

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:4
  • Comments:33

github_iconTop GitHub Comments

1reaction
pwang2commented, Feb 20, 2021

This exception is EXTREME misleading!!

With my experiences, a lot of runtime error, use error could result this…

  1. if you are copying /pasting files via azure storage explorer, you might result your pasted files locked for no reason and can not be updated by your data job…
  2. if you are batching some processing and write the output of the files to blob container via IBinder writeAsync, you may result this as there is a race condition and the process could be jammed
  3. If you network is not quite reliable, and a file upload attempt is timeout, you may also see this… blob/storage service itself is implemented via HTTP protocol, for large files, some limitations could always result something unexpectantly.

I personally find it is super frustration. following resource might help a little.
https://docs.microsoft.com/en-us/azure/azure-functions/functions-best-practices https://docs.microsoft.com/en-us/azure/storage/blobs/storage-performance-checklist

There is always a long way to go for Microsoft to make a better cloud I/O.

1reaction
vjrantalcommented, Apr 9, 2020

This is relevant only if SAS tokens are used but sharing as reference that we observed this same error message and the root cause turned out to be the issue warned about at https://docs.microsoft.com/en-us/azure/storage/common/storage-sas-overview#best-practices-when-using-sas:

Be careful with SAS start time. If you set the start time for a SAS to now, then due to clock skew (differences in current time according to different machines), failures may be observed intermittently for the first few minutes. In general, set the start time to be at least 15 minutes in the past. Or, don’t set it at all, which will make it valid immediately in all cases.

In our case, the start time is not required so the fix was to get rid of the StartsOn property which was a diff like below with the .NET SDK:

BlobSasBuilder sasBuilder = new BlobSasBuilder()
{
    BlobContainerName = containerName,
    BlobName = blobName,
    Resource = "b",
-   StartsOn = DateTimeOffset.UtcNow,
    ExpiresOn = DateTimeOffset.UtcNow.AddHours(1)
};
Read more comments on GitHub >

github_iconTop Results From Across the Web

Azure Blob Storage fails to authenticate: "Make sure the ...
Azure Blob Storage fails to authenticate: "Make sure the value of Authorization header is formed correctly including the signature".
Read more >
AzureStorage Blob Server failed to authenticate ...
Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature. The error ...
Read more >
Error Message: “Server failed to authenticate the request. ...
1. Navigate to Lasernet Developer > Commands and double-click the Azure storage you are trying to use. 2. Identify what type of credentials...
Read more >
Error "Server failed to authenticate the request" while ...
If request authentication is failing, that means there is an issue with the SAS token provided while configuring the job. You need to...
Read more >
ERROR: "Server failed to authenticate the request. Make sure ...
ERROR : "Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found