Http request node not working after update to V2.0.1

Just updated to V2.0.1 last night, and after that my flow for text overlay on my Dahua surveillance cameras don't work anymore, and the out is "RequestError: Cookie failed to parse"

After a little debugging i narrowed it down to the http request node, and i made a new simple flow to simplify debugging.

The http request node is using the Dahua API to make a text overlay on the recordings, and is using digest authentication.

The output/error message on the debug node is the following:

21.7.2021 15.52.27node: 3e7590f0e9ae5819msg : error

"RequestError: Cookie failed to parse"

Here is the flow

[{"id":"c419d0b94f54bedf","type":"tab","label":"Dahua Debug V2.0","disabled":false,"info":""},{"id":"3fbb08cc1fe9af1a","type":"inject","z":"c419d0b94f54bedf","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"date","x":380,"y":300,"wires":[["3e7590f0e9ae5819"]]},{"id":"3e7590f0e9ae5819","type":"http request","z":"c419d0b94f54bedf","name":"","method":"POST","ret":"txt","paytoqs":"ignore","url":"http://192.168.1.40/cgi-bin/configManager.cgi?action=setConfig&VideoWidget[0].CustomTitle[1].Text=DebugNodeRedV2.0","tls":"","persist":false,"proxy":"","authType":"digest","x":550,"y":300,"wires":[["50d9ad146405f9dd"]]},{"id":"50d9ad146405f9dd","type":"debug","z":"c419d0b94f54bedf","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":730,"y":300,"wires":[]}]

Node-RED V2.0.1 is installed on a Raspberry Pi 4 running the latest and updated Raspbian GNU/Linux 10 (buster).
I made a search on the forum, and found this post, I don't know if this is related. Maybe related issue.

Let me know if there is anything else you need.
Thank you very much :slight_smile:

Hi @thansen

This was reported earlier today. The fix will be in 2.0.2

1 Like

Thank you for your answer @knolleary , I have updated to V2.0.2, and the cookie error is gone, but a new error has introduced.

I have made two example flows, the first one does not work, the second one works fine.

The following flow gives the following error

22.7.2021 17.36.27node: 6b974c8fe4a5a5b4
msg : error

"RequestError: URI malformed"

[{"id":"7ef673ed0a4b0b69","type":"tab","label":"Dahua debug","disabled":false,"info":""},{"id":"124d4209363f75c8","type":"function","z":"7ef673ed0a4b0b69","name":"","func":"msg.payload = 'Temperature ' + '24,0' + '°' + '|' + 'Humidity ' + '80' + '%' + '|' + 'Wind Speed' + '8,3' + 'm/s';\nreturn [msg];\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":380,"y":140,"wires":[["3f5b4222c9c34487","6b974c8fe4a5a5b4"]],"info":"# dette er en test\n\n> asas\n> efe\n> 3434\n> wrwew\n\n"},{"id":"6b974c8fe4a5a5b4","type":"http request","z":"7ef673ed0a4b0b69","name":"","method":"POST","ret":"bin","paytoqs":"ignore","url":"http://192.168.1.40/cgi-bin/configManager.cgi?action=setConfig&VideoWidget[0].CustomTitle[1].Text={{payload}}","tls":"","persist":false,"proxy":"","authType":"digest","x":590,"y":140,"wires":[[]],"info":"# 112\n## 1212\n### 1212\n"},{"id":"18a62be8bb38520f","type":"inject","z":"7ef673ed0a4b0b69","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"60","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":170,"y":140,"wires":[["124d4209363f75c8"]]},{"id":"3f5b4222c9c34487","type":"debug","z":"7ef673ed0a4b0b69","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":590,"y":180,"wires":[]}]

Working flow

[{"id":"7ef673ed0a4b0b69","type":"tab","label":"Dahua debug","disabled":false,"info":""},{"id":"124d4209363f75c8","type":"function","z":"7ef673ed0a4b0b69","name":"","func":"msg.payload = 'Temperature ' + '24,0' + '°' + '|' + 'Humidity ' + '80' + 'P' + '|' + 'Wind Speed' + '8,3' + 'm/s';\nreturn [msg];\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":380,"y":140,"wires":[["3f5b4222c9c34487","6b974c8fe4a5a5b4"]],"info":"# dette er en test\n\n> asas\n> efe\n> 3434\n> wrwew\n\n"},{"id":"6b974c8fe4a5a5b4","type":"http request","z":"7ef673ed0a4b0b69","name":"","method":"POST","ret":"bin","paytoqs":"ignore","url":"http://192.168.1.40/cgi-bin/configManager.cgi?action=setConfig&VideoWidget[0].CustomTitle[1].Text={{payload}}","tls":"","persist":false,"proxy":"","authType":"digest","x":590,"y":140,"wires":[[]],"info":"# 112\n## 1212\n### 1212\n"},{"id":"18a62be8bb38520f","type":"inject","z":"7ef673ed0a4b0b69","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"60","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":170,"y":140,"wires":[["124d4209363f75c8"]]},{"id":"3f5b4222c9c34487","type":"debug","z":"7ef673ed0a4b0b69","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":590,"y":180,"wires":[]}]

The only difference in the two flows are that in the function node i use '%' in the first flow which is replaced by a 'P' in the second flow, and for some reason it does not like the '%'

I have another issue as well, introduced with the V2, The following node would return the sunrise and set times, but it does not work with V2, it returns nothing at all.

[{"id":"87e2dfe141b3f4f7","type":"tab","label":"Sunrice/set Debug","disabled":false,"info":""},{"id":"1761511da4cc7d8f","type":"inject","z":"87e2dfe141b3f4f7","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"date","x":190,"y":240,"wires":[["4383dd2443230f68"]]},{"id":"4383dd2443230f68","type":"http request","z":"87e2dfe141b3f4f7","name":"Sol OP/NED","method":"GET","ret":"txt","paytoqs":"ignore","url":"https://www.solnedgangidag.dk/silkeborg","tls":"","persist":false,"proxy":"","authType":"","x":400,"y":240,"wires":[["757bdf641892a73c","0dd3427a481fe1c9"]]},{"id":"757bdf641892a73c","type":"html","z":"87e2dfe141b3f4f7","name":"Op","property":"payload","outproperty":"payload","tag":"body > div:nth-child(2) > div.well.visual > div > div:nth-child(1) > h3 > span","ret":"html","as":"multi","x":580,"y":220,"wires":[["a48cb98de943d018"]]},{"id":"0dd3427a481fe1c9","type":"html","z":"87e2dfe141b3f4f7","name":"Ned","property":"payload","outproperty":"payload","tag":"body > div:nth-child(2) > div.well.visual > div > div:nth-child(2) > h3 > span","ret":"html","as":"multi","x":580,"y":260,"wires":[["37f0f98cbc06f22a"]]},{"id":"a48cb98de943d018","type":"function","z":"87e2dfe141b3f4f7","name":"","func":"global.set ('sol_op',msg.payload);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":750,"y":220,"wires":[[]]},{"id":"37f0f98cbc06f22a","type":"function","z":"87e2dfe141b3f4f7","name":"","func":"global.set ('sol_ned',msg.payload);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":750,"y":260,"wires":[[]]}]

Both examples was working in V1.3.5
Let me know if you need anything else from me. Thank you

@thansen can I get you to raise two issues? One for the url params and one for the sunrise/set times?

For the first issue, it looks like the got module handles url params differently to the request module - my guess is request was doing some encoding under the covers that got is not. So we need to do that encoding ourselves now before passing the url to got.

For the second issue, we upgraded the cheerio library used by the html node. It shouldn't have changed the output, but clearly something has changed. We'll need to investigate.

I will do that, just to be sure, the issues should be raised on Github right?

Yes please - Issues · node-red/node-red · GitHub

That said, I think I have the fix for the http request node. But please do still raise the issues.

1 Like

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