When trying to upload a file to a dataset in CKAN, I get this error in the web interface:
Failed to get credentials for storage upload. Upload cannot proceed
This error is usually caused either by CKAN's FileStore not being setup correctly, or the FileStore's dependencies not being installed correctly. See CKAN's FileStore and File Uploads documentation.
Make sure that:
You have pairtree
installed in your CKAN virtualenv (pip install pairtree
)
You have argparse
installed in your CKAN virtualenv (pip install argparse
)
You have the ofs.impl
and ofs.storage_dir
options set correctly in the [app:main]
section of your CKAN ini file, e.g.:
ofs.impl = pairtree
ofs.storage_dir = /mnt/datalocale
Make sure that your ofs.storage_dir
directory exists. Run this command in a shell: mkdir -p /path/to/your/ofs/storage/dir
.
Make sure that the operating system user that CKAN runs as (e.g. the user www-data
, if you are running CKAN with Apache on Ubuntu) has read and write permissions for the ofs.storage_dir
. For example, if you are running CKAN with Apache on Ubuntu, run these commands in the terminal:
sudo chown www-data /path/to/your/ofs/storage_dir
sudo chmod u+rwx /path/to/your/ofs/storage_dir
sudo service apache2 restart
If all of the above fails then ask for help, either using this CKAN tag on StackOverflow or the ckan-dev mailing list. When posting, it is useful to include:
paster serve ...
or, if you're running CKAN with Apache, from a log file such as /var/log/apache2/YOURSITE.error.log
. If you can get us a full Python traceback, this is usually the most useful thing.pip freeze
command when run in your CKAN virtualenv.