okfn / ckanclient-deprecated

DEPRECATED - please see https://github.com/ckan/ckanapi. [Python client library for CKAN]
http://pypi.python.org/pypi/ckanclient
25 stars 17 forks source link

File upload borked #34

Open rossjones opened 10 years ago

rossjones commented 10 years ago

It looks like, at least with datahub.io, file upload has not worked since 183ad055e51e7e30561cf3075ed7848d72a0e566 - using this revision is fine.

Any commit since then makes google return an error about posting to create a bucket not being allowed.

davidread commented 10 years ago

Agreed. Here's the test case:

>>> import ckanclient
>>> ckan = ckanclient.CkanClient(base_location='http://datahub.io/api', api_key='<key>')
>>> ckan.upload_file('/vagrant/test.csv')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/vagrant/ckanclient/ckanclient/__init__.py", line 582, in upload_file
    raise CkanApiError(body)
ckanclient.CkanApiError: <?xml version='1.0' encoding='UTF-8'?><Error><Code>InvalidArgument</Code><Message>Invalid argument.</Message><Details>Cannot create buckets using a POST.</Details></Error>

However, @Hoedic says it works for him with local storage. It would be great if he could look try and get his code working with the Google storage that datahub.io uses.

Hoedic commented 10 years ago

Why is this closed?

I have to say I have zero knowledge with Google Storage and I don't see anything specific in the CkanClient concerning the google storage, so I guess CKAN manages the Google storage part. So somewhere, the new version of the client makes that CKAN screws the upload to Google storage...

@davidread, would you be able to get a dump of the multipart data with the commit that works?

rufuspollock commented 10 years ago

@Hoedic not sure what's closed here? #31 is closed thanks to your efforts :-)

Re file upload ckanclient does handle the google storage stuff in fact, but as I said that was already broken in pycurl refactor and we can fix that for you :-)

Hoedic commented 10 years ago

Oh yes, it was #31! Sorry, I saw "closed" in red, I thought it was for the current issue. My bad

Thank you @rgrp for taking of the google storage, I was a bit discouraged :p