Greetings to all.
During the development of the Hubspot UI-Extension card, I am facing the issue with random ‘Gateway took too long to respond’ error (or something like that).
The issue rises when the hubspot.fetch request is executed. I’ve set the big timeout in the parameters, however I receive this error randomly (sometimes everything is ok, sometimes not).
However, I’ve not found any documentation: what the maximum timeout for hubspot.fetch is?
I would really appreciate any help. The average response from the backend is 6 seconds, as I understood, but my timeout is like 10000 or more.
Hey @AKonotopchyk,
Thanks for posting in the Community!
I’d like to tag in some Community experts to see what insight they may have for us!
@Anton, @alyssamwilie, and @Kevin-C - any knowledge on what the maximum timeout for hubspot.fetch is?
Shane, Senior Community Moderator
Documentation says 15 seconds is the max:
Each request has a maximum timeout of 15 seconds. Both request and response payloads are limited to 1MB. You can specify a lower timeout per request using the timeout field. Request duration time includes the time required to establish an HTTP connection. HubSpot will automatically retry a request once if there are issues establishing a connection, or if the request fails with a 5XX status code within the 15 second window.
Have you checked to see why it might be hitting the limit? Too many records? Too much processing?
Thank you for your help.
Based on my calculations, the backend response time was no longer than 15 seconds. The backend was executing with an average response time of 6 to 11 seconds, which indicates the actual response time.
However, I suspect the issue might be related to how the timeout value is set when it exceeds the maximum limit. When I set the timeout to 100,000 milliseconds, it appeared to default to the browser’s timeout rather than the expected 15 seconds. After adjusting the timeout to exactly 15 seconds, the issue was no longer replicated, even though the backend remained the same.
For now, the issue seems to be resolved, but I find this behavior quite odd.aulted to browser timeout, not the 15s. After I’ve set it to be exactly the 15s the issue was not replicated, but the backend is the same.
As for now the issue seems to be resolved, but it is quite weird behaviour, as I think.