无法关注ckan中的组织

时间:2017-07-04 15:13:11

标签: server http-status-code-404 ckan

我从最新文档的源代码中设置了ckan。当用户尝试关注组织时,我的浏览器界面上会出现以下错误:

404 Not Found

The resource could not be found.

Incorrect group type

当我在virtualenv中使用“paster serve /etc/ckan/default/development.ini”命令运行网站时,我在关注组织时在我的网站上收到以下错误:

"Server Error

An internal server error occurred"

我在终端上得到以下追溯:

Error - <type 'exceptions.OSError'>: [Errno 13] Permission denied: '/tmp/default/sessions/container_file_lock/4'
URL: http://127.0.0.1:5000/group/follow/80a2d460-6c4d-436d-8e3b-45b2efca0752
File '/usr/lib/ckan/default/local/lib/python2.7/site-packages/weberror/errormiddleware.py', line 171 in __call__
  app_iter = self.application(environ, sr_checker)
File '/usr/lib/ckan/default/local/lib/python2.7/site-packages/webob/dec.py', line 147 in __call__
  resp = self.call_func(req, *args, **self.kwargs)
File '/usr/lib/ckan/default/local/lib/python2.7/site-packages/webob/dec.py', line 208 in call_func
  return self.func(req, *args, **kwargs)
File '/usr/lib/ckan/default/local/lib/python2.7/site-packages/fanstatic/publisher.py', line 234 in __call__
  return request.get_response(self.app)
File '/usr/lib/ckan/default/local/lib/python2.7/site-packages/webob/request.py', line 1053 in get_response
  application, catch_exc_info=False)
File '/usr/lib/ckan/default/local/lib/python2.7/site-packages/webob/request.py', line 1022 in call_application
  app_iter = application(self.environ, start_response)
File '/usr/lib/ckan/default/local/lib/python2.7/site-packages/webob/dec.py', line 147 in __call__
  resp = self.call_func(req, *args, **self.kwargs)
File '/usr/lib/ckan/default/local/lib/python2.7/site-packages/webob/dec.py', line 208 in call_func
  return self.func(req, *args, **kwargs)
File '/usr/lib/ckan/default/local/lib/python2.7/site-packages/fanstatic/injector.py', line 54 in __call__
  response = request.get_response(self.app)
File '/usr/lib/ckan/default/local/lib/python2.7/site-packages/webob/request.py', line 1053 in get_response
  application, catch_exc_info=False)
File '/usr/lib/ckan/default/local/lib/python2.7/site-packages/webob/request.py', line 1022 in call_application
  app_iter = application(self.environ, start_response)
File '/home/ammar/ckan/lib/default/src/ckan/ckan/config/middleware/pylons_app.py', line 245 in inner
  result = application(environ, start_response)
File '/usr/lib/ckan/default/local/lib/python2.7/site-packages/beaker/middleware.py', line 73 in __call__
  return self.app(environ, start_response)
File '/usr/lib/ckan/default/local/lib/python2.7/site-packages/beaker/middleware.py', line 155 in __call__
  return self.wrap_app(environ, session_start_response)
File '/usr/lib/ckan/default/local/lib/python2.7/site-packages/routes/middleware.py', line 131 in __call__
  response = self.app(environ, start_response)
File '/usr/lib/ckan/default/local/lib/python2.7/site-packages/pylons/wsgiapp.py', line 125 in __call__
  response = self.dispatch(controller, environ, start_response)
File '/usr/lib/ckan/default/local/lib/python2.7/site-packages/pylons/wsgiapp.py', line 324 in dispatch
  return controller(environ, start_response)
File '/home/ammar/ckan/lib/default/src/ckan/ckan/lib/base.py', line 292 in __call__
  res = WSGIController.__call__(self, environ, start_response)
File '/usr/lib/ckan/default/local/lib/python2.7/site-packages/pylons/controllers/core.py', line 284 in __call__
  return response(environ, self.start_response)
File '/usr/lib/ckan/default/local/lib/python2.7/site-packages/webob/exc.py', line 341 in __call__
  return self.generate_response(environ, start_response)
File '/usr/lib/ckan/default/local/lib/python2.7/site-packages/webob/exc.py', line 333 in generate_response
  return resp(environ, start_response)
File '/usr/lib/ckan/default/local/lib/python2.7/site-packages/webob/response.py', line 917 in __call__
  start_response(self.status, headerlist)
File '/usr/lib/ckan/default/local/lib/python2.7/site-packages/beaker/middleware.py', line 149 in session_start_response
  session.persist()
File '/usr/lib/ckan/default/local/lib/python2.7/site-packages/beaker/session.py', line 735 in persist
  self._session().save()
File '/usr/lib/ckan/default/local/lib/python2.7/site-packages/beaker/session.py', line 415 in save
  **self.namespace_args)
File '/usr/lib/ckan/default/local/lib/python2.7/site-packages/beaker/container.py', line 635 in __init__
  OpenResourceNamespaceManager.__init__(self, namespace)
File '/usr/lib/ckan/default/local/lib/python2.7/site-packages/beaker/container.py', line 190 in __init__
  self.access_lock = self.get_access_lock()
File '/usr/lib/ckan/default/local/lib/python2.7/site-packages/beaker/container.py', line 647 in get_access_lock
  lock_dir=self.lock_dir)
File '/usr/lib/ckan/default/local/lib/python2.7/site-packages/beaker/synchronization.py', line 81 in file_synchronizer
  return _synchronizer(identifier, FileSynchronizer, **kwargs)
File '/usr/lib/ckan/default/local/lib/python2.7/site-packages/beaker/synchronization.py', line 74 in _synchronizer
  return _synchronizers.sync_get((identifier, cls), cls, identifier, **kwargs)
File '/usr/lib/ckan/default/local/lib/python2.7/site-packages/beaker/util.py', line 177 in sync_get
  return self._create(key, createfunc, *args, **kwargs)
File '/usr/lib/ckan/default/local/lib/python2.7/site-packages/beaker/util.py', line 184 in _create
  self[key] = obj = createfunc(*args, **kwargs)
File '/usr/lib/ckan/default/local/lib/python2.7/site-packages/beaker/synchronization.py', line 226 in __init__
  extension='.lock'
File '/usr/lib/ckan/default/local/lib/python2.7/site-packages/beaker/util.py', line 238 in encoded_path
  verify_directory(dir)
File '/usr/lib/ckan/default/local/lib/python2.7/site-packages/beaker/util.py', line 85 in verify_directory
  os.makedirs(dir)
File '/usr/lib/ckan/default/lib/python2.7/os.py', line 150 in makedirs
  makedirs(head, mode)
File '/usr/lib/ckan/default/lib/python2.7/os.py', line 157 in makedirs
  mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/tmp/default/sessions/container_file_lock/4'

请帮忙。

2 个答案:

答案 0 :(得分:3)

例外情况是由于文件权限而无法创建目录。在命令行上尝试相同的事情:

mkdir -p /tmp/default/sessions/container_file_lock/4

假设失败,那么你有两个选择:

  1. 更改您的文件权限以允许写入/ tmp
  2. 告诉CKAN将其烧杯会话存储在可以写入的其他地方。相关的CKAN配置选项为:cache_dir

答案 1 :(得分:0)

这是纯粹的目录权限

drwxr-xr-x. 3 root root 16 May 8 17:33 4

确保权限是这样的。

此外,请确保您对此目录具有正确的用户和组权限(递归)

/tmp/default/sessions/container_file_lock/4