ckanext-cloudstorage icon indicating copy to clipboard operation
ckanext-cloudstorage copied to clipboard

libcloud azure 400 error on self.driver.get_container()

Open wardi opened this issue 7 years ago • 3 comments

Azure's returning a 400 error due to the header x-ms-version:2012-02-12 on HEAD requests when checking a container name here: https://github.com/TkTech/ckanext-cloudstorage/blob/master/ckanext/cloudstorage/storage.py#L38

Updating libcloud.common.azure.API_VERSION to '2014-02-14' seems to resolve the issue, but it's strange that I have to do this (this change hasn't been made in libcloud's trunk branch)

Do you recommend I hack or monkey patch libcloud 1.5 with this change? Is there a better approach?

wardi avatar Mar 14 '18 17:03 wardi

Was the bucket created as a "new"-style Azure bucket or Azure Classic?

TkTech avatar Mar 14 '18 23:03 TkTech

We're using the "new"-style. Are those unsupported by libcloud?

wardi avatar Mar 15 '18 13:03 wardi

There doesn't seem to be any official documentation on supported versions, but I ran into a bunch of headaches trying to use the new style buckets for open.canada.ca. Switching to a classic bucket should make your problem disappear if it's an option. Note you can't switch on some of the SEA regional servers.

The proper solution here is to stop using libcloud entirely for Azure and rely on Microsoft's azure package. libcloud's Azure driver doesn't seem to be frequently updated or properly tested.

TkTech avatar Mar 15 '18 14:03 TkTech