Node Red TCP socketTimeout

150 views
Skip to first unread message

Chua Jiahao

unread,
May 4, 2017, 10:56:15 PM5/4/17
to Node-RED
Hi again,

I'm getting an error with the TCP socketTimeout as defined in https://nodered.org/docs/configuration. When I have it enabled (not commented out), node-red keeps getting the following error(pulled from pm2 logs) every few minutes and restarting: 



0|node-red | TypeError: Cannot set property 'connected' of undefined
0|node-red |     at Socket.<anonymous> (/usr/lib/node_modules/node-red/nodes/core/io/31-tcpin.js:574:54)
0|node-red |     at emitNone (events.js:67:13)
0|node-red |     at Socket.emit (events.js:166:7)
0|node-red |     at Socket._onTimeout (net.js:333:8)
0|node-red |     at _runOnTimeout (timers.js:537:11)
0|node-red |     at _makeTimerTimeout (timers.js:528:3)
0|node-red |     at Timer.unrefTimeout (timers.js:597:5)

A quick google search gives this as the most similar issue I've found https://groups.google.com/forum/#!topic/node-red/dIC1qJ3FrOQ
That thread claims the issue has been resolved though, so not sure if it is the same. For reference, I am running v0.16.2 Node-Red on an EC2 t2.micro Instance with Ubuntu 16.04.

Thanks for the help.

Dave C-J

unread,
May 5, 2017, 3:38:10 AM5/5/17
to node...@googlegroups.com
Hi,

not sure why that would fail - given that the line before it check to see if it exists... - but... no matter - as we then delete it a few lines later - there is no reason to set it here either... If you like - can you try deleting line 574 of /usr/lib/node_modules/node-red/nodes/core/io/31-tcpin.js  
Thanks

Nathanaël Lécaudé

unread,
May 6, 2017, 2:57:19 PM5/6/17
to Node-RED
Just submitted a PR for this issue.

Chua Jiahao

unread,
May 9, 2017, 4:06:22 AM5/9/17
to Node-RED
Hi Dave,

Thanks for quick reply. Sorry I did not see this earlier.

Just tried commenting out line 574 of and it appears to be working so far, socket is timing out properly and do not see errors. Will test for another day or two to confirm it is fully working.
Thanks for the help. Will try out this code once I can confirm stability with the fix. 


On Sunday, May 7, 2017 at 2:57:19 AM UTC+8, Nathanaël Lécaudé wrote:
Just submitted a PR for this issue.

Le vendredi 5 mai 2017 03:38:10 UTC-4, Dave C-J a écrit :

Chua Jiahao

unread,
May 11, 2017, 12:04:31 AM5/11/17
to Node-RED
Hi Nathanael,

Your code appears to be working fully. Thank you for the help!



On Sunday, May 7, 2017 at 2:57:19 AM UTC+8, Nathanaël Lécaudé wrote:
Reply all
Reply to author
Forward
0 new messages