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

datastore_search call fails in LocalCKAN mode #13

Closed
deniszgonjanin opened this issue Jan 29, 2014 · 1 comment
Closed

datastore_search call fails in LocalCKAN mode #13

deniszgonjanin opened this issue Jan 29, 2014 · 1 comment

Comments

@deniszgonjanin
Copy link

try:
local = ckanapi.LocalCKAN()
local.action.datastore_search(resource_id = '...')

same call works when RemoteCKAN() is used with a valid api key

This seems to happen when the call is executed as part of a Paste command. (example: https://github.com/deniszgonjanin/ckanext-recombinant/blob/master/ckanext/recombinant/commands.py#L31)

When running this code inside the paster shell with the full CKAN environment loaded, the same command works.

Here is a stack trace:
File "/source/virtualenv/statscan2/lib/python2.6/site-packages/ckanapi/localckan.py", line 44, in call_action
return self._get_action(action)(dict(context), dict(data_dict))
File "/source/virtualenv/statscan2/src/ckan/ckan/logic/init.py", line 329, in wrapped
return _action(context, data_dict, **kw)
File "/source/virtualenv/statscan2/src/ckan/ckan/logic/init.py", line 386, in wrapper
return action(context, data_dict)
File "/source/virtualenv/statscan2/src/ckan/ckanext/datastore/logic/action.py", line 277, in datastore_search
result = db.search(context, data_dict)
File "/source/virtualenv/statscan2/src/ckan/ckanext/datastore/db.py", line 1124, in search
return search_data(context, data_dict)
File "/source/virtualenv/statscan2/src/ckan/ckanext/datastore/db.py", line 930, in search_data
_insert_links(data_dict, limit, offset)
File "/source/virtualenv/statscan2/src/ckan/ckanext/datastore/db.py", line 837, in _insert_links
if not toolkit.request.environ:
File "/source/virtualenv/statscan2/lib/python2.6/site-packages/paste/registry.py", line 137, in getattr
return getattr(self._current_obj(), attr)
File "/source/virtualenv/statscan2/lib/python2.6/site-packages/paste/registry.py", line 197, in _current_obj
'thread' % self.__name)
TypeError: No object (name: request) has been registered for this thread

Any ideas?

@wardi
Copy link
Contributor

wardi commented Jan 29, 2014

fix for this is in ckan upstream ckan/ckan#1445 and I just pushed the fix to https://github.com/wardi/ckan/tree/canada-scheming-support as well (sorry, forgot to push earlier)

@wardi wardi closed this as completed Jan 29, 2014
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

2 participants