ckan / ckanapi

A command line interface and Python module for accessing the CKAN Action API
Other
176 stars 74 forks source link

File uploads don't work #129

Closed howff closed 6 years ago

howff commented 6 years ago

I too cannot get file uploads to work but I get a different response.

res = MyRemoteCKAN.action.resource_create(package_id='fd697f3a-1444-4bc8-a8b3-9f59da268727', url='dummy-value', name='file.txt', upload=open('/MyPath/file.txt', 'rb'))

returns this error:

ckanapi.errors.CKANAPIError: http://MySite/api/action/resource_create', 500, Server Error

I've tried with the actual name for package_id='my_dataset' but same error. (CKAN 2.2.1)

howff commented 6 years ago

I found this in the apache error.log Error - <type 'exceptions.AttributeError'>: 'Missing' object has no attribute 'encode'

wardi commented 6 years ago

that's useful information, but can you enable the full traceback so we can see exactly where ckan is failing? Which version of ckan are you using?

howff commented 6 years ago

It's ckan 2.2.1. How do I enable a full traceback and where do I find it?

wardi commented 6 years ago

that's a very old ckan.. but the full traceback should have been emailed to the email_to address in your ini file.

howff commented 6 years ago

ckan.txt

wardi commented 6 years ago

thanks! This traceback shows the failure is in ckanext-publicamundi because no format has been provided for the resource. Try including a format with your request, or submit the bug to ckanext-publicamundi.