Closed ted-strauss-K1 closed 3 years ago
@tedstrauss I see that the instructions to install the extension are not clear, so I added a section to the README, how to do it: https://github.com/openresearchdata/ckanext-ord-hierarchy/blob/master/README.md#installation
You need to install the extension in your virtualenv, otherwise CKAN will not recognize it. To load the virtualenv you should run source /usr/lib/ckan/default/bin/activate
. If you load the virtualenv and run the command as described in the README, the extension should finally be in the following directory in your setup: /usr/lib/ckan/default/ckanext-ord-hierarchy
Thanks. The installation steps seemed to work, but I am still getting a 500 error.
But now the error is ImportError: No module named authz
.
Is there an authz
module that needs to be enabled for this to work?
[Wed Nov 30 12:27:26 2016] [error] [client 127.0.0.1] mod_wsgi (pid=17396): Target WSGI script '/etc/ckan/default/apache.wsgi' cannot be loaded as Python module.
[Wed Nov 30 12:27:26 2016] [error] [client 127.0.0.1] mod_wsgi (pid=17396): Exception occurred processing WSGI script '/etc/ckan/default/apache.wsgi'.
[Wed Nov 30 12:27:26 2016] [error] [client 127.0.0.1] Traceback (most recent call last):
[Wed Nov 30 12:27:26 2016] [error] [client 127.0.0.1] File "/etc/ckan/default/apache.wsgi", line 10, in <module>
[Wed Nov 30 12:27:26 2016] [error] [client 127.0.0.1] application = loadapp('config:%s' % config_filepath)
[Wed Nov 30 12:27:26 2016] [error] [client 127.0.0.1] File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 247, in loadapp
[Wed Nov 30 12:27:26 2016] [error] [client 127.0.0.1] return loadobj(APP, uri, name=name, **kw)
[Wed Nov 30 12:27:26 2016] [error] [client 127.0.0.1] File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 272, in loadobj
[Wed Nov 30 12:27:26 2016] [error] [client 127.0.0.1] return context.create()
[Wed Nov 30 12:27:26 2016] [error] [client 127.0.0.1] File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 710, in create
[Wed Nov 30 12:27:26 2016] [error] [client 127.0.0.1] return self.object_type.invoke(self)
[Wed Nov 30 12:27:26 2016] [error] [client 127.0.0.1] File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 146, in invoke
[Wed Nov 30 12:27:26 2016] [error] [client 127.0.0.1] return fix_call(context.object, context.global_conf, **context.local_conf)
[Wed Nov 30 12:27:26 2016] [error] [client 127.0.0.1] File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/util.py", line 55, in fix_call
[Wed Nov 30 12:27:26 2016] [error] [client 127.0.0.1] val = callable(*args, **kw)
[Wed Nov 30 12:27:26 2016] [error] [client 127.0.0.1] File "/usr/lib/ckan/default/src/ckan/ckan/config/middleware.py", line 58, in make_app
[Wed Nov 30 12:27:26 2016] [error] [client 127.0.0.1] load_environment(conf, app_conf)
[Wed Nov 30 12:27:26 2016] [error] [client 127.0.0.1] File "/usr/lib/ckan/default/src/ckan/ckan/config/environment.py", line 232, in load_environment
[Wed Nov 30 12:27:26 2016] [error] [client 127.0.0.1] p.load_all(config)
[Wed Nov 30 12:27:26 2016] [error] [client 127.0.0.1] File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 134, in load_all
[Wed Nov 30 12:27:26 2016] [error] [client 127.0.0.1] load(*plugins)
[Wed Nov 30 12:27:26 2016] [error] [client 127.0.0.1] File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 148, in load
[Wed Nov 30 12:27:26 2016] [error] [client 127.0.0.1] service = _get_service(plugin)
[Wed Nov 30 12:27:26 2016] [error] [client 127.0.0.1] File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 253, in _get_service
[Wed Nov 30 12:27:26 2016] [error] [client 127.0.0.1] return plugin.load()(name=plugin_name)
[Wed Nov 30 12:27:26 2016] [error] [client 127.0.0.1] File "/usr/lib/ckan/default/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2355, in load
[Wed Nov 30 12:27:26 2016] [error] [client 127.0.0.1] return self.resolve()
[Wed Nov 30 12:27:26 2016] [error] [client 127.0.0.1] File "/usr/lib/ckan/default/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2361, in resolve
[Wed Nov 30 12:27:26 2016] [error] [client 127.0.0.1] module = __import__(self.module_name, fromlist=['__name__'], level=0)
[Wed Nov 30 12:27:26 2016] [error] [client 127.0.0.1] File "/usr/lib/ckan/default/src/ckanext-ord-hierarchy/ckanext/ord_hierarchy/plugin.py", line 4, in <module>
[Wed Nov 30 12:27:26 2016] [error] [client 127.0.0.1] import dbutil
[Wed Nov 30 12:27:26 2016] [error] [client 127.0.0.1] File "/usr/lib/ckan/default/src/ckanext-ord-hierarchy/ckanext/ord_hierarchy/dbutil.py", line 6, in <module>
[Wed Nov 30 12:27:26 2016] [error] [client 127.0.0.1] from ckan.model.authz import PSEUDO_USER__VISITOR
[Wed Nov 30 12:27:26 2016] [error] [client 127.0.0.1] ImportError: No module named authz
What version of CKAN are you running?
"ckan_version": "2.5.3"
OK, I see the problem. We rely on the old authz module, which was removed in CKAN 2.5 I think. We only ever used this extension with CKAN 2.2. I'll have to check how to upgrade the code.
As far as I can tell, there is just the one reference to that module, in an import. https://github.com/openresearchdata/ckanext-ord-hierarchy/blob/1c13fea556d1c3d411eeb3ddb9d47d3e84f92fe6/ckanext/ord_hierarchy/dbutil.py#L6 Will try to comment it out and re-install, to see what happens.
Hmm. Commenting that line out seems to fix the problem, since the page loads. But it has revealed another problem, Relations I have defined aren't being committed. I have filed an issue with the Relations plug-in here: https://github.com/milicp/ckanext-lire/issues/5
CKAN error log excerpt, while trying to commit a relation:
[Wed Nov 30 13:03:21 2016] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/src/ckan/ckan/logic/action/create.py', line 595 in package_relationship_create
[Wed Nov 30 13:03:21 2016] [error] [client 127.0.0.1] raise NotFound('Subject package %r was not found.' % id)
[Wed Nov 30 13:03:21 2016] [error] [client 127.0.0.1] NotFound: Subject package u'Test Dataset 01' was not found.
Might be a version issue as well?
I have previously installed the Relations extension, and it is working. I am trying to install this extension, to visualize the relations. Here are the steps I followed:
/usr/lib/ckan/default/src/ckan/ckanext/stats/public/ckanext/ckanext-ord-hierarchy
/etc/ckan/default/production.ini
withckan.plugins = ord_hierarchy [everything else]
/var/log/apache2/ckan_default.error.log
I get the output below, which finishes withPluginNotFoundException: ord_hierarchy
My question is: what string should be put in the INI file for the plugin name? And what should the folder be called that the extension lives in (if not
ckanext-ord-hierarchy
)?ckan_default.error.log