xero-python icon indicating copy to clipboard operation
xero-python copied to clipboard

request timeout exception?

Open RettBehrens opened this issue 4 years ago • 5 comments

Created based on conversation with community developer:

"Occasionally the Journals endpoint takes a long time to respond - last night 235seconds for 1 page of Journals. Yes, it's an anomaly as the same Org can be used and it doesn't exhibit the same issue.

So, looking at the Python library it appears http requests default to timeout=None, which reading https://docs.python-requests.org/en/master/user/advanced/#timeouts suggests the timeout will be infinite but can be overridden.

If that is the case, then it appears that there will be no timeout exception raised for all API calls to the Xero APIs. My recommendation to our integration partner, who has inbuilt their own timeouts (this is bad!!!) was that they utilise the HTTP request timeout and retry, but they appear to not be overriding the parameter!

If the exception is raised from a timeout it appears it will be returned to the calling function of the Xero API as only exceptions.HTTPStatusException are handled within the SDK so exceptions.Timeout will need to be caught."

RettBehrens avatar May 05 '21 20:05 RettBehrens

@RettBehrens did this get handled in the core API? I am seeing 5 minute read timeouts on various endpoints, including earlier today.

As an example Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='api.xero.com', port=443): Read timed out. (read timeout=299.99943640999845)")': /api.xro/2.0/RepeatingInvoices

We have a fairly large app on Xero's store (> 400 clients) and this is starting to cause some issues for us at uncat.com.

jaredthecoder avatar Apr 26 '23 01:04 jaredthecoder

@jaredthecoder I’m not at Xero anymore. Please contact [email protected] and they’ll direct your query to the appropriate point of contact.

RettBehrens avatar Apr 26 '23 01:04 RettBehrens

I have :( They are not helpful. I will tell them you pointed me there again.

jaredthecoder avatar Apr 27 '23 21:04 jaredthecoder

I did mention this by the way; whatever is going on here is leading to our refresh tokens to get overwritten and then lead to the classic reuse issue, which then expires a ton of clients.

jaredthecoder avatar Apr 27 '23 21:04 jaredthecoder

@rdemarco-xero are you able to take a look at this? This is plaguing a bunch of different devs I have talked to and API support is not able to help.

jaredthecoder avatar Jun 19 '23 20:06 jaredthecoder