ckan / ckanext-scheming

Easy, shareable custom CKAN schemas
Other
84 stars 163 forks source link

SchemingException: Could not load ckanext.scheming:test.json #236

Open dyaw-Drexel opened 4 years ago

dyaw-Drexel commented 4 years ago

Using CKAN 2.8.3 on Ubuntu 18.04 Server in a Azure VM, there is an error that occurs anytime I try to load in a new JSON file. This error does not occur with ckan_default.json or camel_photos.json. If I attempt to change either of them, the changes are not reflected in CKAN. I did try running this as the only CKAN extension installed, and still get the same issue. I have also tried this on a fresh CKAN installation and still have the same problem. Below is the error in the logs:

[Fri Jan 24 13:32:18.729920 2020] [wsgi:error] [pid 8520:tid 139861279778560] 2020-01-24 13:32:18,729 INFO [ckan.config.environment] Loading static files from public [Fri Jan 24 13:32:18.804985 2020] [wsgi:error] [pid 8520:tid 139861279778560] 2020-01-24 13:32:18,804 INFO [ckan.config.environment] Loading templates from /usr/lib/ckan/default/src/ckan/ckan/templates [Fri Jan 24 13:32:19.440698 2020] [wsgi:error] [pid 8520:tid 139861279778560] [remote 127.0.0.1:58550] mod_wsgi (pid=8520): Target WSGI script '/etc/ckan/default/apache.wsgi' cannot be loaded as Python modu$ [Fri Jan 24 13:32:19.440731 2020] [wsgi:error] [pid 8520:tid 139861279778560] [remote 127.0.0.1:58550] mod_wsgi (pid=8520): Exception occurred processing WSGI script '/etc/ckan/default/apache.wsgi'. [Fri Jan 24 13:32:19.440753 2020] [wsgi:error] [pid 8520:tid 139861279778560] [remote 127.0.0.1:58550] Traceback (most recent call last): [Fri Jan 24 13:32:19.440768 2020] [wsgi:error] [pid 8520:tid 139861279778560] [remote 127.0.0.1:58550] File "/etc/ckan/default/apache.wsgi", line 10, in <module> [Fri Jan 24 13:32:19.440787 2020] [wsgi:error] [pid 8520:tid 139861279778560] [remote 127.0.0.1:58550] _application = loadapp('config:%s' % config_filepath) [Fri Jan 24 13:32:19.440795 2020] [wsgi:error] [pid 8520:tid 139861279778560] [remote 127.0.0.1:58550] File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 247, in loada$ [Fri Jan 24 13:32:19.440806 2020] [wsgi:error] [pid 8520:tid 139861279778560] [remote 127.0.0.1:58550] return loadobj(APP, uri, name=name, **kw) [Fri Jan 24 13:32:19.440822 2020] [wsgi:error] [pid 8520:tid 139861279778560] [remote 127.0.0.1:58550] File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 272, in loado$ [Fri Jan 24 13:32:19.440832 2020] [wsgi:error] [pid 8520:tid 139861279778560] [remote 127.0.0.1:58550] return context.create() [Fri Jan 24 13:32:19.440839 2020] [wsgi:error] [pid 8520:tid 139861279778560] [remote 127.0.0.1:58550] File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 710, in create [Fri Jan 24 13:32:19.440848 2020] [wsgi:error] [pid 8520:tid 139861279778560] [remote 127.0.0.1:58550] return self.object_type.invoke(self) [Fri Jan 24 13:32:19.440854 2020] [wsgi:error] [pid 8520:tid 139861279778560] [remote 127.0.0.1:58550] File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 146, in invoke [Fri Jan 24 13:32:19.440862 2020] [wsgi:error] [pid 8520:tid 139861279778560] [remote 127.0.0.1:58550] return fix_call(context.object, context.global_conf, **context.local_conf) [Fri Jan 24 13:32:19.440868 2020] [wsgi:error] [pid 8520:tid 139861279778560] [remote 127.0.0.1:58550] File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/util.py", line 55, in fix_call [Fri Jan 24 13:32:19.440878 2020] [wsgi:error] [pid 8520:tid 139861279778560] [remote 127.0.0.1:58550] val = callable(*args, **kw) [Fri Jan 24 13:32:19.440883 2020] [wsgi:error] [pid 8520:tid 139861279778560] [remote 127.0.0.1:58550] File "/usr/lib/ckan/default/src/ckan/ckan/config/middleware/__init__.py", line 55, in make_app [Fri Jan 24 13:32:19.440892 2020] [wsgi:error] [pid 8520:tid 139861279778560] [remote 127.0.0.1:58550] load_environment(conf, app_conf) [Fri Jan 24 13:32:19.440898 2020] [wsgi:error] [pid 8520:tid 139861279778560] [remote 127.0.0.1:58550] File "/usr/lib/ckan/default/src/ckan/ckan/config/environment.py", line 116, in load_environment [Fri Jan 24 13:32:19.440908 2020] [wsgi:error] [pid 8520:tid 139861279778560] [remote 127.0.0.1:58550] p.load_all() [Fri Jan 24 13:32:19.440913 2020] [wsgi:error] [pid 8520:tid 139861279778560] [remote 127.0.0.1:58550] File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 140, in load_all [Fri Jan 24 13:32:19.440922 2020] [wsgi:error] [pid 8520:tid 139861279778560] [remote 127.0.0.1:58550] load(*plugins) [Fri Jan 24 13:32:19.440928 2020] [wsgi:error] [pid 8520:tid 139861279778560] [remote 127.0.0.1:58550] File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 168, in load [Fri Jan 24 13:32:19.440936 2020] [wsgi:error] [pid 8520:tid 139861279778560] [remote 127.0.0.1:58550] plugins_update() [Fri Jan 24 13:32:19.440942 2020] [wsgi:error] [pid 8520:tid 139861279778560] [remote 127.0.0.1:58550] File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 122, in plugins_update [Fri Jan 24 13:32:19.440950 2020] [wsgi:error] [pid 8520:tid 139861279778560] [remote 127.0.0.1:58550] environment.update_config() [Fri Jan 24 13:32:19.440956 2020] [wsgi:error] [pid 8520:tid 139861279778560] [remote 127.0.0.1:58550] File "/usr/lib/ckan/default/src/ckan/ckan/config/environment.py", line 168, in update_config [Fri Jan 24 13:32:19.440965 2020] [wsgi:error] [pid 8520:tid 139861279778560] [remote 127.0.0.1:58550] plugin.update_config(config) [Fri Jan 24 13:32:19.440970 2020] [wsgi:error] [pid 8520:tid 139861279778560] [remote 127.0.0.1:58550] File "/usr/lib/ckan/default/lib/python2.7/site-packages/ckanext/scheming/plugins.py", line 158, in up$ [Fri Jan 24 13:32:19.440979 2020] [wsgi:error] [pid 8520:tid 139861279778560] [remote 127.0.0.1:58550] self.SCHEMA_TYPE_FIELD [Fri Jan 24 13:32:19.440985 2020] [wsgi:error] [pid 8520:tid 139861279778560] [remote 127.0.0.1:58550] File "/usr/lib/ckan/default/lib/python2.7/site-packages/ckanext/scheming/plugins.py", line 351, in _l$ [Fri Jan 24 13:32:19.440994 2020] [wsgi:error] [pid 8520:tid 139861279778560] [remote 127.0.0.1:58550] schema = _load_schema(n) [Fri Jan 24 13:32:19.441003 2020] [wsgi:error] [pid 8520:tid 139861279778560] [remote 127.0.0.1:58550] File "/usr/lib/ckan/default/lib/python2.7/site-packages/ckanext/scheming/plugins.py", line 359, in _l$ [Fri Jan 24 13:32:19.441013 2020] [wsgi:error] [pid 8520:tid 139861279778560] [remote 127.0.0.1:58550] schema = _load_schema_url(url) [Fri Jan 24 13:32:19.441018 2020] [wsgi:error] [pid 8520:tid 139861279778560] [remote 127.0.0.1:58550] File "/usr/lib/ckan/default/lib/python2.7/site-packages/ckanext/scheming/plugins.py", line 387, in _l$ [Fri Jan 24 13:32:19.441027 2020] [wsgi:error] [pid 8520:tid 139861279778560] [remote 127.0.0.1:58550] raise SchemingException("Could not load %s" % url) [Fri Jan 24 13:32:19.441042 2020] [wsgi:error] [pid 8520:tid 139861279778560] [remote 127.0.0.1:58550] SchemingException: Could not load ckanext.scheming:test.json

