Twisted-timeout in OpenApiPy

Created at 30 Mar 2022, 11:25
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
MO

money-maker-money-taker

Joined 25.03.2022

Twisted-timeout in OpenApiPy
30 Mar 2022, 11:25


Hello in the Python version of the Open API I get always the following error of twisted. This creates other errors like not getting back a response of response of an order or blocking the thread.

My question is what did this error mean and how can I prefent this. 

 

Message Error:  [Failure instance: Traceback: <class 'twisted.internet.defer.TimeoutError'>: (5, 'Deferred')
/usr/local/lib/python3.8/dist-packages/twisted/internet/defer.py:586:timeItOut
/usr/local/lib/python3.8/dist-packages/twisted/internet/defer.py:742:cancel
/usr/local/lib/python3.8/dist-packages/twisted/internet/defer.py:701:errback
/usr/local/lib/python3.8/dist-packages/twisted/internet/defer.py:764:_startRunCallbacks
--- <exception caught here> ---
/usr/local/lib/python3.8/dist-packages/twisted/internet/defer.py:858:_runCallbacks
/usr/local/lib/python3.8/dist-packages/twisted/internet/defer.py:595:convertCancelled
/usr/local/lib/python3.8/dist-packages/twisted/internet/defer.py:252:_cancelledToTimedOutError
]
 


@money-maker-money-taker
Replies

amusleh
31 Mar 2022, 09:54

Hi,

This error occurs when your deferred is timed out, if the client doesn't receive a response for your request in 5 seconds (you can change it by passing responseTimeoutInSeconds to Send method) the returned deferred will be timed out.

The cause of this issue can be invalid request, and you have to check for incoming error message after your request by listening to error message types, there are several error messages that server can return, please check the Open API documentation.


@amusleh