# How to handle Http request timeout

**URL:** <https://discourse.nodered.org/t/how-to-handle-http-request-timeout/38937>\
**Category:** General\
**Created:** [11 January 2021 09:06 UTC](https://discourse.nodered.org/t/how-to-handle-http-request-timeout/38937 "2021-01-11T09:06:43Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![minhhn0205](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/minhhn0205/32/29062_2.png) [@minhhn0205](https://discourse.nodered.org/u/minhhn0205)\
**Post date:** [11 January 2021 09:06 UTC](https://discourse.nodered.org/t/how-to-handle-http-request-timeout/38937/1 "2021-01-11T09:06:43Z")

</div>

Hi,

I have a flow **CheckFileAndGetData** that handles the file check and retrieves the data of the file, this flow is called by the flow **DataCollect** by `http` nodes.

 ![http-Timeout](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/c/ccea6d88cd951063d48bd9fbe98daaf90b5e1fe1.png)

In the case of a large number of files, about 10,000 files, the error time out **Server is not responding** at node ★★★ with the information as below:

> statusCode: "ESOCKETTIMEDOUT"  
> Error: ESOCKETTIMEDOUT : [http://localhost:1880/CheckFileAndGetData](http://localhost:1880/CheckFileAndGetData)

In Node-red, is it possible to set the timeout time for http node?  
Or is there a way to handle the timeout in this case, please tell me!

Any hint will be great.  
Thanks!!!

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [11 January 2021 09:14 UTC](https://discourse.nodered.org/t/how-to-handle-http-request-timeout/38937/2 "2021-01-11T09:14:31Z")

</div>

From the http request node help info

> requestTimeout  
> If set to a positive number of milliseconds, will override the globally set httpRequestTimeout parameter.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [11 January 2021 09:15 UTC](https://discourse.nodered.org/t/how-to-handle-http-request-timeout/38937/3 "2021-01-11T09:15:45Z")

</div>

> [@minhhn0205](#):
>
> In Node-red, is it possible to set the timeout time for http node?

Set msg.requestTimeout (use a change node or function node before the http request)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/f/4fd36be9928d710745c560219a3410aa0bf20d2e.png)

---

<div class="post-metadata">

**Author:** ![minhhn0205](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/minhhn0205/32/29062_2.png) [@minhhn0205](https://discourse.nodered.org/u/minhhn0205)\
**Post date:** [12 January 2021 03:37 UTC](https://discourse.nodered.org/t/how-to-handle-http-request-timeout/38937/4 "2021-01-12T03:37:57Z")

</div>

@E1cid , @Steve-Mcl Thank you for your support!  
My Node-RED version is v0.20.7 so the `http request` node doesn't have **requestTimeout** option.  
I have found [http-request-ucg](https://flows.nodered.org/node/node-red-contrib-http-request-ucg) node with **httpRequestTimeout** option but it doesn't seem to be working as expected.  
Also, since the number of data files is not known, setting the timeout value does not completely solve the problem, so I am thinking of another way.

---

<div class="post-metadata">

**Author:** ![softy2k](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/softy2k/32/23707_2.png) [@softy2k](https://discourse.nodered.org/u/softy2k)\
**Post date:** [12 January 2021 06:07 UTC](https://discourse.nodered.org/t/how-to-handle-http-request-timeout/38937/5 "2021-01-12T06:07:45Z")

</div>

> [@minhhn0205](#):
>
> Node-RED version is v0.20.7

Your NodeRed is very old.  
Just try to make update (and flow backup before)

---

<div class="post-metadata">

**Author:** ![minhhn0205](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/minhhn0205/32/29062_2.png) [@minhhn0205](https://discourse.nodered.org/u/minhhn0205)\
**Post date:** [12 January 2021 08:43 UTC](https://discourse.nodered.org/t/how-to-handle-http-request-timeout/38937/6 "2021-01-12T08:43:43Z")

</div>

I get it. Thank you!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [26 January 2021 08:43 UTC](https://discourse.nodered.org/t/how-to-handle-http-request-timeout/38937/7 "2021-01-26T08:43:51Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
