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

Download doesn't work #18

Closed slarrain closed 7 years ago

slarrain commented 7 years ago

I can upload a resource and it is saved on S3 correctly (I can go to S3 and the file is downloadable from S3). However, if I try to download the file from CKAN, I get an "Internal Server Error".

On the log files, I found this:

[Sat Aug 12 23:55:24.205323 2017] [:error] [pid 25533:tid 139768329168640] [remote 127.0.0.1:10852] File '/usr/local/lib/python2.7/dist-packages/ckanext_cloudstorage-0.1.1-py2.7.egg/ckanext/cloudstorage/controller.py', line 53 in resource_download
[Sat Aug 12 23:55:24.205325 2017] [:error] [pid 25533:tid 139768329168640] [remote 127.0.0.1:10852]   base.redirect(uploaded_url)
[Sat Aug 12 23:55:24.205327 2017] [:error] [pid 25533:tid 139768329168640] [remote 127.0.0.1:10852] AttributeError: 'module' object has no attribute 'redirect'

And indeed, the base.py from ckan doesn't have any redirect. It used to, but then it got removed a month after the last time the controller.py was updated.

It looks to me like a critical bug, but I do not have enough ckan experience to propose a PR to fix it, unfortunately.

I'm using ckan2.7 on Ubuntu 14.04

TkTech commented 7 years ago

You're using a release that came out a few days ago and includes breaking changes. It's an easy fix.

slarrain commented 7 years ago

Indeed, your commit fixes the problem. Thank you so much for the quick fix @TkTech

TkTech commented 7 years ago

No problem, thank you for reporting it! We're stuck on a fairly old version at the moment so I don't notice issues like these.