[Ckan-users] Configuring Data Store

Sean Carte sean.carte at gmail.com
Wed Jun 28 13:03:48 UTC 2017


I'm configuring CKAN for the first time and everything seems to work apart
from the datastore plugin. I think I've followed the instructions correctly
<http://docs.ckan.org/en/ckan-2.6.2/maintaining/datastore.html>, but when
testing I can list the data sources, but not write:

curl -X GET "
http://127.0.0.1:5000/api/3/action/datastore_search?resource_id=_table_metadata
"
{"help": "http://10.0.36.95/api/3/action/help_show?name=datastore_search",
"success": true, "result": {"resource_id": "_table_metadata", "fields":
[{"type": "text", "id": "_id"}, {"type": "name", "id": "name"}, {"type":
"oid", "id": "oid"}, {"type": "name", "id": "alias_of"}], "records":
[{"_id": "1fab8662e5772995", "alias_of": "pg_views", "name":
"_table_metadata", "oid": 18107}, {"_id": "21b5fe766665b205", "alias_of":
"pg_tables", "name": "_table_metadata", "oid": 18107}], "_links": {"start":
"/api/3/action/datastore_search?resource_id=_table_metadata", "next":
"/api/3/action/datastore_search?offset=100&resource_id=_table_metadata"},
"total": 2}}

curl -X POST http://127.0.0.1:5000/api/3/action/datastore_create -H
"Authorization: {7edfaba5-12cc-4e63-acde-bbf3204256ac}" -d '{"resource":
{"package_id": "{1fab8662e5772995}"}, "fields": [ {"id": "a"}, {"id": "b"}
], "records": [ { "a": 1, "b": "xyz"}, {"a": 2, "b": "zzz"} ]}'{"help": "
http://10.0.36.95/api/3/action/help_show?name=datastore_create", "success":
false, "error": {"message": "Access denied: <function datastore_create at
0x7f84949f65f0> requires an authenticated user", "__type": "Authorization
Error"}}

I have installed the test data:

paster --plugin=ckan create-test-data -c /etc/ckan/default/development.ini

I don't think '1fab8662e5772995' is the correct package ID as it doesn't
change when I add the test data or clean the db.

I can add new datasets, but only by URL -- I don't see the 'Upload a file'
link as in the user documentation. The Data Explorer produces a 'Not Found'
Apache error:

The requested URL
/dataset/ezproxy/resource/07803797-7de9-464d-ac2d-4173b0aa2d49/view/c3bda38e-0f6d-4878-b319-e42d567f1f1c
was not found on this server.

and my data sources remains unchanged:

curl -X GET "
http://127.0.0.1:5000/api/3/action/datastore_search?resource_id=_table_metadata
"
{"help": "http://10.0.36.95/api/3/action/help_show?name=datastore_search",
"success": true, "result": {"resource_id": "_table_metadata", "fields":
[{"type": "text", "id": "_id"}, {"type": "name", "id": "name"}, {"type":
"oid", "id": "oid"}, {"type": "name", "id": "alias_of"}], "records":
[{"_id": "1fab8662e5772995", "alias_of": "pg_views", "name":
"_table_metadata", "oid": 18107}, {"_id": "21b5fe766665b205", "alias_of":
"pg_tables", "name": "_table_metadata", "oid": 18107}], "_links": {"start":
"/api/3/action/datastore_search?resource_id=_table_metadata", "next":
"/api/3/action/datastore_search?offset=100&resource_id=_table_metadata"},
"total": 2}}

I installed from source on Ubuntu 16.04, using 2.6.2.

Sean
--
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-users/attachments/20170628/facac543/attachment-0002.html>


More information about the ckan-users mailing list