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

Unable to add plug-in to CKAN instance #59

Closed
tpgmartin opened this issue Jun 1, 2022 · 4 comments
Closed

Unable to add plug-in to CKAN instance #59

tpgmartin opened this issue Jun 1, 2022 · 4 comments

Comments

@tpgmartin
Copy link

Overview

I'm trying to add the ckanext-validation plug-in to my CKAN instance, which is running on EC2 Ubuntu 18.02 instance. I have followed the instructions to install and deploy CKAN from source, version 2.9.5. I've installed the plug-in following the instructions in the readme, but after I add the plugin "validation" to ckan.ini config file I get the following error:

Traceback (most recent call last):
  File "/usr/lib/ckan/default/src/ckan/wsgi.py", line 15, in <module>
    raise RuntimeError(u'CKAN config option not found: {}'.format(config_path))
RuntimeError: CKAN config option not found: /usr/lib/ckan/default/src/ckan/ckan.ini
unable to load app 0 (mountpoint='') (callable not found or import error)
2022-06-01 08:01:07,090 INFO  [ckan.config.environment] Loading static files from public
2022-06-01 08:01:07,194 INFO  [ckan.config.environment] Loading templates from /usr/lib/ckan/default/src/ckan/ckan/templates
Traceback (most recent call last):
  File "/etc/ckan/default/wsgi.py", line 20, in <module>
    application = make_app(config)
  File "/usr/lib/ckan/default/src/ckan/ckan/config/middleware/__init__.py", line 56, in make_app
    load_environment(conf)
  File "/usr/lib/ckan/default/src/ckan/ckan/config/environment.py", line 123, in load_environment
    p.load_all()
  File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 165, in load_all
    load(*plugins)
  File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 179, in load
    service = _get_service(plugin)
  File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 281, in _get_service
    return plugin.load()(name=plugin_name)
  File "/usr/lib/ckan/default/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2443, in load
    return self.resolve()
  File "/usr/lib/ckan/default/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2449, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/ckan/default/src/ckanext-validation/ckanext/validation/plugin.py", line 12, in <module>
    from ckanext.validation.logic import (
  File "/usr/lib/ckan/default/src/ckanext-validation/ckanext/validation/logic.py", line 470
    except t.ValidationError, e:
                            ^
SyntaxError: invalid syntax
unable to load app 0 (mountpoint='') (callable not found or import error)

This error is only raised if I include the "validation" plug-in in the ckan.plugins config options.

I've added by the ckanext-validation and ckanext-scheming plug-ins and included these in the ckan.ini file as named plug-ins, I've also added the following to my ckan.ini file as per the readme,

scheming.dataset_schemas = ckanext.validation.examples:ckan_default_schema.json
scheming.presets = ckanext.scheming:presets.json
	               ckanext.validation:presets.json

Is this a consequence of where the ckanext-validaton and ckanext-scheming plugins are installed? If I install with pip by default they are installed to /usr/lib/ckan/default/src not /usr/lib/ckan/default/src/ckan/ckanext as is usual for other plug-ins.


Please preserve this line to notify @amercader (lead of this repository)

@amercader
Copy link
Member

Unfortunately ckanext-validation hasn't been updated to work on CKAN 2.9 / Python 3 yet. All these errors arise from that issue, sorry about that

@tpgmartin
Copy link
Author

@amercader many thanks for your reply, are the required changes relatively straightforward? If so, could you please advise what I'd need to change? Cheers

@amercader
Copy link
Member

@tpgmartin see #61

@ThrawnCA
Copy link
Contributor

@tpgmartin The keitaroinc/ckanext-validation and qld-gov-au/ckanext-validation forks have Python 3 support.

JVickery-TBS pushed a commit to JVickery-TBS/ckanext-validation that referenced this issue Jul 23, 2024
[QOLDEV-833] adjust source installation requirements
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