Aaboobacker commented 4 years ago

Try running python setup.py install on the ../ckanext-scheming folder.

This is happening because the site packages are still using the old version. The install command should rewrite it, if not try delteing it from the site packages folder and run python setup.py develop again.

mabah-mst commented 3 years ago

Another thing I would check would be rights on the json file. I have previously had the issue that when inserting the new json file it was owned by another user, for instance root. In that case you would have someting like: ckan@b7b5a846f492:/$ ls -lart /usr/lib/ckan/venv/src/ckanext-scheming/ckanext/scheming/*.json ... -rw-r--r-- 1 root root 507 Oct 21 12:40 /usr/lib/ckan/venv/src/ckanext-scheming/ckanext/scheming/own_schema.json -rw-r--r-- 1 ckan ckan 2410 Oct 21 12:40 /usr/lib/ckan/venv/src/ckanext-scheming/ckanext/scheming/camel_photos.json -rw-r--r-- 1 ckan ckan 15113 Oct 27 11:31 /usr/lib/ckan/venv/src/ckanext-scheming/ckanext/scheming/ckan_dataset.json

In this case the solution would be to change the user and groud owning the file using the chown and chgrp commands. You might similarly discover that the owner and group is the same as for ckan_dataset.json, but the rights themselves are different - in that case change those rights using chmod.