Http request node stopped working after update to node red 2.1 - but only for https://tesla.com (solved)

Hi,

after updating to node red 2.1.5 (from a 1.2 install on an ubuntu server) I've troubles with the http-request node. The node is requesting the page, but gets "no response from server". Log says ""TimeoutError: Timeout awaiting 'request' for 120000ms : BUT ONLY from the tesla.com domain.

Background

  • I have a simple flow to pull the page from https://shop.tesla.com/de_de/product/model-y-dachgepacktrager (this is the german shop page for a roof rack - which is currently not available). I process the result and alert myself in the case the part gets available. I trigger the flow every 15 minutes.
  • This worked fine on node red 1.2. Since the upgrade to node red 2.1.5 the node runs into a timeout - no response from server

After some testing I found

The node is pretty basic. Just GET url without any options. Testcase with two http response nodes:

[{"id":"9bb9d33057185e78","type":"http request","z":"e8931623.4900e8","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"https://tesla.com","tls":"","persist":false,"proxy":"","authType":"","senderr":false,"credentials":{},"x":350,"y":2040,"wires":[["214501b94e6783b6"]]},{"id":"88e3a696b234bae7","type":"http request","z":"e8931623.4900e8","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"https://google.com","tls":"","persist":false,"proxy":"","authType":"","senderr":false,"x":350,"y":2100,"wires":[["4bd6bcf8c756fcc1"]]},{"id":"e3d4d18be09531d2","type":"inject","z":"e8931623.4900e8","name":"Start","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":130,"y":2100,"wires":[["88e3a696b234bae7"]]},{"id":"f1783bf702adc595","type":"inject","z":"e8931623.4900e8","name":"Start","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":130,"y":2040,"wires":[["9bb9d33057185e78"]]},{"id":"214501b94e6783b6","type":"debug","z":"e8931623.4900e8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":550,"y":2040,"wires":[]},{"id":"4bd6bcf8c756fcc1","type":"debug","z":"e8931623.4900e8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":550,"y":2100,"wires":[]}]

The first http request (tesla.com) runs into timeout. The second (google.com) works fine...

I also tried to pull tesla.com (via wget https://tesla.com) on the server which running node-red, this still works fine, so it doesnt look by server is blacklisted or such things... node red install is simple ubuntu (via sudo npm install -g --unsafe-perm node-red)

Any ideas where to start diagnosis?

Hello Mak,

Try to put a Function node before the http-request to set a couple of headers.

Example flow

[{"id":"9bb9d33057185e78","type":"http request","z":"54efb553244c241f","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"https://shop.tesla.com/de_de/product/model-y-dachgepacktrager","tls":"","persist":false,"proxy":"","authType":"","senderr":false,"x":670,"y":1180,"wires":[["214501b94e6783b6"]]},{"id":"f1783bf702adc595","type":"inject","z":"54efb553244c241f","name":"Start","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":310,"y":1180,"wires":[["55012c8f0d15df7f"]]},{"id":"214501b94e6783b6","type":"debug","z":"54efb553244c241f","name":"","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":880,"y":1180,"wires":[]},{"id":"55012c8f0d15df7f","type":"function","z":"54efb553244c241f","name":"","func":"msg.headers = {\n    \"User-Agent\": \"PostmanRuntime/7.28.4\",\n    \"Accept\": \"text/html; charset=UTF-8\",\n    \"Cache-Control\": \"no-cache\",\n    \"Connection\": \"keep-alive\"\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":480,"y":1180,"wires":[["9bb9d33057185e78"]]}]

That did it!

Thanks UnborN!!!

1 Like

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