[ckan-dev] API upload failing
Sean
sean at ivec.org
Tue Jul 16 02:42:58 UTC 2013
Hey guys,
any ideas on this? It's a little frustrating - given I don't know enough about CKAN to debug this properly.
This is my entire script:
=======
ckan = ckanclient.CkanClient(base_location='http://localhost/api', api_key='my_pasword')
status = ckan.upload_file('/home/sean/newfile.txt')
print "uploaded file status: ", status
=======
Which gives:
uploaded file status: ('', 'Found')
=======
Apache logs:
[Thu Jul 11 21:42:38 2013] [error] 2013-07-11 21:42:38,703 INFO [ckan.lib.base] /api/action/status_show render time 0.002 seconds
[Thu Jul 11 21:42:38 2013] [error] 2013-07-11 21:42:38,711 INFO [ckan.lib.base] /api render time 0.001 seconds
[Thu Jul 11 21:42:38 2013] [error] 2013-07-11 21:42:38,750 INFO [ckan.lib.base] /api/storage/auth/form/2013-07-11T214238/newfile.txt render time 0.035 seconds
[Thu Jul 11 21:42:38 2013] [error] 2013-07-11 21:42:38,760 INFO [ckan.lib.base] /storage/upload_handle render time 0.004 seconds
Sean Fleming
Research Data Specialist
iVEC, http://www.ivec.org
sean at ivec.org
+61 8 6436 8918
On 03/07/2013, at 5:06 PM, Hendrik Bunke <bunke.hendrik at gmail.com> wrote:
> Hi Sean,
>
> --On 2013-07-03 09:09, Sean wrote:
>> yes, I'm positive I'm using the correct API key cut & pasted
>> from my profile page.
>>
>> I ran a python -v to check where the ckanclient import is
>> coming from and (in the source) it reads version 0.10 - which I
>> think is the same as the latest in github.
>
> Unfortunately you can't rely on that. It seems that the latest
> version on github didn't change the version number since the last
> release on PyPi. So please make sure, that you're definitely
> using the github repository
> (https://github.com/okfn/ckanclient.git).
>
>> Any ideas? Am I correct in assuming that a return tuple of ('',
>> 'Found') means that the upload_file() call failed?
>
> I'm not sure where 'Found' comes from, but the empty string in
> tuple[0] indicates an error. The upload_file method in ckanclient
> should return the location of the uploaded file.
>
> regards
> hendrik
>
> --
> Dr. Hendrik Bunke
> http://gplus.to/hbunke
> http://twitter.com/hbunke
> http://www.hbxt.org
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20130716/b667ba78/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2529 bytes
Desc: not available
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20130716/b667ba78/attachment-0003.bin>
More information about the ckan-dev
mailing list