ckan / ckanext-dcat

CKAN ♥ DCAT
163 stars 142 forks source link

Internal Server Error #126

Closed ghost closed 5 years ago

ghost commented 5 years ago

Hello,

I strictly followed the installation process, however, the dcat plugin causes an error 500 on my server (Internal Server Error). This error appears when I add the dcat plugin to the ckan.plugins. Others plugins dcat_rdf_harvester dcat_json_harvester dcat_json_interface structured_data do not cause error.

Ckan configuration python-ckan_2.7-trusty_amd64 (installed from package) on Ubuntu 14.04

ckan_default.error.log

[Thu Jul 26 14:23:50.940397 2018] [:error] [pid 3361:tid 140708457158400] [remote 127.0.0.1:6198] mod_wsgi (pid=3361): Target WSGI script '/etc/ckan/default/apache.wsgi' cannot be loaded as Python module.
[Thu Jul 26 14:23:50.940438 2018] [:error] [pid 3361:tid 140708457158400] [remote 127.0.0.1:6198] mod_wsgi (pid=3361): Exception occurred processing WSGI script '/etc/ckan/default/apache.wsgi'.
[Thu Jul 26 14:23:50.940460 2018] [:error] [pid 3361:tid 140708457158400] [remote 127.0.0.1:6198] Traceback (most recent call last):
[Thu Jul 26 14:23:50.940481 2018] [:error] [pid 3361:tid 140708457158400] [remote 127.0.0.1:6198]   File "/etc/ckan/default/apache.wsgi", line 10, in <module>
[Thu Jul 26 14:23:50.940507 2018] [:error] [pid 3361:tid 140708457158400] [remote 127.0.0.1:6198]     application = loadapp('config:%s' % config_filepath)
[Thu Jul 26 14:23:50.940513 2018] [:error] [pid 3361:tid 140708457158400] [remote 127.0.0.1:6198]   File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 247, in loadapp
[Thu Jul 26 14:23:50.940528 2018] [:error] [pid 3361:tid 140708457158400] [remote 127.0.0.1:6198]     return loadobj(APP, uri, name=name, **kw)
[Thu Jul 26 14:23:50.940533 2018] [:error] [pid 3361:tid 140708457158400] [remote 127.0.0.1:6198]   File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 272, in loadobj
[Thu Jul 26 14:23:50.940541 2018] [:error] [pid 3361:tid 140708457158400] [remote 127.0.0.1:6198]     return context.create()
[Thu Jul 26 14:23:50.940545 2018] [:error] [pid 3361:tid 140708457158400] [remote 127.0.0.1:6198]   File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 710, in create
[Thu Jul 26 14:23:50.940553 2018] [:error] [pid 3361:tid 140708457158400] [remote 127.0.0.1:6198]     return self.object_type.invoke(self)
[Thu Jul 26 14:23:50.940557 2018] [:error] [pid 3361:tid 140708457158400] [remote 127.0.0.1:6198]   File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 146, in invoke
[Thu Jul 26 14:23:50.940565 2018] [:error] [pid 3361:tid 140708457158400] [remote 127.0.0.1:6198]     return fix_call(context.object, context.global_conf, **context.local_conf)
[Thu Jul 26 14:23:50.940570 2018] [:error] [pid 3361:tid 140708457158400] [remote 127.0.0.1:6198]   File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/util.py", line 55, in fix_call
[Thu Jul 26 14:23:50.940579 2018] [:error] [pid 3361:tid 140708457158400] [remote 127.0.0.1:6198]     val = callable(*args, **kw)
[Thu Jul 26 14:23:50.940584 2018] [:error] [pid 3361:tid 140708457158400] [remote 127.0.0.1:6198]   File "/usr/lib/ckan/default/src/ckan/ckan/config/middleware/__init__.py", line 46, in make_app
[Thu Jul 26 14:23:50.940594 2018] [:error] [pid 3361:tid 140708457158400] [remote 127.0.0.1:6198]     load_environment(conf, app_conf)
[Thu Jul 26 14:23:50.940614 2018] [:error] [pid 3361:tid 140708457158400] [remote 127.0.0.1:6198]   File "/usr/lib/ckan/default/src/ckan/ckan/config/environment.py", line 114, in load_environment
[Thu Jul 26 14:23:50.940626 2018] [:error] [pid 3361:tid 140708457158400] [remote 127.0.0.1:6198]     build_js_translations()
[Thu Jul 26 14:23:50.940631 2018] [:error] [pid 3361:tid 140708457158400] [remote 127.0.0.1:6198]   File "/usr/lib/ckan/default/src/ckan/ckan/lib/i18n.py", line 405, in build_js_translations
[Thu Jul 26 14:23:50.940640 2018] [:error] [pid 3361:tid 140708457158400] [remote 127.0.0.1:6198]     _build_js_translation(lang, po_files, js_entries, dest_file)
[Thu Jul 26 14:23:50.940645 2018] [:error] [pid 3361:tid 140708457158400] [remote 127.0.0.1:6198]   File "/usr/lib/ckan/default/src/ckan/ckan/lib/i18n.py", line 345, in _build_js_translation
[Thu Jul 26 14:23:50.940652 2018] [:error] [pid 3361:tid 140708457158400] [remote 127.0.0.1:6198]     with open(dest_filename, u'w') as f:
[Thu Jul 26 14:23:50.940669 2018] [:error] [pid 3361:tid 140708457158400] [remote 127.0.0.1:6198] IOError: [Errno 13] Permission denied: u'/usr/lib/ckan/default/src/ckan/ckan/public/base/i18n/ca.js'
[Thu Jul 26 14:23:51.770353 2018] [:error] [pid 3360:tid 140708431955712] [remote 127.0.0.1:6198] mod_wsgi (pid=3360): Target WSGI script '/etc/ckan/default/apache.wsgi' cannot be loaded as Python module.
[Thu Jul 26 14:23:51.770395 2018] [:error] [pid 3360:tid 140708431955712] [remote 127.0.0.1:6198] mod_wsgi (pid=3360): Exception occurred processing WSGI script '/etc/ckan/default/apache.wsgi'.
[Thu Jul 26 14:23:51.770416 2018] [:error] [pid 3360:tid 140708431955712] [remote 127.0.0.1:6198] Traceback (most recent call last):
[Thu Jul 26 14:23:51.770440 2018] [:error] [pid 3360:tid 140708431955712] [remote 127.0.0.1:6198]   File "/etc/ckan/default/apache.wsgi", line 10, in <module>
[Thu Jul 26 14:23:51.770466 2018] [:error] [pid 3360:tid 140708431955712] [remote 127.0.0.1:6198]     application = loadapp('config:%s' % config_filepath)
[Thu Jul 26 14:23:51.770474 2018] [:error] [pid 3360:tid 140708431955712] [remote 127.0.0.1:6198]   File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 247, in loadapp
[Thu Jul 26 14:23:51.770488 2018] [:error] [pid 3360:tid 140708431955712] [remote 127.0.0.1:6198]     return loadobj(APP, uri, name=name, **kw)
[Thu Jul 26 14:23:51.770493 2018] [:error] [pid 3360:tid 140708431955712] [remote 127.0.0.1:6198]   File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 272, in loadobj
[Thu Jul 26 14:23:51.770501 2018] [:error] [pid 3360:tid 140708431955712] [remote 127.0.0.1:6198]     return context.create()
[Thu Jul 26 14:23:51.770505 2018] [:error] [pid 3360:tid 140708431955712] [remote 127.0.0.1:6198]   File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 710, in create
[Thu Jul 26 14:23:51.770513 2018] [:error] [pid 3360:tid 140708431955712] [remote 127.0.0.1:6198]     return self.object_type.invoke(self)
[Thu Jul 26 14:23:51.770517 2018] [:error] [pid 3360:tid 140708431955712] [remote 127.0.0.1:6198]   File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 146, in invoke
[Thu Jul 26 14:23:51.770524 2018] [:error] [pid 3360:tid 140708431955712] [remote 127.0.0.1:6198]     return fix_call(context.object, context.global_conf, **context.local_conf)
[Thu Jul 26 14:23:51.770529 2018] [:error] [pid 3360:tid 140708431955712] [remote 127.0.0.1:6198]   File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/util.py", line 55, in fix_call
[Thu Jul 26 14:23:51.770537 2018] [:error] [pid 3360:tid 140708431955712] [remote 127.0.0.1:6198]     val = callable(*args, **kw)
[Thu Jul 26 14:23:51.770542 2018] [:error] [pid 3360:tid 140708431955712] [remote 127.0.0.1:6198]   File "/usr/lib/ckan/default/src/ckan/ckan/config/middleware/__init__.py", line 46, in make_app
[Thu Jul 26 14:23:51.770553 2018] [:error] [pid 3360:tid 140708431955712] [remote 127.0.0.1:6198]     load_environment(conf, app_conf)
[Thu Jul 26 14:23:51.770572 2018] [:error] [pid 3360:tid 140708431955712] [remote 127.0.0.1:6198]   File "/usr/lib/ckan/default/src/ckan/ckan/config/environment.py", line 114, in load_environment
[Thu Jul 26 14:23:51.770582 2018] [:error] [pid 3360:tid 140708431955712] [remote 127.0.0.1:6198]     build_js_translations()
[Thu Jul 26 14:23:51.770586 2018] [:error] [pid 3360:tid 140708431955712] [remote 127.0.0.1:6198]   File "/usr/lib/ckan/default/src/ckan/ckan/lib/i18n.py", line 405, in build_js_translations
[Thu Jul 26 14:23:51.770596 2018] [:error] [pid 3360:tid 140708431955712] [remote 127.0.0.1:6198]     _build_js_translation(lang, po_files, js_entries, dest_file)
[Thu Jul 26 14:23:51.770600 2018] [:error] [pid 3360:tid 140708431955712] [remote 127.0.0.1:6198]   File "/usr/lib/ckan/default/src/ckan/ckan/lib/i18n.py", line 345, in _build_js_translation
[Thu Jul 26 14:23:51.770607 2018] [:error] [pid 3360:tid 140708431955712] [remote 127.0.0.1:6198]     with open(dest_filename, u'w') as f:
[Thu Jul 26 14:23:51.770625 2018] [:error] [pid 3360:tid 140708431955712] [remote 127.0.0.1:6198] IOError: [Errno 13] Permission denied: u'/usr/lib/ckan/default/src/ckan/ckan/public/base/i18n/ca.js'

Thanks

camfindlay commented 5 years ago

IOError: [Errno 13] Permission denied: u'/usr/lib/ckan/default/src/ckan/ckan/public/base/i18n/ca.js'

Suspect a permissions related issue given the error message.

Does your CKAN setup run without the DCAT module installed?

ghost commented 5 years ago

Yes my CKAN setup work perfectly without the DCAT module.

ghost commented 5 years ago

As reported by camfindlay, it's a permissions problem. Can be fixed with a dirty 777 chmod recursively on the i18n folder

chmod 777 -R /usr/lib/ckan/default/src/ckan/ckan/public/base/i18n
abedkhooli commented 4 years ago

Confirming same permissions error in CKAN 2.8.3 and chmod 777 -R /usr/lib/ckan/default/src/ckan/ckan/public/base/i18n seems to have done the trick.