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

Django 1.10.5 / Azure error when connecting #10

Open
homepods opened this issue Jan 9, 2017 · 4 comments
Open

Django 1.10.5 / Azure error when connecting #10

homepods opened this issue Jan 9, 2017 · 4 comments

Comments

@homepods
Copy link

homepods commented Jan 9, 2017

Dear all,

I get this error when using this configuration - what this really means?

Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature

File "xxxxxxxxxxxx\env\lib\site-packages\django\contrib\staticfiles\management\commands\collectstatic.py", line 255, in delete_file
    if self.storage.exists(prefixed_path):
  File "xxxxxxxxxxxx\storage.py", line 151, in exists 
File "xxxxxxxxxxxx\storage.py", line 70, in _get_properties
    blob_name=name
  File "xxxxxxxxxxxx\env\lib\site-packages\azure\storage\blob\baseblobservice.py", line 1440, in get_blob_properties
    return self._perform_request(request, _parse_blob, [blob_name, snapshot])
  File "xxxxxxxxxxxx\env\lib\site-packages\azure\storage\storageclient.py", line 266, in _perform_request
    raise ex
  File "xxxxxxxxxxxx\env\lib\site-packages\azure\storage\storageclient.py", line 238, in _perform_request
    raise ex
  File "xxxxxxxxxxxx\env\lib\site-packages\azure\storage\storageclient.py", line 225, in _perform_request
    _http_error_handler(HTTPError(response.status, response.message, response.headers, response.body))
  File "xxxxxxxxxxxx\env\lib\site-packages\azure\storage\_error.py", line 98, in _http_error_handler
    raise AzureHttpError(message, http_error.status)
azure.common.AzureHttpError: Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
@kevin-brown
Copy link
Contributor

Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature

This usually means one of four things:

  • You can't connect to Azure (DNS issues, usually) - For some reason the Azure package doesn't always detect this
  • You connected to Azure, but your machine couldn't validate their certificate - This happens a lot in cases where your machine's certificates are out of date, but is less common
  • You connected to Azure, and Azure rejected your authentication credentials because they were incorrect - This usually means your ACCOUNT_KEY is incorrect
  • You connected to Azure, and Azure rejected your signature because it was out of date - This usually means that your system clock has drifted by more than a few minutes and needs to be corrected

Unfortunately this is their generic "AuthenticationFailed" error message which usually has a "AuthenticationErrorDetail" that includes more detail, but the Azure package does not include it.

@homepods
Copy link
Author

homepods commented Jan 9, 2017

and if you had such an error, how would you fix it?

@kevin-brown
Copy link
Contributor

Usually fixing the issue would require knowing what the issue is, as they tend to have very different fixes.

  • Check if you can ping blob.core.windows.net - If not, check if you can do it from another machine on the network
  • Check if you can open the URL in Python using urlopen or requests - If not, it should give you a useful error message
  • Copy/paste your account key from Azure to make sure you didn't have an issue before
  • Check the date reported by your machine, see if it looks wrong. If you need a guess as to what time it should be saying, ask Google what time is it?

@homepods
Copy link
Author

homepods commented Jan 9, 2017

raise AzureHttpError(message, http_error.status)
azure.common.AzureHttpError: The value for one of the HTTP headers is not in the correct format.
<?xml version="1.0" encoding="utf-8"?><Error><Code>InvalidHeaderValue</Code><Message>The value for one of the HTTP headers is not in the correct format.
RequestId:dbafa875-0001-0061-54a1-6a6a83000000
Time:2017-01-09T17:51:38.4357963Z</Message><HeaderName>x-ms-blob-type</HeaderName><HeaderValue>Blob</HeaderValue></Error>`

What is this suppose to mean?

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