# HS cli fetch gets "Error: ESOCKETTIMEDOUT" - rate limit reached?

**URL:** <https://community.hubspot.com/t/hs-cli-fetch-gets-error-esockettimedout-rate-limit-reached/65456>\
**Category:** APIs & Integrations\
**Tags:** developer-tools\
**Created:** [September 20, 2022, 1:28pm UTC](https://community.hubspot.com/t/hs-cli-fetch-gets-error-esockettimedout-rate-limit-reached/65456 "2022-09-20T13:28:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SBeranek](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/sberanek/32/48165_2.png) [@SBeranek](https://community.hubspot.com/u/SBeranek)\
**Post date:** [September 20, 2022, 1:28pm UTC](https://community.hubspot.com/t/hs-cli-fetch-gets-error-esockettimedout-rate-limit-reached/65456/1 "2022-09-20T13:28:28Z")

</div>

Hello guys,

I am syncing files to and from a private GIT-repository in a script and fetching about 1000-1500 files. Since a few days ago I am getting regular “Error: ESOCKETTIMEDOUT” messages. @hubspot / hs-cli is updated to 4.0.1 99% of the files are synced, but 1-10 files get this error.

Issued call is:

hs fetch --overwrite / ./hubspot/ --use-env

```lia-code-sample
Wrote file "/home/gitlab-runner/tmp/hubspot/XXX/templates/system/subscriptions-confirmation.html"
[ERROR] A Error has occurred. ESOCKETTIMEDOUT
[DEBUG] Error: Error: ESOCKETTIMEDOUT
 at ClientRequest.<anonymous> (/usr/local/lib/node_modules/@hubspot/cli/node_modules/request/request.js:816:19)
 at Object.onceWrapper (events.js:420:28)
 at ClientRequest.emit (events.js:314:20)
 at TLSSocket.emitRequestTimeout (_http_client.js:715:9)
 at Object.onceWrapper (events.js:420:28)
 at TLSSocket.emit (events.js:326:22)
 at TLSSocket.Socket._onTimeout (net.js:484:8)
 at listOnTimeout (internal/timers.js:554:17)
 at processTimers (internal/timers.js:497:7) {
 [stack]: 'Error: ESOCKETTIMEDOUT\n' +
 ' at ClientRequest.<anonymous> (/usr/local/lib/node_modules/@hubspot/cli/node_modules/request/request.js:816:19)\n' +
 ' at Object.onceWrapper (events.js:420:28)\n' +
 ' at ClientRequest.emit (events.js:314:20)\n' +
 ' at TLSSocket.emitRequestTimeout (_http_client.js:715:9)\n' +
 ' at Object.onceWrapper (events.js:420:28)\n' +
 ' at TLSSocket.emit (events.js:326:22)\n' +
 ' at TLSSocket.Socket._onTimeout (net.js:484:8)\n' +
 ' at listOnTimeout (internal/timers.js:554:17)\n' +
 ' at processTimers (internal/timers.js:497:7)',
 [message]: 'ESOCKETTIMEDOUT',
 code: 'ESOCKETTIMEDOUT',
 connect: false
}

```

Do you have any suggestions for fixing this ?

Tried fixes:

\* Update to newest hs-cli (prev. 3.06)

\* enable debug with -d (output see above)

\* reduce available cpu (renice) reduce net-bandwidth (trickle)

Thanks for your tips & suggestions!

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [September 22, 2022, 10:04pm UTC](https://community.hubspot.com/t/hs-cli-fetch-gets-error-esockettimedout-rate-limit-reached/65456/2 "2022-09-22T22:04:11Z")

</div>

Hi, @SBeranek 👋 Thanks for posting your question. Let’s see if we can get the conversation started — hey @nikodev @Teun @himanshurauthan have you, or your teams, ever dealt with this one?

Thanks! — Jaycee

---

<div class="post-metadata">

**Author:** ![jk\_br](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jk_br/32/5190_2.png) [@jk\_br](https://community.hubspot.com/u/jk_br)\
**Post date:** [October 13, 2022, 8:49am UTC](https://community.hubspot.com/t/hs-cli-fetch-gets-error-esockettimedout-rate-limit-reached/65456/3 "2022-10-13T08:49:38Z")

</div>

Update on this topic:

If you experience this error or an error while syncing to your sandbox in the UI (screenshot) then the root cause is the same. hubspot is working on it.

 ![705300_1_Bildschirmfoto 2022-10-13 um 10.46.10.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/e/f/eff34a9bc4828779288756f59fd6be5fdeec632e.png)

---

<div class="post-metadata">

**Author:** ![himanshurauthan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/himanshurauthan/32/53076_2.png) [@himanshurauthan](https://community.hubspot.com/u/himanshurauthan)\
**Post date:** [October 21, 2022, 1:43pm UTC](https://community.hubspot.com/t/hs-cli-fetch-gets-error-esockettimedout-rate-limit-reached/65456/4 "2022-10-21T13:43:05Z")

</div>

Hello @SBeranek.,  
ESOCKETTIMEDOUT -- rate limit reached indicates you have hit a hard limit on your account, and the request you made has been rejected.

“A rate limit is the number of API calls an app or user can make within a given time period”

It seems like, you have reached your request limit that’s why the error occured.

Regards,
