Not able to create a resource in demo.ckan.org through the API (500 error) -


i'm doing tests demo.ckan.org, running 2.4 version of api, afaik. works (organization , dataset creation) except resource creation. resource_create method returns 500 error.

this curl showing package want create resource:

$ curl -x "http://demo.ckan.org:80/api/3/action/package_show?id=f2c4125b-27c8-4e07-94d7-d6d0c0b65154" | python -m json.tool   % total    % received % xferd  average speed   time    time     time  current                                  dload  upload   total   spent    left  speed 100  1228  100  1228    0     0   1384      0 --:--:-- --:--:-- --:--:--  1386 {     "help": "http://demo.ckan.org/api/3/action/help_show?name=package_show",     "result": {         "author": null,         "author_email": null,         "creator_user_id": "b0a12b23-4cee-4d8c-993e-723421a0a296",         "extras": [],         "groups": [],         "id": "f2c4125b-27c8-4e07-94d7-d6d0c0b65154",         "isopen": false,         "license_id": null,         "license_title": null,         "maintainer": null,         "maintainer_email": null,         "metadata_created": "2015-09-29t14:09:21.629953",         "metadata_modified": "2015-09-29t14:09:21.669256",         "name": "frb_org_test1_frb_pkg_test2",         "notes": null,         "num_resources": 0,         "num_tags": 0,         "organization": {             "approval_status": "approved",             "created": "2015-09-29t10:55:53.479724",             "description": "",             "id": "402f83c1-0070-4694-a1d9-f25b1d114631",             "image_url": "",             "is_organization": true,             "name": "frb_org_test1",             "revision_id": "26993878-9024-429a-b753-cc087b0ce382",             "state": "active",             "title": "",             "type": "organization"         },         "owner_org": "402f83c1-0070-4694-a1d9-f25b1d114631",         "private": false,         "relationships_as_object": [],         "relationships_as_subject": [],         "resources": [],         "revision_id": "47acfd70-8d26-4ebb-8cbd-6cababc627b1",         "state": "active",         "tags": [],         "title": "frb_org_test1_frb_pkg_test2",         "type": "dataset",         "url": null,         "version": null     },     "success": true } 

and curl failing when trying create resource:

$ curl -x post "http://demo.ckan.org:80/api/3/action/resource_create" -d '{ "name": "room1_room", "url": "none", "package_id": "f2c4125b-27c8-4e07-94d7-d6d0c0b65154" }' -h "authorization: my_api_key_is_secret" <!doctype html public "-//ietf//dtd html 2.0//en"> <html><head> <title>500 internal server error</title> </head><body> <h1>internal server error</h1> <p>the server encountered internal error or misconfiguration , unable complete request.</p> <p>please contact server administrator,  [no address given] , inform them of time error occurred, , might have done may have caused error.</p> <p>more information error may available in server error log.</p> <hr> <address>apache/2.2.22 (ubuntu) server @ demo.ckan.org port 80</address> </body></html> 

this appears documentation (and code) bug.

although format marked optional in documentation, code requires present (and unfortunately crash if isn't).

i've created ticket @ https://github.com/ckan/ckan/issues/2665

as temporary measure until fixed, can specify "format" in json send (it can empty).


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -