Nodered HTTP Request Error Response code 408 (Request Timeout)

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

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

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

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?

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

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

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

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

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

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

2 Likes

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

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