APIs & Integrations

DavidE
Member

Random Hubspot Internal Server Error

Hi 

 

We are developing an integration with Hubspot. As part of that, we query for some information for all contacts. We randomly get Internal Server Error during the querying.

 

The code is running a Contact query:
    *  https://api.hubapi.com/contacts/v1/lists/1378/contacts/all?count=100&property....

in a loop that checks the response.HasMore and updates the VidOffest to get the next page.

 

This will work repeatedly for multiple runs and then randomly throw an Internal Server Error. We capture the ErrorResponse:

    *  var errorResponse = JsonConvert.DeserializeObject<ErrorResponse>(response);

but the only information is the "Internal Server Error" message.

 

There are 20,000+ contacts in this database.

 

We are wondering if we need to inject a time delay between each page query. Does anybody have any suggestions at all on what the issue might be, and how we can work around it?

 

 

0 Upvotes
1 Reply 1
WendyGoh
HubSpot Employee
HubSpot Employee

Random Hubspot Internal Server Error

Hi @DavidE,

 

I hope all is well with you 😃

 

By internal server error I believe it's the 5xx errors code that you're getting there?

 

In that case, I'd first like to address that it's not uncommon to see some 5xx errors, we generally see 99.99% of success rate and so it is still possible that you may encounter 5xx errors. In this case, if you haven't already done so, I'd encourage you to check out this similar forum discussion here: HubSpot Community - 502 Bad Gateway errors - HubSpot Community where Leland gave advice on how to best tackle this issue. The tdlr here is to add a retry logic. 

 

Hope this helps to clarify and do let me know if you've any further questions on this!

0 Upvotes