Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSError: [Errno 13] Permission denied: '/var/lib/ckan/storage/uploads' #3676

Closed
dassolkim opened this issue Jul 10, 2017 · 2 comments
Closed

Comments

@dassolkim
Copy link

dassolkim commented Jul 10, 2017

I installed ckan latest version from source and using tomcat7 instead of jetty.
but, When I tried to add a new organization, I got this error. There was an internal server error on the web, and this error occurred when I looked at the logs.

_
Error - <type 'exceptions.OSError'>: [Errno 13] Permission denied: '/var/lib/ckan/storage/uploads'
URL: http://114.70.235.44:5000/organization/new
File '/usr/local/lib/python2.7/dist-packages/weberror/errormiddleware.py', line 171 in call
app_iter = self.application(environ, sr_checker)
File '/usr/local/lib/python2.7/dist-packages/webob/dec.py', line 147 in call
resp = self.call_func(req, *args, **self.kwargs)
File '/usr/local/lib/python2.7/dist-packages/webob/dec.py', line 208 in call_func
return self.func(req, *args, **kwargs)
File '/usr/local/lib/python2.7/dist-packages/fanstatic/publisher.py', line 234 in call
return request.get_response(self.app)
File '/usr/local/lib/python2.7/dist-packages/webob/request.py', line 1053 in get_response
application, catch_exc_info=False)
File '/usr/local/lib/python2.7/dist-packages/webob/request.py', line 1022 in call_application
app_iter = application(self.environ, start_response)
File '/usr/local/lib/python2.7/dist-packages/webob/dec.py', line 147 in call
resp = self.call_func(req, *args, **self.kwargs)
File '/usr/local/lib/python2.7/dist-packages/webob/dec.py', line 208 in call_func
return self.func(req, *args, **kwargs)
File '/usr/local/lib/python2.7/dist-packages/fanstatic/injector.py', line 54 in call
response = request.get_response(self.app)
File '/usr/local/lib/python2.7/dist-packages/webob/request.py', line 1053 in get_response
application, catch_exc_info=False)
File '/usr/local/lib/python2.7/dist-packages/webob/request.py', line 1022 in call_application
app_iter = application(self.environ, start_response)
File '/home/ckan/ckan/lib/default/src/ckan/ckan/config/middleware/pylons_app.py', line 243 in inner
result = application(environ, start_response)
File '/usr/local/lib/python2.7/dist-packages/beaker/middleware.py', line 73 in call
return self.app(environ, start_response)
File '/usr/local/lib/python2.7/dist-packages/beaker/middleware.py', line 156 in call
return self.wrap_app(environ, session_start_response)
File '/usr/local/lib/python2.7/dist-packages/routes/middleware.py', line 131 in call
response = self.app(environ, start_response)
File '/home/ckan/ckan/lib/default/src/ckan/ckan/config/middleware/common_middleware.py', line 28 in call
return self.app(environ, start_response)
File '/usr/local/lib/python2.7/dist-packages/pylons/wsgiapp.py', line 125 in call
response = self.dispatch(controller, environ, start_response)
File '/usr/local/lib/python2.7/dist-packages/pylons/wsgiapp.py', line 324 in dispatch
return controller(environ, start_response)
File '/home/ckan/ckan/lib/default/src/ckan/ckan/lib/base.py', line 211 in call
res = WSGIController.call(self, environ, start_response)
File '/usr/local/lib/python2.7/dist-packages/pylons/controllers/core.py', line 221 in call
response = self._dispatch_call()
File '/usr/local/lib/python2.7/dist-packages/pylons/controllers/core.py', line 172 in _dispatch_call
response = self._inspect_call(func)
File '/usr/local/lib/python2.7/dist-packages/pylons/controllers/core.py', line 107 in _inspect_call
result = self._perform_call(func, args)
File '/usr/local/lib/python2.7/dist-packages/pylons/controllers/core.py', line 60 in _perform_call
return func(**args)
File '/home/ckan/ckan/lib/default/src/ckan/ckan/controllers/group.py', line 473 in new
return self._save_new(context, group_type)
File '/home/ckan/ckan/lib/default/src/ckan/ckan/controllers/group.py', line 541 in _save_new
group = self._action('group_create')(context, data_dict)
File '/home/ckan/ckan/lib/default/src/ckan/ckan/logic/init.py', line 457 in wrapped
result = _action(context, data_dict, **kw)
File '/home/ckan/ckan/lib/default/src/ckan/ckan/logic/action/create.py', line 868 in organization_create
return _group_or_org_create(context, data_dict, is_org=True)
File '/home/ckan/ckan/lib/default/src/ckan/ckan/logic/action/create.py', line 631 in _group_or_org_create
upload = uploader.get_uploader('group')
File '/home/ckan/ckan/lib/default/src/ckan/ckan/lib/uploader.py', line 31 in get_uploader
upload = Upload(upload_to, old_filename)
File '/home/ckan/ckan/lib/default/src/ckan/ckan/lib/uploader.py', line 107 in init
os.makedirs(self.storage_path)
File '/usr/lib/python2.7/os.py', line 150 in makedirs
makedirs(head, mode)
File '/usr/lib/python2.7/os.py', line 157 in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/var/lib/ckan/storage/uploads'
_

I don't know why this error occured. I already tried

sudo chown -R www-data /var/lib/ckan
sudo chmod -R u+rwx /var/lib/ckan

but, nothing was fixed. I think this is a problem with file uploads, but I already set up the guide as well please help me solve this error..

@smotornyuk
Copy link
Member

@dassolkim , are you running CKAN using apache? If not(i.e. you are using paster serve ..., then you need to change owner of /var/lib/ckan to you current user

@dassolkim
Copy link
Author

@smotornyuk thank you for your advice!!!!

roc added a commit to nhsx/standards-registry that referenced this issue Apr 12, 2022
* dataset updates currently failing with `PermissionError: [Errno 13] Permission denied: '/var/lib/ckan'`
* Give ckan perms whilst still root
* See ckan/ckan#3676 for more
roc added a commit to nhsx/standards-registry that referenced this issue Apr 12, 2022
* dataset updates currently failing with `PermissionError: [Errno 13] Permission denied: '/var/lib/ckan'`
* Give ckan perms whilst still root
* See ckan/ckan#3676 for more
roc added a commit to nhsx/standards-registry that referenced this issue Apr 12, 2022
* dataset updates currently failing with `PermissionError: [Errno 13] Permission denied: '/var/lib/ckan'`
* Give ckan perms whilst still root
* See ckan/ckan#3676 for more
roc added a commit to nhsx/standards-registry that referenced this issue Apr 12, 2022
* dataset updates currently failing with `PermissionError: [Errno 13] Permission denied: '/var/lib/ckan'`
* Give ckan perms whilst still root
* See ckan/ckan#3676 for more
roc added a commit to nhsx/standards-registry that referenced this issue May 17, 2022
* dataset updates currently failing with `PermissionError: [Errno 13] Permission denied: '/var/lib/ckan'`
* Give ckan perms whilst still root
* See ckan/ckan#3676 for more
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants