ckan / ckanext-qa

CKAN QA Extension
MIT License
26 stars 52 forks source link

Error: The action 'qa_dataset_openness_show' is already implemented in 'qa' #30

Closed valentin0h closed 8 years ago

valentin0h commented 8 years ago

When I add single dataset into the queue and then run celeryd the work is completed fine.

However, when I add all datasets and then run paster --plugin=ckanext-archiver celeryd run --queue=bulk --config=ckan.ini

the process throws exceptions after the first batch of 8 works is completed.

The exception:

[2016-01-19 13:02:17,503: ERROR/MainProcess] Task qa.update_package[all-island-housing-tenure-sa-ead6] raised exception: Exception("The action 'qa_dataset_openness_show' is already implemented in 'qa'",)
Traceback (most recent call last):
  File "/home/co/ckan/local/lib/python2.7/site-packages/celery/execute/trace.py", line 47, in trace
    return cls(states.SUCCESS, retval=fun(*args, **kwargs))
  File "/home/co/ckan/local/lib/python2.7/site-packages/celery/app/task/__init__.py", line 247, in __call__
    return self.run(*args, **kwargs)
  File "/home/co/ckan/local/lib/python2.7/site-packages/celery/app/__init__.py", line 175, in run
    return fun(*args, **kwargs)
  File "/src/ckanext-qa/ckanext/qa/tasks.py", line 66, in update_package
    load_config(ckan_ini_filepath)
  File "/src/ckanext-qa/ckanext/qa/tasks.py", line 38, in load_config
    conf.local_conf)
  File "/src/ckan/ckan/config/environment.py", line 232, in load_environment
    p.load_all(config)
  File "/src/ckan/ckan/plugins/core.py", line 134, in load_all
    load(*plugins)
  File "/src/ckan/ckan/plugins/core.py", line 167, in load
    plugins_update()
  File "/src/ckan/ckan/plugins/core.py", line 116, in plugins_update
    environment.update_config()
  File "/src/ckan/ckan/config/environment.py", line 369, in update_config
    logic.get_action('get_site_user')({'ignore_auth': True}, None)
  File "/src/ckan/ckan/logic/__init__.py", line 394, in get_action
    resolved_action_plugins[name]
Exception: The action 'qa_dataset_openness_show' is already implemented in 'qa'

Any clues?

davidread commented 8 years ago

I wonder if this is because get_action calls get_functions() which is being too clever, somehow returning the function twice - if that's the case we could just list all the actions functions explicitly instead of calling get_functions.

However I suggest you poke about in /src/ckan/ckan/logic/__init__.py and find out why qa_dataset_openness_show is coming twice.

valentin0h commented 8 years ago

I was playing with a bespoke version of CKAN and plugin. It does not happen with vanillas. Thanks.

davidread commented 8 years ago

@valeviolin I also encountered this error today and have fixed it by getting rid of the get_functions() thing. So do update ckanext-qa (and ideally ckanext-archiver) if you have any more trouble with this issue.