Earlier one of your developers said that 502/504 timeout errors will be minimised. We have some amount of customers using our HubSpot Integration. Of them, customers having a large volume of data frequently face timeout errors while using get all/recently modified contacts, companies, deals API. Though we’re working within your API limits, we are facing this issue frequently. Some of our customers are feeling dissatisfied with our integration due to the frequent occurrence of such errors. Kindly guide us to make this work on the permanent basis.
Just wanted to hop in here again since this topic is getting very crowded: It's important to differentiate between a 'normal' and 'abnormal' level of these timeouts. While a 504 or 524 is indicative of a server-side issue, some small number of timeout errors are always expected on the Internet. This is normal and not something we can prevent 100% of the time. It's important to be able to gracefully handle these errors; in the overwhelming majority of cases, we see successful responses after a single retry.
That said, high error rates can be indicative of something else going wrong. If you're seeing success rates lower than ~99.99% (i.e. significantly more than 1-2 504/524 errors for every 10,000 requests) then we should dig into things further to make sure there isn't a more severe issue.
If you're seeing abnormally high error rates, it's likely because the thing you're doing is causing some timeout on the HubSpot side; temporarily slowing down your requests and/or lowering batch sizes is generally the best remedy for these issues.
Going forward, anyone that's experiencing abnormally high rates of 504 and/or 524 errors should create a separate thread with the following information:
The public IP address your traffic is coming from
The full URL of the API you're hitting
What kind of client you're using to hit the API (e.g. Java 8 with HttpClient, curl 7.55, etc)
Any error messages you're getting, including the "Ray ID" if it's present
For timeouts and network errors, a traceroute from your machine to our API (e.g. traceroute api.hubapi.com)
We are getting 504s frequently for one of our clients, usually when using the API to get contacts, but sometimes when using the bulk API to send back data. Examples from yesterday below.
Still these errors are not minimised. We get 502, 504 and 524 errors frequently.
The connection to the origin web server was made_ but the origin web server timed out before responding. The likely cause is an overloaded background task_ database or application_ stressing the resources on your web server. To resolve_ please work with your hosting provider or web development team to free up resources for your database or overloaded application.
This was the error message thrown while we got 524 error.
@Derek_Gervais, is there any more information (another topic because this one is about the 502 / 504 error) about that 524 error message? I myself do frequently experience an strange error called "invalid JSON markup" using Cdata's connector which according to Cdata support should be caused by an HTTP-524 error. I can not solve it yet.
You don't happen to have more details than that, do you? I would expect a bigger error response with more details. Also, are you only seeing this with the Engagements API?
@DavidSickmiller thanks for the info; was there more to the error response? Any 524 errors have different origins than 504 errors, and there's often more info in the full error body. Are you only seeing this with the Deals API?
I've been seeing 524s since March. I've been monitoring this thread hoping there'd be a resolution. A common endpoint with the issue seems to be https://api.hubapi.com/deals/v1/deal/
Here are a couple recent ray IDs:
419847929aa329f5
419743f37f042a4f
Is there anything I can do to help you debug it? Or a better way for me to report my issue?
Can you all post more specifics on the endpoints/APIs you're seeing these errors with? @flemingapptopia it sounds like you're seeing 504s with the Engagements API? @TommyT and @InProductionDev are you both seeing 504s with the 'Get all contacts' endpoint?
Additionally, are all of you respecting the maximum count for all of your requests? Can you try reducing the number of records you're requesting in the interim? Others have found that reducing the size of the batches you're requesting helps mitigate this problem.
If you can give me more specifics on your errors I can dig into this futher.
Lowering the limit would likely help alleviate the issue, though batch sizes of 250 should work fine. Do you happen to have the full 504 error you got?
Since beginning testing with the API, I haven't once been able to iterate through all contacts I wish to retrieve before getting a timeout (504). This is specifically with the test data.