We're sorry AsposeCloud doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.cloud

Intermittent issue with upload to storage via asposepdfcloud client

This is more an issue with the storage side rather than PDF product specifically, but hoping for some help.

I’m getting the following error:

MaxRetryError HTTPSConnectionPool(host=‘api.aspose.cloud’, port=443): Max retries exceeded with url: /v3.0/pdf/storage/file/out_4f61444a-d92f-42df-8dfd-2f7f3c4953ca.pdf (Caused by ProtocolError(‘Connection broken: IncompleteRead(246 bytes read)’, IncompleteRead(246 bytes read)))

When running this code:

pdf_api_client = asposepdfcloud.api_client.ApiClient(
    app_key=credentials['app_sid'],
    app_sid=credentials['app_key'])

pdf_api = PdfApi(pdf_api_client)
remote_name = f'out_{uuid.uuid4()}.pdf'

pdf_api.upload_file(remote_name, filename)

It seems to happen intermittently, sometimes it works fine. It seems better upon recently deploying the code making me wonder if there’s a memory leak or similar, but it’s not entirely repeatable. Given the file I’m uploading is 0.5MB (not that big?) perhaps the default timeouts are borderline? Is there a way to override them?

I’m using the latest version of the python asposepdfcloud client 23.1.0.

@dwjperry

I am afraid it is difficult to comment on the issue without reproducing it on my side. Please test the scenario after setting the timeout property, and if you still face the issue, then please share your input document with us for further investigation.

pdf_api_client = asposepdfcloud.api_client.ApiClient('xxxxxxxxxxxxxxxxxxxx','xxxxxx-xxxx-xxxx-xxxxx-xxxxxxxxxx')
pdf_api_client.timeout= 300

pdf_api = PdfApi(pdf_api_client)....

....