The remote server returned an error: (502) Bad Gateway
Ok!
But I intentionally implemented less than 10 calls per second to avoid any problems and at your end you manage to close for any further calls if the 40K limit is being hit so obviously you must have some sort of internal issue with the 500 and 502 error!?
Just picking this thread back up. Other than the GET request you provided above are you noticing 5XX errors in other requests to the HubSpot API? If we can establish a pattern of this happening it’s possible there’s an error just being disguised as a generic 5XX error. Is your experience similar to @stephen_c where if you retry the request works correctly?
If things are working on retry then it’s just a temporary issue on our end and the solution is to build your app to have retry logic. However we always strive to improve our reliability so if you notice any patterns, like during a specific time of day we can take further action on our end.
The remote server returned an error: (502) Bad Gateway
@pmanca I can also confirm this - we see it every other day with the same scenario described, as we gracefully retry if we get a 502, but just so you know this has nothing to do with the Hubspot limits. a 502 is coming back from NGINX where it is taking too long to get a response back from your internal system. If this were a limit imposed by Hubspot, we would get back a much different error. And no, we are nowhere near the calls per second, nor the daily limits. It just doesn’t happen enough for me to complain, but I would say this is something you are already monitoring at layer 5 networking so it won’t be foreign to see.
The remote server returned an error: (502) Bad Gateway
Well, as stephen_c describes we also synchronize Companies and Contacts and because of that sends several thousands requests.- As I have observed it it is with randomly vids.
You mention a limit.- Isn’t this limit at maximum 10 requests a second?
There are general limits as in the secondly limit being 10/calls per second and also 40k total calls/day. There are some other internal limits to prevent one customer from taking completely control of all the resources. for ex. if you make 10 calls/second for 60 minutes long which would result in 36k calls you might start to see internal errors for hitting the API hard for a sustained period of time as opposed to breaking up your 36k calls over a couple hours. If you need to make very large requests very frequently you could always slow down your calls a bit more and see if that helps as opposed to running up against our speed limits for sustained periods of time.
I think I am having this same issue too. My app uses about 10,000 requests a day syncing contacts and companies and I randomly get about 5 internal server error (500) or Bad Gateways (502) a day. I’ve retried the requests that returned errors with same payload and they work fine.
Can you let me know if there’s anything that can be done to stop these errors?
The remote server returned an error: (502) Bad Gateway
@HenrikJanningJuul The team got back to me and don’t have any issues currently with the endpoints or the machines servicing them. There first questions was if you are hitting it very hard and frequently? There are some limits in place so no one portal can consume the entirety of the resources for the endpoint. Also is this happening with just one or two specific vids or is it random each time?