ckanext-cloudstorage
ckanext-cloudstorage copied to clipboard
resource_create API request returning 504 timeout error
api/action/resource_create works fine with local storage ckan.storage_path = /var/lib/ckan/default but after enabling cloudstorage it gives timeout error while making request from UI or Postman
am i missing anything here?
I was able to resolve the timeout error, now metadata get saved but not the file, neither on S3 nor on local. After diving into code, I think below is what I got to do:
- Call
resource_createAPI - it saves the metadata
curl -H'Authorization: <api key>' \
'http://<instance ip>/api/action/resource_create' \
--form [email protected] --form package_id=public --form name="curl file"
- Then
cloudstorage_initiate_multipart- it gives back upload key
curl -H'Authorization: <api key>' \
'http://<instance ip>/api/action/cloudstorage_initiate_multipart' \
-d '{"id":"e3876b08-27d2-42ba-b088-ee4789091b83","name":"metadata.sql","size":3610 }'
- Then
cloudstorage_upload_multipart- not working, gives error(AttributeError: SpooledTemporaryFile instance has no attribute 'file') onckanext/cloudstorage/logic/action/multipart.py", line 155, in upload_multipart
curl -H'Authorization: <api key>' \
'http://<instance ip>/api/action/cloudstorage_upload_multipart' \
--form "id=e3876b08-27d2-42ba-b088-ee4789091b83" --form "[email protected]" --form "partNumber=1" --form "uploadId=XXXXXXXXX.qqXAQPCxZFij0U1pVpsbVjpzkO3H6Rtang1x2FVS.cJgWkQPjbKvCNzoPQZ2S09dsmG4FcQI_qyRWmRUz3sHWLWgh9L3lEckOAJteeaIHBvlC6tniLh1gu"
- Finally
cloudstorage_finish_multipart- not working, gives error (Error in multipart commit: The XML you provided was not well-formed or did not validate against our published schema (MalformedXML)) onckanext/cloudstorage/logic/action/multipart.py", line 198, in finish_multipart, because the option 3 wasn't complete i guess
curl -H'Authorization: <api key>' \
'http://<instance ip>/api/action/cloudstorage_finish_multipart' \
-d '{"save_action":"go-metadata","id":"e3876b08-27d2-42ba-b088-ee4789091b83","uploadId":"XXXXXXXXX.qqXAQPCxZFij0U1pVpsbVjpzkO3H6Rtang1x2FVS.cJgWkQPjbKvCNzoPQZ2S09dsmG4FcQI_qyRWmRUz3sHWLWgh9L3lEckOAJteeaIHBvlC6tniLh1gu"}'
Can anyone confirm please?
Were you ever able to resolve this?