azure-storage-python: Random authentication error when using account SAS to upload large file to blob storage

Hi guys,

I am seeing random authentication issues when using account SAS to upload large files ( >20 GB) to blob storage.

azure.common.AzureHttpError: Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
<?xml version="1.0" encoding="utf-8"?><Error><Code>AuthenticationFailed</Code><Message>Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
RequestId:aa7f238b-0001-0006-3d71-cf3f37000000
Time:2017-05-18T00:54:58.0436290Z</Message><AuthenticationErrorDetail>sr is mandatory. Cannot be empty</AuthenticationErrorDetail></Error>

The authentication error detail showed sr is mandatory. Cannot be empty. Per Account SAS documentation, account SAS doesn’t have the sr parameter while service SAS has it. Using the same token, I was able to successfully upload 2 large files at different time, but it also failed many times due to authentication issue. The SAS token is given to me, and I do not have direct access to the account, so I may not be able to change or generate a service SAS. Could you please take a look if this is a bug or simply I just miss something?

Thanks

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 16 (5 by maintainers)

Most upvoted comments

I’m having the same intermittent failure with uploading large files, although most of my files are a little smaller. I’ve seen this failure occur with files as small as 2-5 GB.

Hi @thanhnhut90,

The error code does appear misleading but comparing this request with one that succeeded around the same time, I see that this failure appears to be because the SAS token was duplicated in the uri.

failure:

‘sv=2016-05-31&ss=b&srt=sco&sp=rwdlac&se=2037-05-10T20:07:37Z&st=2017-05-10T12:07:37Z&spr=https&sig=XXXXX&sv=2016-05-31&ss=b&srt=sco&sp=rwdlac&se=2037-05-10T20:07:37Z&st=2017-05-10T12:07:37Z&spr=https&sig=XXXXX&comp=block&blockid=TURBd01EQXdNREF3TURBd01EQXdNREF3TURBd01UQTRORFkwTnpBeE5EUSUzRA%3D%3D’

successful:

sv=2016-05-31&ss=b&srt=sco&sp=rwdlac&se=2037-05-10T20:07:37Z&st=2017-05-10T12:07:37Z&spr=https&sig=XXXXX&comp=block&blockid=TURBd01EQXdNREF3TURBd01EQXdNREF3TURBd01URXdOamczTmpneU5UWSUzRA%3D%3D

Thanks @neh. Just an update, this appears to be an issue with out retry policies when using SAS (which will often get triggered with bigger uploads). We are looking into possible fixes and getting that out soon.