# Nodered HTTP Request Error Response code 408 (Request Timeout)

**URL:** <https://discourse.nodered.org/t/nodered-http-request-error-response-code-408-request-timeout/48761>\
**Category:** General\
**Created:** [22 July 2021 09:19 UTC](https://discourse.nodered.org/t/nodered-http-request-error-response-code-408-request-timeout/48761 "2021-07-22T09:19:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![adouban](https://avatars.discourse-cdn.com/v4/letter/a/f04885/32.png) [@adouban](https://discourse.nodered.org/u/adouban)\
**Post date:** [22 July 2021 09:19 UTC](https://discourse.nodered.org/t/nodered-http-request-error-response-code-408-request-timeout/48761/1 "2021-07-22T09:19:28Z")

</div>

Hi

I have issue in using HTTP Request to query OpenStack APIs, the flow designed to Start Getting OpenStack Token for authentication (and it works) then initiating another request to OpenStack Cinder to List available volumes. the same request and related parameters working correctly in Postman (or any HTTP request tool) but in Nodered I ended up getting below error.

"HTTPError: Response code 408 (Request Timeout)"

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

in function node I added some headers like Token and increased timeout

```auto
msg.headers['X-Auth-Token'] = msg.token;
msg.query = "?all_tenants=True"
msg.requestTimeout = 900000;
return msg;

```

where msg.token got it from previous flow nodes. and after debug it appears successfully in HTTP Request headers with the timeout set to 900000 (15min), in postman the query took less than 1s. and has a size of 188 kb

environment I'm using  
Nodered in Docker : (tried both versions) latest and lastest-14  
Host: Ubuntu-18

Connectivity to API and ports has been checked and successfull.  
Tried other OpenStack APIs like list compute and still the same error

Appreciate you Help

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [22 July 2021 10:56 UTC](https://discourse.nodered.org/t/nodered-http-request-error-response-code-408-request-timeout/48761/2 "2021-07-22T10:56:51Z")

</div>

Is this something that used to work that has stopped working?

Also can you show the rest of that flow, does it have an earlier http-request node in the flow?

---

<div class="post-metadata">

**Author:** ![adouban](https://avatars.discourse-cdn.com/v4/letter/a/f04885/32.png) [@adouban](https://discourse.nodered.org/u/adouban)\
**Post date:** [22 July 2021 12:28 UTC](https://discourse.nodered.org/t/nodered-http-request-error-response-code-408-request-timeout/48761/3 "2021-07-22T12:28:04Z")

</div>

No, its new flow I'm trying to automate.

and Yes there is http-request to get Token, Here is the complete Flow.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/e/be6737d43c310af18e162ebbac2401e98b52b576.png)

Token POST: is a post request and able to get Token in HTTP header  
Change Token Name: I'm assigning a Token variable (x-subject-token) to a new Token variable (token) (as experienced before dash makes some trouble)

below msg debug

```auto
msg : Object
object
_msgid: "ebe75e22b32c427f"
payload: "HTTPError: Response code 408 (Request Timeout) : http://OSAPI:8776/v3/723d9839ab534481956b1d50e02a5fff/volumes/detail?all_tenants=True"
topic: ""
statusCode: 408
headers: object
date: "Thu, 22 Jul 2021 09:23:15 GMT"
server: "Apache"
content-length: "9212"
x-subject-token: "gAAAAABg-TkDNx8kIc_xf0-v76FepXBAXiOFshDGY3hVxBCecjtFvz3E8mxCh-PRvA-v1v4LhZvqme7gL9SCIi6Nr5ImJ9L7z80Hw7Yck1FS_Ulp7cqh-72-DvRxUvGe2NT8xYU3fxnpfPiOBn45jKRorFI2LeITuWwlnLYaZMZoRAKS5bvLc3I"
vary: "X-Auth-Token"
x-openstack-request-id: "req-18a48494-74e8-4b8e-888a-0bed8bd85c38"
connection: "close"
content-type: "application/json"
X-Auth-Token: "gAAAAABg-TkDNx8kIc_xf0-v76FepXBAXiOFshDGY3hVxBCecjtFvz3E8mxCh-PRvA-v1v4LhZvqme7gL9SCIi6Nr5ImJ9L7z80Hw7Yck1FS_Ulp7cqh-72-DvRxUvGe2NT8xYU3fxnpfPiOBn45jKRorFI2LeITuWwlnLYaZMZoRAKS5bvLc3I"
responseUrl: "http://OSAPI:35357/v3/auth/tokens"
redirectList: array[0]
retry: 0

```

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [22 July 2021 12:46 UTC](https://discourse.nodered.org/t/nodered-http-request-error-response-code-408-request-timeout/48761/4 "2021-07-22T12:46:28Z")

</div>

Try changing the "Get Headers" function node to the following:

```auto
msg.headers = {}
msg.headers['X-Auth-Token'] = msg.token;
msg.query = "?all_tenants=True"
msg.requestTimeout = 900000;
return msg;

```

This will remove all the previous response headers before you try and feed them into the second http-request node as request headers

---

<div class="post-metadata">

**Author:** ![adouban](https://avatars.discourse-cdn.com/v4/letter/a/f04885/32.png) [@adouban](https://discourse.nodered.org/u/adouban)\
**Post date:** [22 July 2021 13:05 UTC](https://discourse.nodered.org/t/nodered-http-request-error-response-code-408-request-timeout/48761/5 "2021-07-22T13:05:42Z")

</div>

> [@hardillb](#):
>
> `msg.headers = {}`

Thanks hardillb , Thant's resolves the issue, much appreciated

---

<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:** [5 August 2021 13:06 UTC](https://discourse.nodered.org/t/nodered-http-request-error-response-code-408-request-timeout/48761/6 "2021-08-05T13:06:21Z")

</div>

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