Ammar Majeed
Ammar Majeed

Reputation: 75

Can't follow an organization in ckan

I setup ckan from source from the latest docs. When a user tries to follow an organization the following error appears on the interface in my browser:

404 Not Found

The resource could not be found.

Incorrect group type

When I run the site using the "paster serve /etc/ckan/default/development.ini" command in my virtualenv I get the following error on my site when following an organization:

"Server Error

An internal server error occurred"

And I get the following traceback on my terminal:

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'

Please help.

Upvotes: 1

Views: 544

Answers (2)

Vithal Alapati
Vithal Alapati

Reputation: 61

It's purely directory permissions

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

Make sure the permissions are like this.

Also, make sure you have correct user and group permissions on this directory(recursively)

/tmp/default/sessions/container_file_lock/4

Upvotes: 0

D Read
D Read

Reputation: 3224

The exception is saying that it's failing to create a directory due to file permissions. Try the same thing on the command-line:

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

Assuming that fails too, then you have two options:

  1. change your file permissions to allow writes to /tmp
  2. tell CKAN to store its beaker sessions elsewhere where it can write. The relevant CKAN configuration option is: cache_dir.

Upvotes: 3

Related Questions