ckanclient-deprecated icon indicating copy to clipboard operation
ckanclient-deprecated copied to clipboard

File upload borked

Open rossjones opened this issue 11 years ago • 4 comments

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.

rossjones avatar Jan 07 '14 18:01 rossjones

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.

davidread avatar Jan 09 '14 14:01 davidread

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?

Hoedic avatar Jan 09 '14 15:01 Hoedic

@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 :-)

rufuspollock avatar Jan 09 '14 15:01 rufuspollock

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

Hoedic avatar Jan 10 '14 01:01 Hoedic