ckan / datapusher

A standalone web service that pushes data files from a CKAN site resources into its DataStore
GNU Affero General Public License v3.0
77 stars 154 forks source link

Error 500 - Server Error #171

Closed aislanrs closed 6 years ago

aislanrs commented 6 years ago

Hi.

I've installed CKAN 2.8.1 on centos and after ckanext-ldap plugin was installed I can't send my data set to datastore anymore.

According to CKAN's log, the error is being returned by "/ckan/lib/default/src/ckan/ckan/authz.py" on method "is_authorized", that shows many expections as follow:

[Mon Sep 03 17:30:07.395171 2018] [:error] [pid 38375] 2018-09-03 17:30:07,395 INFO [ckan.lib.base] /dataset/0caa2639-12df-4081-b617-7ffc8187468d/resource/782ba2b1-76c1-47f3-9fb8-a49f2b2831cd/download/result_poc_v2_0116.csv render time 0.058 seconds [Mon Sep 03 17:30:08.073511 2018] [:error] [pid 38375] 2018-09-03 17:30:08,072 ERROR [ckan.views.api] Authorization function not found: datastore_create [Mon Sep 03 17:30:08.073548 2018] [:error] [pid 38375] Traceback (most recent call last): [Mon Sep 03 17:30:08.073550 2018] [:error] [pid 38375] File "/ckan/lib/default/src/ckan/ckan/views/api.py", line 286, in action [Mon Sep 03 17:30:08.073552 2018] [:error] [pid 38375] result = function(context, request_data) [Mon Sep 03 17:30:08.073554 2018] [:error] [pid 38375] File "/ckan/lib/default/src/ckan/ckan/logic/init.py", line 464, in wrapped [Mon Sep 03 17:30:08.073555 2018] [:error] [pid 38375] result = _action(context, data_dict, kw) [Mon Sep 03 17:30:08.073557 2018] [:error] [pid 38375] File "/ckan/lib/default/src/ckan/ckanext/datastore/logic/action.py", line 99, in datastore_create [Mon Sep 03 17:30:08.073559 2018] [:error] [pid 38375] p.toolkit.check_access('datastore_create', context, data_dict) [Mon Sep 03 17:30:08.073560 2018] [:error] [pid 38375] File "/ckan/lib/default/src/ckan/ckan/logic/init.py", line 303, in check_access [Mon Sep 03 17:30:08.073562 2018] [:error] [pid 38375] data_dict) [Mon Sep 03 17:30:08.073563 2018] [:error] [pid 38375] File "/ckan/lib/default/src/ckan/ckan/authz.py", line 206, in isauthorized [Mon Sep 03 17:30:08.073565 2018] [:error] [pid 38375] raise ValueError(('Authorization function not found: %s' % action)) [Mon Sep 03 17:30:08.073567 2018] [:error] [pid 38375] ValueError: Authorization function not found: datastore_create [Mon Sep 03 17:30:08.104461 2018] [:error] [pid 38375] 2018-09-03 17:30:08,104 ERROR [ckan.views.api] Authorization function not found: datapusher_submit [Mon Sep 03 17:30:08.104492 2018] [:error] [pid 38375] Traceback (most recent call last): [Mon Sep 03 17:30:08.104495 2018] [:error] [pid 38375] File "/ckan/lib/default/src/ckan/ckan/views/api.py", line 286, in action [Mon Sep 03 17:30:08.104496 2018] [:error] [pid 38375] result = function(context, request_data) [Mon Sep 03 17:30:08.104498 2018] [:error] [pid 38375] File "/ckan/lib/default/src/ckan/ckan/logic/init.py", line 464, in wrapped [Mon Sep 03 17:30:08.104500 2018] [:error] [pid 38375] result = _action(context, data_dict, kw) [Mon Sep 03 17:30:08.104501 2018] [:error] [pid 38375] File "/ckan/lib/default/src/ckan/ckanext/datapusher/logic/action.py", line 189, in datapusher_hook [Mon Sep 03 17:30:08.104503 2018] [:error] [pid 38375] p.toolkit.check_access('datapusher_submit', context, metadata) [Mon Sep 03 17:30:08.104505 2018] [:error] [pid 38375] File "/ckan/lib/default/src/ckan/ckan/logic/init.py", line 303, in check_access [Mon Sep 03 17:30:08.104506 2018] [:error] [pid 38375] data_dict) [Mon Sep 03 17:30:08.104508 2018] [:error] [pid 38375] File "/ckan/lib/default/src/ckan/ckan/authz.py", line 206, in isauthorized [Mon Sep 03 17:30:08.104509 2018] [:error] [pid 38375] raise ValueError(('Authorization function not found: %s' % action)) [Mon Sep 03 17:30:08.104511 2018] [:error] [pid 38375] ValueError: Authorization function not found: datapusher_submit

Thanks.

aislanrs commented 6 years ago

I've looked to #40 and I found the solution. At the pull request #31 I identified that there is a pull request on CKAN (https://github.com/ckan/ckan/pull/4248) that has some fixes on file authz.py. I've applied those changes into my authz.py file and it worked.

aislanrs commented 6 years ago

40 = https://github.com/NaturalHistoryMuseum/ckanext-ldap/issues/40

31 = https://github.com/NaturalHistoryMuseum/ckanext-ldap/pull/31

jqnatividad commented 6 years ago

You may also want to check out https://github.com/ckan/ckanext-xloader.

https://github.com/ckan/ckan/issues/4415