ECONNRESET ERROR: Socket Hang Up

I have been running the below nodes for quite soke tie with no issue (like months or even years), but with no changes that I am aware of, I am now getting ECONNRESET errors on my http nodes.

If I paste the POST URL directly into browser, they work just fine.

I have read other posts on this, but most have to do with XML encoding issues or JSON responses.
My POST requests are very straightforward, and as I said, have been working fine for quite some time.

Any ideas?

The debug node output:

"Error: socket hang up : http://www.mydomainname.com/plant_rt.mv?plant=4565&t1=15105&t2=15529&t3=1&t40=-3703&opti1=0&opti2=122&t5=20000&m_rawstat=IDLE&m_raw=13766&m_fin=12376&m_frac=97&m_frac2=194&mode_p2=undefined&op1_mode=DARK&unloading=No&pH_1=7.38&flow_1=69&v1=13766&v2=undefined&v3=15643&v4=15713&v5=7926&v6=11541&v7=209&v8=-1321&v9=14392&v10=12376&postdaf=33260&postclarifier=30723"

The nodes:

[{"id":"65bac129.0bece8","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"d63e8bba.bcf498","type":"http request","z":"65bac129.0bece8","name":"","method":"POST","ret":"txt","paytoqs":"ignore","url":"http://www.mydomainname.com/plant_rt.mv?{{{query}}}","tls":"","persist":false,"proxy":"","authType":"","x":970,"y":320,"wires":[["a102e026.866638"]]},{"id":"a102e026.866638","type":"debug","z":"65bac129.0bece8","name":"","active":true,"tosidebar":true,"console":false,"complete":"payload","x":1441.4443969726562,"y":376.98406982421875,"wires":[]},{"id":"28d4e2d0.1b50c6","type":"change","z":"65bac129.0bece8","name":"","rules":[{"t":"set","p":"query","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":791.4443969726562,"y":316.98406982421875,"wires":[["d63e8bba.bcf498"]]},{"id":"bbc6068a.0eb978","type":"function","z":"65bac129.0bece8","name":"variable grab","func":"var t1 = global.get(\"gal_frac1\");\nvar t2 = global.get(\"gal_frac2\");\nvar t3 = global.get(\"gal_frac3\");\nvar t40k = global.get(\"gal_40k\");\nvar t5 = global.get(\"gal_frac5\");\nvar t14k = global.get(\"gal_14k\");\nvar opti1 = global.get(\"op1_val\");\nvar opti2 = global.get(\"opti_2_val\");\nvar m_raw = global.get(\"gal_m_raw\");\nvar m_fin = global.get(\"gal_m_fin\");\nvar m_frac = global.get(\"gal_m_frac\");\nvar m_frac2 = global.get(\"gal_m_frac2\");\nvar v1 = global.get(\"gal_m_raw\");\nvar v2 = global.get(\"gal_m_raw2\");\nvar v3 = global.get(\"gal_v3_fogsludge\");\nvar v4 = global.get(\"gal_v4_fogsludge\");\nvar v5 = global.get(\"gal_v5_dafcent\");\nvar v6 = global.get(\"gal_v6_dafcent\");\nvar v7 = global.get(\"gal_v7_sgifin\");\nvar v8 = global.get(\"gal_v8_sgifin2\");\nvar v9 = global.get(\"gal_m_fin2\");\nvar v10 = global.get(\"gal_m_fin\");\n\nvar postdaf = global.get(\"gal_postdaf\");\nvar postclarifier = global.get(\"gal_postclarifier\");\n\nvar m_rawstat = global.get(\"m_rawstat\");\n\n\nvar mode_p2 = global.get(\"mode_p2\");\nvar op1_mode = global.get(\"op1_mode\");\n\nvar pH_1 = global.get(\"pH_1\");\nvar flow_1 = global.get(\"flow_1\");\n\nvar gt_pump = global.get(\"gt_pump\");\n\nif (gt_pump == 1){\n    var unloading = 'No';\n}\nelse{\n    var unloading = 'Yes';\n}\n\nvar msgv4 = 'plant=4565&t1='+t1 + '&t2='+t2 + '&t3='+t3 + '&t40='+t40k + '&opti1='+opti1 + '&opti2='+opti2 + '&t5='+t5 + '&m_rawstat='+m_rawstat + '&m_raw='+m_raw + '&m_fin='+m_fin + '&m_frac='+m_frac + '&m_frac2='+m_frac2 + '&mode_p2='+mode_p2 + '&op1_mode='+op1_mode + '&unloading='+unloading + '&pH_1='+pH_1 + '&flow_1='+flow_1 + '&v1='+v1 + '&v2='+v2 + '&v3='+v3 + '&v4='+v4 + '&v5='+v5 + '&v6='+v6 + '&v7='+v7 + '&v8='+v8 + '&v9='+v9 + '&v10='+v10 + '&postdaf='+postdaf + '&postclarifier='+postclarifier  \nmsg.payload = msgv4\n\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":575.730224609375,"y":319.5873107910156,"wires":[["28d4e2d0.1b50c6"]]},{"id":"7b3c8a56.de220c","type":"inject","z":"65bac129.0bece8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"15","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":403.8730163574219,"y":318.5872497558594,"wires":[["bbc6068a.0eb978"]]}]

In order to stop the forum messing with the flow and to make code readable and usable it is necessary to surround your code with three backticks (also known as a left quote or backquote ```)

``` 
   code goes here 
```

You can edit and correct your post by clicking the pencil :pencil2: icon.

See this post for more details - How to share code or flow json

Thanks for that.

Did you notice that in the error message there are some undefined values in the query?

As colin point out, look at your error message...

"Error: socket hang up : http://www.mydomainname.com/plant_rt.mv?plant=4565&t1=15105&t2=15529&t3=1&t40=-3703&opti1=0&opti2=122&t5=20000&m_rawstat=IDLE&m_raw=13766&m_fin=12376&m_frac=97&m_frac2=194&mode_p2=undefined&op1_mode=DARK&unloading=No&pH_1=7.38&flow_1=69&v1=13766&v2=undefined&v3=15643&v4=15713&v5=7926&v6=11541&v7=209&v8=-1321&v9=14392&v10=12376&postdaf=33260&postclarifier=30723"

in particular
&v2=undefined

In your function you have

var v2 = global.get("gal_m_raw2");

What do you see in the context viewer?

image

Thanks for taking the time to take a look at this.
And thanks for pointing out the undefined variables. While those are problematic, they don't seem to be the cause of the socket hang up error.

I have changed the nodes to eliminate the call to the missing globals, but still have the same error.

Error message:

"Error: socket hang up : http://www.mydoainname.com/plant_rt.mv?plant=4565&t1=12770&t2=18925&t3=1&t40=31306&opti1=1&opti2=3&t5=20000&m_rawstat=IDLE&m_raw=13627&m_fin=12584&m_frac=194&m_frac2=194&mode_p2=0&op1_mode=DARK&unloading=No&pH_1=5.6&flow_1=52&v1=13627&v2=0&v3=15574&v4=15713&v5=7926&v6=14531&v7=278&v8=-417&v9=14392&v10=12584&postdaf=33260&postclarifier=13811"

Edited nodes:

[{"id":"65bac129.0bece8","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"4789df39.231478","type":"http request","z":"65bac129.0bece8","name":"","method":"POST","ret":"txt","paytoqs":"ignore","url":"http://www.mydomainname.com/plant_rt.mv?{{{query}}}","tls":"","persist":false,"proxy":"","authType":"","x":770,"y":280,"wires":[["fd1270c0.b1b158"]]},{"id":"fd1270c0.b1b158","type":"debug","z":"65bac129.0bece8","name":"","active":true,"tosidebar":true,"console":false,"complete":"payload","x":1241.4443969726562,"y":336.98406982421875,"wires":[]},{"id":"13d7a615.b7400a","type":"change","z":"65bac129.0bece8","name":"","rules":[{"t":"set","p":"query","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":591.4443969726562,"y":276.98406982421875,"wires":[["4789df39.231478"]]},{"id":"7928e5ea.c281ac","type":"function","z":"65bac129.0bece8","name":"variable grab","func":"var t1 = global.get(\"gal_frac1\");\nvar t2 = global.get(\"gal_frac2\");\nvar t3 = global.get(\"gal_frac3\");\nvar t40k = global.get(\"gal_40k\");\nvar t5 = global.get(\"gal_frac5\");\nvar t14k = global.get(\"gal_14k\");\nvar opti1 = global.get(\"op1_val\");\nvar opti2 = global.get(\"opti_2_val\");\nvar m_raw = global.get(\"gal_m_raw\");\nvar m_fin = global.get(\"gal_m_fin\");\nvar m_frac = global.get(\"gal_m_frac\");\nvar m_frac2 = global.get(\"gal_m_frac2\");\nvar v1 = global.get(\"gal_m_raw\");\nvar v2 = global.get(\"gal_m_raw2\");\nvar v3 = global.get(\"gal_v3_fogsludge\");\nvar v4 = global.get(\"gal_v4_fogsludge\");\nvar v5 = global.get(\"gal_v5_dafcent\");\nvar v6 = global.get(\"gal_v6_dafcent\");\nvar v7 = global.get(\"gal_v7_sgifin\");\nvar v8 = global.get(\"gal_v8_sgifin2\");\nvar v9 = global.get(\"gal_m_fin2\");\nvar v10 = global.get(\"gal_m_fin\");\n\nvar postdaf = global.get(\"gal_postdaf\");\nvar postclarifier = global.get(\"gal_postclarifier\");\n\nvar m_rawstat = global.get(\"m_rawstat\");\n\n\nvar mode_p2 = global.get(\"mode_p2\");\nvar op1_mode = global.get(\"op1_mode\");\n\nvar pH_1 = global.get(\"pH_1\");\nvar flow_1 = global.get(\"flow_1\");\n\nvar gt_pump = global.get(\"gt_pump\");\n\nif (gt_pump == 1){\n    var unloading = 'No';\n}\nelse{\n    var unloading = 'Yes';\n}\n\nvar msgv4 = 'plant=4565&t1='+t1 + '&t2='+t2 + '&t3='+t3 + '&t40='+t40k + '&opti1='+opti1 + '&opti2='+opti2 + '&t5='+t5 + '&m_rawstat='+m_rawstat + '&m_raw='+m_raw + '&m_fin='+m_fin + '&m_frac='+m_frac + '&m_frac2='+m_frac2 + '&mode_p2='+mode_p2 + '&op1_mode='+op1_mode + '&unloading='+unloading + '&pH_1='+pH_1 + '&flow_1='+flow_1 + '&v1='+v1 + '&v2='+v2 + '&v3='+v3 + '&v4='+v4 + '&v5='+v5 + '&v6='+v6 + '&v7='+v7 + '&v8='+v8 + '&v9='+v9 + '&v10='+v10 + '&postdaf='+postdaf + '&postclarifier='+postclarifier  \nmsg.payload = msgv4\n\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":375.730224609375,"y":279.5873107910156,"wires":[["13d7a615.b7400a"]]},{"id":"4bb3d53a.8c6eec","type":"inject","z":"65bac129.0bece8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"15","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":203.87301635742188,"y":278.5872497558594,"wires":[["7928e5ea.c281ac"]]}]
'''

Have you edited the error message and flow to hide the domain name or is that exactly as in the error? It is unusual to use http rather than https for a domain that you don't want to publish.

Yes. The domain name is edited for this post.

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