TkTech / ckanext-cloudstorage

Implements support for resource storage against multiple popular providers via apache-libcloud (S3, Azure Storage, etc...)
MIT License
35 stars 55 forks source link

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

Open wardi opened 6 years ago

wardi commented 6 years ago

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?

TkTech commented 6 years ago

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

wardi commented 6 years ago

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

TkTech commented 6 years ago

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.