[ckan-dev] ckan harvest

Fabrizio Fornari ckanappoggio at gmail.com
Sat May 17 17:48:57 UTC 2014


Hi guys,

I am trying to use the ckanext-harvest (stable version) between two
instances of CKAN 2.2.

I followed the guideline at https://github.com/ckan/ckanext-harvest; I
installed the extension on one of my CKAN instances and I am using the
address of the other one as a harvest resource but I am facing an error
during the fetching that says KeyError('user',). The only thing that I did
and it's not in the guideline is to add a sysadmin called harvest because
it seems it's needed.

What can cause the error?

Below the output of fetch_consumer

Traceback (most recent call last):
  File
"/usr/lib/ckan/default/src/ckanext-harvest/ckanext/harvest/harvesters/base.py",
line 214, in _create_or_update_package
    new_package = get_action('package_create_rest')(context, package_dict)
  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
923, in package_create_rest
    dictized_after = _get_action('package_create')(context,
dictized_package)
  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
187, in package_create
    model.repo.commit()
  File
"/usr/lib/ckan/default/local/lib/python2.7/site-packages/vdm/sqlalchemy/tools.py",
line 102, in commit
    self.session.commit()
  File
"/usr/lib/ckan/default/local/lib/python2.7/site-packages/sqlalchemy/orm/scoping.py",
line 114, in do
    return getattr(self.registry(), name)(*args, **kwargs)
  File
"/usr/lib/ckan/default/local/lib/python2.7/site-packages/sqlalchemy/orm/session.py",
line 656, in commit
    self.transaction.commit()
  File
"/usr/lib/ckan/default/local/lib/python2.7/site-packages/sqlalchemy/orm/session.py",
line 314, in commit
    self._prepare_impl()
  File
"/usr/lib/ckan/default/local/lib/python2.7/site-packages/sqlalchemy/orm/session.py",
line 290, in _prepare_impl
    self.session.dispatch.before_commit(self.session)
  File
"/usr/lib/ckan/default/local/lib/python2.7/site-packages/sqlalchemy/event.py",
line 291, in __call__
    fn(*args, **kw)
  File "/usr/lib/ckan/default/src/ckan/ckan/model/extension.py", line 112,
in before_commit
    methodcaller('before_commit', session)
  File "/usr/lib/ckan/default/src/ckan/ckan/model/extension.py", line 92,
in notify_observers
    func(observer)
  File "/usr/lib/ckan/default/src/ckan/ckan/model/modification.py", line
47, in before_commit
    self.notify(obj, domain_object.DomainObjectOperation.new)
  File "/usr/lib/ckan/default/src/ckan/ckan/model/modification.py", line
79, in notify
    observer.notify(entity, operation)
  File "/usr/lib/ckan/default/src/ckan/ckanext/datapusher/plugin.py", line
103, in notify
    'resource_id': entity.id
  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/ckanext/datapusher/logic/action.py",
line 51, in datapusher_submit
    user = p.toolkit.get_action('user_show')(context, {'id':
context['user']})
KeyError: 'user'
2014-05-17 19:34:23,144 DEBUG [ckanext.harvest.harvesters.base]
KeyError('user',)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20140517/15474682/attachment-0002.html>


More information about the ckan-dev mailing list