[ckan-dev] CKAN 2.2.2 errors when creating datasets and resources
Milica Knezevic
knezevic.milica at gmail.com
Mon Mar 9 16:05:07 UTC 2015
Hi,
I've upgraded my CKAN instance from 2.2.1 to 2.2.2 and since then it is not
possible to add new resources neither to existing datasets, nor by creating
new datasets. I've tried with both file upload and linking to remote
objects, it doesn't work. I've tested the UI and the API and here is what
happens:
1. package_create is successful and calling
package_show?id=<newly_created_package_name> returns info about the newly
created package (dataset). But when trying to access this package via web
UI, I get Internal server error and here's the log:
URL: <<my-server>>/ckan/dataset/<newly_created_package_name>
File '/usr/lib/ckan/default/lib/python2.6/site-packages/weberror/errormiddleware.py',
line 162 in __call__
app_iter = self.application(environ, sr_checker)
File '/usr/lib/ckan/default/lib/python2.6/site-packages/webob/dec.py',
line 147 in __call__
resp = self.call_func(req, *args, **self.kwargs)
File '/usr/lib/ckan/default/lib/python2.6/site-packages/webob/dec.py',
line 208 in call_func
return self.func(req, *args, **kwargs)
File '/usr/lib/ckan/default/lib/python2.6/site-packages/fanstatic/publisher.py',
line 234 in __call__
return request.get_response(self.app)
File '/usr/lib/ckan/default/lib/python2.6/site-packages/webob/request.py',
line 1053 in get_response
application, catch_exc_info=False)
File '/usr/lib/ckan/default/lib/python2.6/site-packages/webob/request.py',
line 1022 in call_application
app_iter = application(self.environ, start_response)
File '/usr/lib/ckan/default/lib/python2.6/site-packages/webob/dec.py',
line 147 in __call__
resp = self.call_func(req, *args, **self.kwargs)
File '/usr/lib/ckan/default/lib/python2.6/site-packages/webob/dec.py',
line 208 in call_func
return self.func(req, *args, **kwargs)
File '/usr/lib/ckan/default/lib/python2.6/site-packages/fanstatic/injector.py',
line 54 in __call__
response = request.get_response(self.app)
File '/usr/lib/ckan/default/lib/python2.6/site-packages/webob/request.py',
line 1053 in get_response
application, catch_exc_info=False)
File '/usr/lib/ckan/default/lib/python2.6/site-packages/webob/request.py',
line 1022 in call_application
app_iter = application(self.environ, start_response)
File '/usr/lib/ckan/default/lib/python2.6/site-packages/beaker/middleware.py',
line 73 in __call__
return self.app(environ, start_response)
File '/usr/lib/ckan/default/lib/python2.6/site-packages/beaker/middleware.py',
line 155 in __call__
return self.wrap_app(environ, session_start_response)
File '/usr/lib/ckan/default/lib/python2.6/site-packages/routes/middleware.py',
line 131 in __call__
response = self.app(environ, start_response)
File '/usr/lib/ckan/default/lib/python2.6/site-packages/pylons/wsgiapp.py',
line 125 in __call__
response = self.dispatch(controller, environ, start_response)
File '/usr/lib/ckan/default/lib/python2.6/site-packages/pylons/wsgiapp.py',
line 324 in dispatch
return controller(environ, start_response)
File '/usr/lib/ckan/default/src/ckan/ckan/lib/base.py', line 346 in __call__
res = WSGIController.__call__(self, environ, start_response)
File '/usr/lib/ckan/default/lib/python2.6/site-packages/pylons/controllers/core.py',
line 221 in __call__
response = self._dispatch_call()
File '/usr/lib/ckan/default/lib/python2.6/site-packages/pylons/controllers/core.py',
line 172 in _dispatch_call
response = self._inspect_call(func)
File '/usr/lib/ckan/default/lib/python2.6/site-packages/pylons/controllers/core.py',
line 107 in _inspect_call
result = self._perform_call(func, args)
File '/usr/lib/ckan/default/lib/python2.6/site-packages/pylons/controllers/core.py',
line 60 in _perform_call
return func(**args)
File '/usr/lib/ckan/default/src/ckan/ckan/controllers/package.py',
line 403 in read
return render(template, loader_class=loader)
File '/usr/lib/ckan/default/src/ckan/ckan/lib/base.py', line 224 in render
loader_class=loader_class)
File '/usr/lib/ckan/default/lib/python2.6/site-packages/pylons/templating.py',
line 249 in cached_template
return render_func()
File '/usr/lib/ckan/default/src/ckan/ckan/lib/base.py', line 161 in
render_template
return render_jinja2(template_name, globs)
File '/usr/lib/ckan/default/src/ckan/ckan/lib/base.py', line 104 in
render_jinja2
return template.render(**extra_vars)
File '/usr/lib/ckan/default/lib/python2.6/site-packages/jinja2/environment.py',
line 894 in render
return self.environment.handle_exception(exc_info, True)
File '/usr/lib/ckan/default/src/ckan/ckan/templates/package/read.html',
line 3 in top-level template code
{% set pkg = c.pkg_dict %}
File '/usr/lib/ckan/default/src/ckan/ckan/templates/package/read_base.html',
line 1 in top-level template code
{% extends "package/base.html" %}
File '/usr/lib/ckan/default/src/ckan/ckan/templates/package/base.html',
line 3 in top-level template code
{% set pkg = c.pkg_dict or pkg_dict %}
File '/usr/lib/ckan/default/src/ckan/ckan/templates/page.html', line 1
in top-level template code
{% extends "base.html" %}
File '/usr/lib/ckan/default/src/ckan/ckan/templates/base.html', line
102 in top-level template code
{%- block page %}{% endblock -%}
File '/usr/lib/ckan/default/src/ckan/ckan/templates/page.html', line
15 in block "page"
{%- block content %}
File '/usr/lib/ckan/default/src/ckan/ckan/templates/page.html', line
18 in block "content"
{% block main_content %}
File '/usr/lib/ckan/default/src/ckan/ckan/templates/page.html', line
52 in block "main_content"
{% block primary %}
File '/usr/lib/ckan/default/src/ckan/ckan/templates/page.html', line
65 in block "primary"
{% block primary_content %}
File '/usr/lib/ckan/default/src/ckan/ckan/templates/page.html', line
85 in block "primary_content"
{% block primary_content_inner %}
File '/usr/lib/ckan/default/src/ckan/ckan/templates/package/read.html',
line 33 in block "primary_content_inner"
{% block package_resources %}
File '/usr/lib/ckan/default/src/ckan/ckan/templates/package/read.html',
line 34 in block "package_resources"
{% snippet "package/snippets/resources_list.html", pkg=pkg,
resources=pkg.resources %}
File '/usr/lib/ckan/default/src/ckan/ckan/lib/jinja_extensions.py',
line 255 in _call
return base.render_snippet(args[0], **kwargs)
File '/usr/lib/ckan/default/src/ckan/ckan/lib/base.py', line 79 in
render_snippet
renderer='snippet')
File '/usr/lib/ckan/default/src/ckan/ckan/lib/base.py', line 224 in render
loader_class=loader_class)
File '/usr/lib/ckan/default/lib/python2.6/site-packages/pylons/templating.py',
line 249 in cached_template
return render_func()
File '/usr/lib/ckan/default/src/ckan/ckan/lib/base.py', line 161 in
render_template
return render_jinja2(template_name, globs)
File '/usr/lib/ckan/default/src/ckan/ckan/lib/base.py', line 104 in
render_jinja2
return template.render(**extra_vars)
File '/usr/lib/ckan/default/lib/python2.6/site-packages/jinja2/environment.py',
line 894 in render
return self.environment.handle_exception(exc_info, True)
File '/usr/lib/ckan/default/src/ckan/ckan/templates/package/snippets/resources_list.html',
line 14 in top-level template code
{% block resource_list %}
File '/usr/lib/ckan/default/src/ckan/ckan/templates/package/snippets/resources_list.html',
line 24 in block "resource_list"
{% if h.check_access('resource_create', pkg) %}
File '/usr/lib/ckan/default/src/ckan/ckan/lib/helpers.py', line 727 in
check_access
logic.check_access(action, context, data_dict)
File '/usr/lib/ckan/default/src/ckan/ckan/logic/__init__.py', line 287
in check_access
logic_authorization = new_authz.is_authorized(action, context, data_dict)
File '/usr/lib/ckan/default/src/ckan/ckan/new_authz.py', line 187 in
is_authorized
return auth_function(context, data_dict)
File '/usr/lib/ckan/default/src/ckan/ckan/logic/auth/create.py', line
71 in resource_create
resource = logic_auth.get_resource_object(context, data_dict)
File '/usr/lib/ckan/default/src/ckan/ckan/logic/auth/__init__.py',
line 38 in get_resource_object
return _get_object(context, data_dict, 'resource', 'Resource')
File '/usr/lib/ckan/default/src/ckan/ckan/logic/auth/__init__.py',
line 23 in _get_object
raise logic.NotFound
NotFound:
2. resource_add returns Internal server error and here's the log:
URL: <my-server>/ckan/api/3/action/resource_create
File '/usr/lib/ckan/default/lib/python2.6/site-packages/weberror/errormiddleware.py',
line 162 in __call__
app_iter = self.application(environ, sr_checker)
File '/usr/lib/ckan/default/lib/python2.6/site-packages/webob/dec.py',
line 147 in __call__
resp = self.call_func(req, *args, **self.kwargs)
File '/usr/lib/ckan/default/lib/python2.6/site-packages/webob/dec.py',
line 208 in call_func
return self.func(req, *args, **kwargs)
File '/usr/lib/ckan/default/lib/python2.6/site-packages/fanstatic/publisher.py',
line 234 in __call__
return request.get_response(self.app)
File '/usr/lib/ckan/default/lib/python2.6/site-packages/webob/request.py',
line 1053 in get_response
application, catch_exc_info=False)
File '/usr/lib/ckan/default/lib/python2.6/site-packages/webob/request.py',
line 1022 in call_application
app_iter = application(self.environ, start_response)
File '/usr/lib/ckan/default/lib/python2.6/site-packages/webob/dec.py',
line 147 in __call__
resp = self.call_func(req, *args, **self.kwargs)
File '/usr/lib/ckan/default/lib/python2.6/site-packages/webob/dec.py',
line 208 in call_func
return self.func(req, *args, **kwargs)
File '/usr/lib/ckan/default/lib/python2.6/site-packages/fanstatic/injector.py',
line 54 in __call__
response = request.get_response(self.app)
File '/usr/lib/ckan/default/lib/python2.6/site-packages/webob/request.py',
line 1053 in get_response
application, catch_exc_info=False)
File '/usr/lib/ckan/default/lib/python2.6/site-packages/webob/request.py',
line 1022 in call_application
app_iter = application(self.environ, start_response)
File '/usr/lib/ckan/default/lib/python2.6/site-packages/beaker/middleware.py',
line 73 in __call__
return self.app(environ, start_response)
File '/usr/lib/ckan/default/lib/python2.6/site-packages/beaker/middleware.py',
line 155 in __call__
return self.wrap_app(environ, session_start_response)
File '/usr/lib/ckan/default/lib/python2.6/site-packages/routes/middleware.py',
line 131 in __call__
response = self.app(environ, start_response)
File '/usr/lib/ckan/default/lib/python2.6/site-packages/pylons/wsgiapp.py',
line 125 in __call__
response = self.dispatch(controller, environ, start_response)
File '/usr/lib/ckan/default/lib/python2.6/site-packages/pylons/wsgiapp.py',
line 324 in dispatch
return controller(environ, start_response)
File '/usr/lib/ckan/default/src/ckan/ckan/controllers/api.py', line 70
in __call__
return base.BaseController.__call__(self, environ, start_response)
File '/usr/lib/ckan/default/src/ckan/ckan/lib/base.py', line 346 in __call__
res = WSGIController.__call__(self, environ, start_response)
File '/usr/lib/ckan/default/lib/python2.6/site-packages/pylons/controllers/core.py',
line 221 in __call__
response = self._dispatch_call()
File '/usr/lib/ckan/default/lib/python2.6/site-packages/pylons/controllers/core.py',
line 172 in _dispatch_call
response = self._inspect_call(func)
File '/usr/lib/ckan/default/lib/python2.6/site-packages/pylons/controllers/core.py',
line 107 in _inspect_call
result = self._perform_call(func, args)
File '/usr/lib/ckan/default/lib/python2.6/site-packages/pylons/controllers/core.py',
line 60 in _perform_call
return func(**args)
File '/usr/lib/ckan/default/src/ckan/ckan/controllers/api.py', line
189 in action
result = function(context, request_data)
File '/usr/lib/ckan/default/src/ckan/ckan/logic/__init__.py', line 419
in wrapped
result = _action(context, data_dict, **kw)
File '/usr/lib/ckan/default/src/ckan/ckan/logic/action/create.py',
line 278 in resource_create
model.repo.commit()
File '/usr/lib/ckan/default/lib/python2.6/site-packages/vdm/sqlalchemy/tools.py',
line 102 in commit
self.session.commit()
File '/usr/lib/ckan/default/lib/python2.6/site-packages/sqlalchemy/orm/scoping.py',
line 114 in do
return getattr(self.registry(), name)(*args, **kwargs)
File '/usr/lib/ckan/default/lib/python2.6/site-packages/sqlalchemy/orm/session.py',
line 656 in commit
self.transaction.commit()
File '/usr/lib/ckan/default/lib/python2.6/site-packages/sqlalchemy/orm/session.py',
line 314 in commit
self._prepare_impl()
File '/usr/lib/ckan/default/lib/python2.6/site-packages/sqlalchemy/orm/session.py',
line 290 in _prepare_impl
self.session.dispatch.before_commit(self.session)
File '/usr/lib/ckan/default/lib/python2.6/site-packages/sqlalchemy/event.py',
line 291 in __call__
fn(*args, **kw)
File '/usr/lib/ckan/default/src/ckan/ckan/model/meta.py', line 93 in
before_commit
if 'pending' not in obj.state:
TypeError: argument of type 'NoneType' is not iterable
Thanks in advance,
Milica
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20150309/9a830806/attachment-0002.html>
More information about the ckan-dev
mailing list