我根据这些步骤设置了本地文件存储
http://docs.ckan.org/en/latest/filestore.html
创建位置
sudo mkdir -p /var/lib/ckan/default
我确认位置存在且位于正确的位置
我取消注释行
ofs.impl = pairtree
ofs.storage_dir = /var/lib/ckan/default
我确认我已经安装了pairtree和argparse
我使用jetty作为Web服务器而非Apache,所以
sudo chown jetty /var/lib/ckan/default
sudo chmod u+rwx /var/lib/ckan/default
sudo service jetty restart
然后我运行此命令启动我的网站
paster serve /etc/ckan/default/development.ini
然后我得到了这个堆栈跟踪,我在虚拟环境中执行所有这些命令
2013-12-04 17:39:46,369 WARNI [ckan.lib.uploader] Please use config option ckan.storage_path instaed of
ofs.storage_path
Traceback (most recent call last):
File "/usr/lib/ckan/default/bin/paster", line 9, in <module>
load_entry_point('PasteScript==1.7.5', 'console_scripts', 'paster')()
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/script/command.py", line 104, in run
invoke(command, command_name, options, args[1:])
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/script/command.py", line 143, in invoke
exit_code = runner.run(args)
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/script/command.py", line 238, in run
result = self.command()
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/script/serve.py", line 284, in command
relative_to=base, global_conf=vars)
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/script/serve.py", line 321, in loadapp
**kw)
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 247, in loadapp
return loadobj(APP, uri, name=name, **kw)
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 272, in loadobj
return context.create()
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 710, in create
return self.object_type.invoke(self)
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 146, in invoke
return fix_call(context.object, context.global_conf, **context.local_conf)
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/deploy/util.py", line 56, in fix_call
val = callable(*args, **kw)
File "/usr/lib/ckan/default/src/ckan/ckan/config/middleware.py", line 156, in make_app
os.makedirs(path)
File "/usr/lib/ckan/default/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/var/lib/ckan/default/storage'
答案 0 :(得分:7)
权限被拒绝:'/ var / lib / ckan / default / storage'
您似乎无权读取和写入此目录。尝试在终端中运行这些命令:
sudo chown -R `whoami` /var/lib/ckan/default
sudo chmod -R u+rwx /var/lib/ckan/default
答案 1 :(得分:0)
对于那些几年后跌跌撞撞的人...
在尝试设置数据存储区并运行paster --plugin=ckan datastore set-permissions -c /etc/ckan/default/production.ini
命令时遇到了这个问题。
我已经setup FileStore as per the docs。我最终要做的是在Web UI中上传资源,然后重新运行上面的命令,错误不再出现,并且输出按预期工作。上传资源后,会使用适当的权限创建/var/lib/ckan/default/resources
和/var/lib/ckan/default/storage
目录,而paster命令无需尝试创建它们(或者我假设是这样)。
如果您有稍有不同的问题导致此错误,这里还有一些其他资源: