<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Error: ESOCKETTIMEDOUT with REST request in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Error-ESOCKETTIMEDOUT-with-REST-request/m-p/225804#M4700</link>
    <description>&lt;P&gt;Hi &lt;A class="mention" href="https://community.hubspot.com/u/rj_forbes"&gt;@RJ_Forbes&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;I don’t believe the timeouts are coming from HubSpot; generally we return 502 or sometimes 4xx errors when requests time out on the HubSpot side. It sounds like this is related to Node concurrency; have you checked out any of the other answers/related topics on the stack overflow article I posted? PUT requests tend to take (slightly) longer than other requests; could there be an aggressive timeout setting somewhere that’s failing these requests?&lt;/P&gt;</description>
    <pubDate>Wed, 10 Jan 2018 22:48:14 GMT</pubDate>
    <dc:creator>Derek_Gervais</dc:creator>
    <dc:date>2018-01-10T22:48:14Z</dc:date>
    <item>
      <title>Error: ESOCKETTIMEDOUT with REST request</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Error-ESOCKETTIMEDOUT-with-REST-request/m-p/225798#M4694</link>
      <description>&lt;P&gt;We have a few services  on our fulfillment system reading and writing to hubspot through the REST api and it has been running fine for months.  All of a sudden we are getting plastered with Error: ESOCKETTIMEDOUT when waiting for a response to our requests.&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;This does not always occur.&lt;/LI&gt;
&lt;LI&gt;The request is being processed, we are just not getting our confirmation back and are timing out.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;We are using node.js with the following module:&lt;BR /&gt;
&lt;ASIDE class="onebox whitelistedgeneric"&gt;
  &lt;HEADER class="source"&gt;
      &lt;IMG src="https://community.hubspot.com/legacyfs/online/uploads/default/original/2X/0/002338cf4914396ba2cd720ae9a9fc368af87cd6.png" class="site-icon" width="32" height="32" /&gt;
      &lt;A href="https://www.npmjs.com/package/hubspot" target="_blank" rel="nofollow noopener"&gt;npm&lt;/A&gt;
  &lt;/HEADER&gt;
  &lt;ARTICLE class="onebox-body"&gt;
    &lt;/ARTICLE&gt;&lt;/ASIDE&gt;&lt;/P&gt;&lt;DIV class="aspect-image" style="--aspect-ratio:690/362;"&gt;&lt;IMG src="https://community.hubspot.com/legacyfs/online/uploads/default/original/2X/e/ef0ba7cbf2b6749fe0220f6ed973027c4c61b251.png" class="thumbnail" /&gt;&lt;/DIV&gt;

&lt;H3&gt;&lt;A href="https://www.npmjs.com/package/hubspot" target="_blank" rel="nofollow noopener"&gt;hubspot&lt;/A&gt;&lt;/H3&gt;

&lt;P&gt;A node wrapper for the HubSpot API&lt;/P&gt;


  
  &lt;DIV class="onebox-metadata"&gt;
    
    
  &lt;/DIV&gt;
  &lt;DIV style="clear: both"&gt;&lt;/DIV&gt;

&lt;P&gt;&lt;/P&gt;
&lt;P&gt;I have increased the default timeout from 15 seconds to 30 seconds.&lt;BR /&gt;
I have checked the available sockets on our system and we are not over limit.&lt;/P&gt;
&lt;P&gt;Any similar experiences or suggestions?&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2018 12:46:45 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Error-ESOCKETTIMEDOUT-with-REST-request/m-p/225798#M4694</guid>
      <dc:creator>RJF</dc:creator>
      <dc:date>2018-01-09T12:46:45Z</dc:date>
    </item>
    <item>
      <title>Re: Error: ESOCKETTIMEDOUT with REST request</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Error-ESOCKETTIMEDOUT-with-REST-request/m-p/225799#M4695</link>
      <description>&lt;P&gt;Hi &lt;A class="mention" href="https://community.hubspot.com/u/rj_forbes"&gt;@RJ_Forbes&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;While I’m not particularly familiar with the 3rd party wrapper you’ve listed, ESOCKETTIMEDOUT can often be resolved by increasing your uv thread pool size (see below).&lt;/P&gt;
&lt;ASIDE class="onebox stackexchange"&gt;
  &lt;HEADER class="source"&gt;
      &lt;A href="https://stackoverflow.com/questions/24320578/node-js-get-request-etimedout-esockettimedout" target="_blank" rel="nofollow noopener"&gt;stackoverflow.com&lt;/A&gt;
  &lt;/HEADER&gt;
  &lt;ARTICLE class="onebox-body"&gt;
      &lt;A href="https://stackoverflow.com/users/792410/tan-hong-tat" target="_blank" rel="nofollow noopener"&gt;
    &lt;IMG alt="Tan Hong Tat" src="https://community.hubspot.com/legacyfs/online/uploads/default/original/2X/4/461a238949287a499958ff9b39455d7e35728546.png" class="thumbnail onebox-avatar" width="128" height="128" /&gt;
  &lt;/A&gt;
&lt;H4&gt;
  &lt;A href="https://stackoverflow.com/questions/24320578/node-js-get-request-etimedout-esockettimedout" target="_blank" rel="nofollow noopener"&gt;Node.js GET Request ETIMEDOUT &amp;amp; ESOCKETTIMEDOUT&lt;/A&gt;
&lt;/H4&gt;

&lt;DIV class="tags"&gt;
  &lt;STRONG&gt;javascript, node.js, node-request&lt;/STRONG&gt;
&lt;/DIV&gt;

&lt;DIV class="date"&gt;
  asked by
  
  &lt;A href="https://stackoverflow.com/users/792410/tan-hong-tat" target="_blank" rel="nofollow noopener"&gt;
    Tan Hong Tat
  &lt;/A&gt;
  on &lt;A href="https://stackoverflow.com/questions/24320578/node-js-get-request-etimedout-esockettimedout" target="_blank" rel="nofollow noopener"&gt;05:34AM - 20 Jun 14&lt;/A&gt;
&lt;/DIV&gt;

  &lt;/ARTICLE&gt;
  &lt;DIV class="onebox-metadata"&gt;
    
    
  &lt;/DIV&gt;
  &lt;DIV style="clear: both"&gt;&lt;/DIV&gt;
&lt;/ASIDE&gt;</description>
      <pubDate>Tue, 09 Jan 2018 20:53:05 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Error-ESOCKETTIMEDOUT-with-REST-request/m-p/225799#M4695</guid>
      <dc:creator>Derek_Gervais</dc:creator>
      <dc:date>2018-01-09T20:53:05Z</dc:date>
    </item>
    <item>
      <title>Re: Error: ESOCKETTIMEDOUT with REST request</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Error-ESOCKETTIMEDOUT-with-REST-request/m-p/225800#M4696</link>
      <description>&lt;P&gt;Thank you for the help &lt;A class="mention" href="https://community.hubspot.com/u/derek_gervais"&gt;@Derek_Gervais&lt;/A&gt; , this seems to have stopped the errors from occurring now.  Next I will have to investigate why this started happening on this instance.&lt;/P&gt;
&lt;P&gt;Cheers,&lt;BR /&gt;
RJ&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 12:15:39 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Error-ESOCKETTIMEDOUT-with-REST-request/m-p/225800#M4696</guid>
      <dc:creator>RJF</dc:creator>
      <dc:date>2018-01-10T12:15:39Z</dc:date>
    </item>
    <item>
      <title>Re: Error: ESOCKETTIMEDOUT with REST request</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Error-ESOCKETTIMEDOUT-with-REST-request/m-p/225801#M4697</link>
      <description>&lt;P&gt;I spoke too soon, received another timeout this morning. It had run throughout the night without issue, processing a dozen or so API requests, then this morning it timed out waiting for Deal info.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 13:33:00 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Error-ESOCKETTIMEDOUT-with-REST-request/m-p/225801#M4697</guid>
      <dc:creator>RJF</dc:creator>
      <dc:date>2018-01-10T13:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: Error: ESOCKETTIMEDOUT with REST request</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Error-ESOCKETTIMEDOUT-with-REST-request/m-p/225802#M4698</link>
      <description>&lt;P&gt;I have a log that may help some more, it seems to be happening when trying to update deals.&lt;/P&gt;
&lt;P&gt;Basically just a PUT of json at  &lt;A href="http://api.hubapi.com/deals/v1/deal/" rel="nofollow noopener"&gt;http://api.hubapi.com/deals/v1/deal/&lt;/A&gt;  .  Once again the data was written to hubspot but i did not get a confirmation back and timed out.&lt;/P&gt;
&lt;P&gt;{"__error_callsites":[{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{}],“stack”:“RequestError: Error: ESOCKETTIMEDOUT\n    at new RequestError (/data/node/fulfillment/fulfillmentService/node_modules/request-promise-core/lib/errors.js:14:15)\n    at Request.plumbing.callback (/data/node/fulfillment/fulfillmentService/node_modules/request-promise-core/lib/plumbing.js:87:29)\n    at Request.RP$callback [as _callback] (/data/node/fulfillment/fulfillmentService/node_modules/request-promise-core/lib/plumbing.js:46:31)\n    at self.callback (/data/node/fulfillment/fulfillmentService/node_modules/hubspot/node_modules/request/request.js:186:22)\n    at emitOne (events.js:96:13)\n    at Request.emit (events.js:188:7)\n    at ClientRequest. (/data/node/fulfillment/fulfillmentService/node_modules/hubspot/node_modules/request/request.js:816:16)\n    at ClientRequest.g (events.js:292:16)\n    at emitNone (events.js:86:13)\n    at ClientRequest.emit (events.js:185:7)\n    at Socket.emitTimeout (_http_client.js:629:10)\n    at Socket.g (events.js:292:16)\n    at emitNone (events.js:86:13)\n    at Socket.emit (events.js:185:7)\n    at Socket._onTimeout (net.js:338:8)\n    at ontimeout (timers.js:386:14)\n    at tryOnTimeout (timers.js:250:5)\n    at Timer.listOnTimeout (timers.js:214:5)”,&lt;BR /&gt;
“options”:{&lt;BR /&gt;
“transform2xxOnly”:false,&lt;BR /&gt;
“resolveWithFullResponse”:false,&lt;BR /&gt;
“simple”:true,“timeout”:30000,&lt;BR /&gt;
“qsStringifyOptions”:{“arrayFormat”:“repeat”},&lt;BR /&gt;
“qs”:{“hapikey”:“XXXXXXXXXXX”},&lt;BR /&gt;
“url”:“&lt;A href="http://api.hubapi.com/deals/v1/deal/244243707" rel="nofollow noopener"&gt;http://api.hubapi.com/deals/v1/deal/244243707&lt;/A&gt;”,&lt;BR /&gt;
“json”:true,&lt;BR /&gt;
“body”:{“properties”:[&lt;BR /&gt;
{“value”:“Out For Delivery”,“name”:“fulfillment_status”}]},“method”:“PUT”},&lt;BR /&gt;
“error”:{“connect”:false,“code”:“ESOCKETTIMEDOUT”},&lt;BR /&gt;
“cause”:{“connect”:false,“code”:“ESOCKETTIMEDOUT”},&lt;BR /&gt;
“message”:“Error: ESOCKETTIMEDOUT”,“name”:“RequestError”}&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 15:07:53 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Error-ESOCKETTIMEDOUT-with-REST-request/m-p/225802#M4698</guid>
      <dc:creator>RJF</dc:creator>
      <dc:date>2018-01-10T15:07:53Z</dc:date>
    </item>
    <item>
      <title>Re: Error: ESOCKETTIMEDOUT with REST request</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Error-ESOCKETTIMEDOUT-with-REST-request/m-p/225803#M4699</link>
      <description>&lt;P&gt;I have seen one error come in saying that we have reached our secondary limit.  I dont always see this error, mainly just the timeouts.  We should be nowhere close to the 10 requests a second that would trigger this.&lt;/P&gt;
&lt;P&gt;Would one of these other restrictions be responsible for this?&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Integrations that poll HubSpot for new or updated information are limited to polling for those changes at intervals of 5 minutes or more.&lt;/LI&gt;
&lt;LI&gt;Requests resulting in an error response may not exceed 5% of your total requests.&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Wed, 10 Jan 2018 17:44:58 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Error-ESOCKETTIMEDOUT-with-REST-request/m-p/225803#M4699</guid>
      <dc:creator>RJF</dc:creator>
      <dc:date>2018-01-10T17:44:58Z</dc:date>
    </item>
    <item>
      <title>Re: Error: ESOCKETTIMEDOUT with REST request</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Error-ESOCKETTIMEDOUT-with-REST-request/m-p/225804#M4700</link>
      <description>&lt;P&gt;Hi &lt;A class="mention" href="https://community.hubspot.com/u/rj_forbes"&gt;@RJ_Forbes&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;I don’t believe the timeouts are coming from HubSpot; generally we return 502 or sometimes 4xx errors when requests time out on the HubSpot side. It sounds like this is related to Node concurrency; have you checked out any of the other answers/related topics on the stack overflow article I posted? PUT requests tend to take (slightly) longer than other requests; could there be an aggressive timeout setting somewhere that’s failing these requests?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 22:48:14 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Error-ESOCKETTIMEDOUT-with-REST-request/m-p/225804#M4700</guid>
      <dc:creator>Derek_Gervais</dc:creator>
      <dc:date>2018-01-10T22:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: Error: ESOCKETTIMEDOUT with REST request</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Error-ESOCKETTIMEDOUT-with-REST-request/m-p/225805#M4701</link>
      <description>&lt;P&gt;Timeouts were occurring after 30 seconds (I had increased from 15 to 30 ).&lt;/P&gt;
&lt;P&gt;I added some more verbose error logging and now I am seeing the secondly limit error.&lt;BR /&gt;
“You have reached your secondly limit.”&lt;/P&gt;
&lt;P&gt;We do have a few different services hitting the hubspot API.  Is it possible that we are getting timeouts on some requests as the secondly limit is being hit from a different request?&lt;/P&gt;
&lt;P&gt;Also, is there any logging on hubspot that we can see the requests that are being sent?  Im only seeing at most 1-2 per second but usually 2-3 over 10 seconds with a total of about 300-500 requests total per day.  At this rate it seems odd we would be going over limit.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2018 15:36:21 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Error-ESOCKETTIMEDOUT-with-REST-request/m-p/225805#M4701</guid>
      <dc:creator>RJF</dc:creator>
      <dc:date>2018-01-11T15:36:21Z</dc:date>
    </item>
    <item>
      <title>Re: Error: ESOCKETTIMEDOUT with REST request</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Error-ESOCKETTIMEDOUT-with-REST-request/m-p/225806#M4702</link>
      <description>&lt;P&gt;Hi &lt;A class="mention" href="https://community.hubspot.com/u/rj_forbes"&gt;@RJ_Forbes&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;Interesting; I wouldn’t expect timeouts like this to occur if you hit your secondly limit unless perhaps the 429 responses are preventing some callback/promise from executing/resolving? Even very low volume apps can hit the secondly limit if there’s no logic in place to enforce the 10 req/s limit. There’s API call logging built into your developer portal, but that only works if you’re using OAuth to authenticate your requests. If you’re using a hapikey, you can send me your portal ID and I can see if I can dig up some info on your requests.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2018 21:51:20 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Error-ESOCKETTIMEDOUT-with-REST-request/m-p/225806#M4702</guid>
      <dc:creator>Derek_Gervais</dc:creator>
      <dc:date>2018-01-11T21:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: Error: ESOCKETTIMEDOUT with REST request</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Error-ESOCKETTIMEDOUT-with-REST-request/m-p/225807#M4703</link>
      <description>&lt;P&gt;HI &lt;A class="mention" href="https://community.hubspot.com/u/derek_gervais"&gt;@Derek_Gervais&lt;/A&gt;  I have messaged you our Portal Id and have also done some testing off our network over the weekend,  I can trigger a socket timeout by requesting recent deals consistently.  I have a page that displays the last 5 deals created and just refreshing this page 4-5 times over a few seconds can cause a timeout.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jan 2018 12:36:35 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Error-ESOCKETTIMEDOUT-with-REST-request/m-p/225807#M4703</guid>
      <dc:creator>RJF</dc:creator>
      <dc:date>2018-01-15T12:36:35Z</dc:date>
    </item>
  </channel>
</rss>

